From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH8-0006qI-P3; Tue, 04 Dec 2012 00:22:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0006pn-23
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Received: from [85.158.139.211:61678] by server-9.bemta-5.messagelabs.com id
	5C/CD-29295-5324DB05; Tue, 04 Dec 2012 00:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354580530!14688705!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4266 invoked from network); 4 Dec 2012 00:22:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH4-0007FO-IN
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH4-0008LP-FN
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:10 +0000
Message-Id: <E1TfgH4-0008LP-FN@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] AMD IOMMU: include IOMMU interrupt
	information in 'M' debug key output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093631 -3600
# Node ID ba90ecb0231fe7d38522db827515f1d8a4b02045
# Parent  0bc3a489018f56bad12c5a3e88f735f1c78dc789
AMD IOMMU: include IOMMU interrupt information in 'M' debug key output

Note that this also adds a few pieces missing from c/s
25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
supported by an IOMMU, which apparently isn't the case for existing
implementations).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 0bc3a489018f -r ba90ecb0231f xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Wed Nov 28 10:05:52 2012 +0100
+++ b/xen/arch/x86/msi.c	Wed Nov 28 10:07:11 2012 +0100
@@ -263,7 +263,7 @@ static void write_msi_msg(struct msi_des
     }
 }
 
-static void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
+void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
 {
     struct msi_msg msg;
     unsigned int dest;
diff -r 0bc3a489018f -r ba90ecb0231f xen/drivers/passthrough/amd/iommu_detect.c
--- a/xen/drivers/passthrough/amd/iommu_detect.c	Wed Nov 28 10:05:52 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_detect.c	Wed Nov 28 10:07:11 2012 +0100
@@ -39,7 +39,9 @@ static int __init get_iommu_msi_capabili
 
     AMD_IOMMU_DEBUG("Found MSI capability block at %#x\n", pos);
 
-    iommu->msi_cap = pos;
+    iommu->msi.msi_attrib.type = PCI_CAP_ID_MSI;
+    iommu->msi.msi_attrib.pos = pos;
+    iommu->msi.msi_attrib.is_64 = 1;
     return 0;
 }
 
diff -r 0bc3a489018f -r ba90ecb0231f xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Wed Nov 28 10:05:52 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Wed Nov 28 10:07:11 2012 +0100
@@ -449,42 +449,10 @@ static void iommu_reset_log(struct amd_i
     ctrl_func(iommu, IOMMU_CONTROL_ENABLED);
 }
 
-static void iommu_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
-{
-    struct msi_msg msg;
-    unsigned int dest;
-    struct amd_iommu *iommu = desc->action->dev_id;
-    u16 seg = iommu->seg;
-    u8 bus = PCI_BUS(iommu->bdf);
-    u8 dev = PCI_SLOT(iommu->bdf);
-    u8 func = PCI_FUNC(iommu->bdf);
-
-    dest = set_desc_affinity(desc, mask);
-
-    if ( dest == BAD_APICID )
-    {
-        dprintk(XENLOG_ERR, "Set iommu interrupt affinity error!\n");
-        return;
-    }
-
-    msi_compose_msg(desc, &msg);
-    /* Is this override really needed? */
-    msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
-    msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
-
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_DATA_64, msg.data);
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_ADDRESS_LO, msg.address_lo);
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_ADDRESS_HI, msg.address_hi);
-    
-}
-
 static void amd_iommu_msi_enable(struct amd_iommu *iommu, int flag)
 {
     __msi_set_enable(iommu->seg, PCI_BUS(iommu->bdf), PCI_SLOT(iommu->bdf),
-                     PCI_FUNC(iommu->bdf), iommu->msi_cap, flag);
+                     PCI_FUNC(iommu->bdf), iommu->msi.msi_attrib.pos, flag);
 }
 
 static void iommu_msi_unmask(struct irq_desc *desc)
@@ -495,6 +463,7 @@ static void iommu_msi_unmask(struct irq_
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
+    iommu->msi.msi_attrib.masked = 0;
 }
 
 static void iommu_msi_mask(struct irq_desc *desc)
@@ -507,6 +476,7 @@ static void iommu_msi_mask(struct irq_de
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
+    iommu->msi.msi_attrib.masked = 1;
 }
 
 static unsigned int iommu_msi_startup(struct irq_desc *desc)
@@ -530,7 +500,7 @@ static hw_irq_controller iommu_msi_type 
     .disable = iommu_msi_mask,
     .ack = iommu_msi_mask,
     .end = iommu_msi_end,
-    .set_affinity = iommu_msi_set_affinity,
+    .set_affinity = set_msi_affinity,
 };
 
 static unsigned int iommu_maskable_msi_startup(struct irq_desc *desc)
@@ -561,7 +531,7 @@ static hw_irq_controller iommu_maskable_
     .disable = mask_msi_irq,
     .ack = iommu_maskable_msi_ack,
     .end = iommu_maskable_msi_end,
-    .set_affinity = iommu_msi_set_affinity,
+    .set_affinity = set_msi_affinity,
 };
 
 static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
@@ -775,9 +745,11 @@ static void iommu_interrupt_handler(int 
     tasklet_schedule(&amd_iommu_irq_tasklet);
 }
 
-static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
+static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
 {
     int irq, ret;
+    struct irq_desc *desc;
+    unsigned long flags;
     u16 control;
 
     irq = create_irq(NUMA_NO_NODE);
@@ -786,23 +758,38 @@ static int __init set_iommu_interrupt_ha
         dprintk(XENLOG_ERR, "IOMMU: no irqs\n");
         return 0;
     }
-    
+
+    desc = irq_to_desc(irq);
+    spin_lock_irqsave(&pcidevs_lock, flags);
+    iommu->msi.dev = pci_get_pdev(iommu->seg, PCI_BUS(iommu->bdf),
+                                  PCI_DEVFN2(iommu->bdf));
+    spin_unlock_irqrestore(&pcidevs_lock, flags);
+    if ( !iommu->msi.dev )
+    {
+        AMD_IOMMU_DEBUG("IOMMU: no pdev for %04x:%02x:%02x.%u\n",
+                        iommu->seg, PCI_BUS(iommu->bdf),
+                        PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf));
+        return 0;
+    }
+    desc->msi_desc = &iommu->msi;
     control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
                               PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
-                              iommu->msi_cap + PCI_MSI_FLAGS);
-    irq_desc[irq].handler = control & PCI_MSI_FLAGS_MASKBIT ?
-                            &iommu_maskable_msi_type : &iommu_msi_type;
+                              iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);
+    iommu->msi.msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT);
+    desc->handler = control & PCI_MSI_FLAGS_MASKBIT ?
+                    &iommu_maskable_msi_type : &iommu_msi_type;
     ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
     if ( ret )
     {
-        irq_desc[irq].handler = &no_irq_type;
+        desc->handler = &no_irq_type;
         destroy_irq(irq);
         AMD_IOMMU_DEBUG("can't request irq\n");
         return 0;
     }
 
-    iommu->irq = irq;
-    return irq;
+    iommu->msi.irq = irq;
+
+    return 1;
 }
 
 static void enable_iommu(struct amd_iommu *iommu)
@@ -825,7 +812,7 @@ static void enable_iommu(struct amd_iomm
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         register_iommu_ppr_log_in_mmio_space(iommu);
 
-    iommu_msi_set_affinity(irq_to_desc(iommu->irq), &cpu_online_map);
+    set_msi_affinity(irq_to_desc(iommu->msi.irq), &cpu_online_map);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
 
     set_iommu_ht_flags(iommu);
@@ -947,7 +934,7 @@ static int __init amd_iommu_init_one(str
         if ( allocate_ppr_log(iommu) == NULL )
             goto error_out;
 
-    if ( set_iommu_interrupt_handler(iommu) == 0 )
+    if ( !set_iommu_interrupt_handler(iommu) )
         goto error_out;
 
     /* To make sure that device_table.buffer has been successfully allocated */
diff -r 0bc3a489018f -r ba90ecb0231f xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Wed Nov 28 10:05:52 2012 +0100
+++ b/xen/include/asm-x86/amd-iommu.h	Wed Nov 28 10:07:11 2012 +0100
@@ -25,6 +25,7 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/tasklet.h>
+#include <asm/msi.h>
 #include <asm/hvm/svm/amd-iommu-defs.h>
 
 #define iommu_found()           (!list_empty(&amd_iommu_head))
@@ -82,8 +83,9 @@ struct amd_iommu {
 
     u16 seg;
     u16 bdf;
+    struct msi_desc msi;
+
     u16 cap_offset;
-    u8 msi_cap;
     iommu_cap_t cap;
 
     u8 ht_flags;
@@ -103,7 +105,6 @@ struct amd_iommu {
     uint64_t exclusion_limit;
 
     int enabled;
-    int irq;
 };
 
 struct ivrs_mappings {
diff -r 0bc3a489018f -r ba90ecb0231f xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Wed Nov 28 10:05:52 2012 +0100
+++ b/xen/include/asm-x86/msi.h	Wed Nov 28 10:07:11 2012 +0100
@@ -214,5 +214,6 @@ void mask_msi_irq(struct irq_desc *);
 void unmask_msi_irq(struct irq_desc *);
 void ack_nonmaskable_msi_irq(struct irq_desc *);
 void end_nonmaskable_msi_irq(struct irq_desc *, u8 vector);
+void set_msi_affinity(struct irq_desc *, const cpumask_t *);
 
 #endif /* __ASM_MSI_H */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH8-0006qI-P3; Tue, 04 Dec 2012 00:22:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0006pn-23
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Received: from [85.158.139.211:61678] by server-9.bemta-5.messagelabs.com id
	5C/CD-29295-5324DB05; Tue, 04 Dec 2012 00:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354580530!14688705!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4266 invoked from network); 4 Dec 2012 00:22:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH4-0007FO-IN
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH4-0008LP-FN
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:10 +0000
Message-Id: <E1TfgH4-0008LP-FN@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] AMD IOMMU: include IOMMU interrupt
	information in 'M' debug key output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093631 -3600
# Node ID ba90ecb0231fe7d38522db827515f1d8a4b02045
# Parent  0bc3a489018f56bad12c5a3e88f735f1c78dc789
AMD IOMMU: include IOMMU interrupt information in 'M' debug key output

Note that this also adds a few pieces missing from c/s
25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
supported by an IOMMU, which apparently isn't the case for existing
implementations).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 0bc3a489018f -r ba90ecb0231f xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Wed Nov 28 10:05:52 2012 +0100
+++ b/xen/arch/x86/msi.c	Wed Nov 28 10:07:11 2012 +0100
@@ -263,7 +263,7 @@ static void write_msi_msg(struct msi_des
     }
 }
 
-static void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
+void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
 {
     struct msi_msg msg;
     unsigned int dest;
diff -r 0bc3a489018f -r ba90ecb0231f xen/drivers/passthrough/amd/iommu_detect.c
--- a/xen/drivers/passthrough/amd/iommu_detect.c	Wed Nov 28 10:05:52 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_detect.c	Wed Nov 28 10:07:11 2012 +0100
@@ -39,7 +39,9 @@ static int __init get_iommu_msi_capabili
 
     AMD_IOMMU_DEBUG("Found MSI capability block at %#x\n", pos);
 
-    iommu->msi_cap = pos;
+    iommu->msi.msi_attrib.type = PCI_CAP_ID_MSI;
+    iommu->msi.msi_attrib.pos = pos;
+    iommu->msi.msi_attrib.is_64 = 1;
     return 0;
 }
 
diff -r 0bc3a489018f -r ba90ecb0231f xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Wed Nov 28 10:05:52 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Wed Nov 28 10:07:11 2012 +0100
@@ -449,42 +449,10 @@ static void iommu_reset_log(struct amd_i
     ctrl_func(iommu, IOMMU_CONTROL_ENABLED);
 }
 
-static void iommu_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
-{
-    struct msi_msg msg;
-    unsigned int dest;
-    struct amd_iommu *iommu = desc->action->dev_id;
-    u16 seg = iommu->seg;
-    u8 bus = PCI_BUS(iommu->bdf);
-    u8 dev = PCI_SLOT(iommu->bdf);
-    u8 func = PCI_FUNC(iommu->bdf);
-
-    dest = set_desc_affinity(desc, mask);
-
-    if ( dest == BAD_APICID )
-    {
-        dprintk(XENLOG_ERR, "Set iommu interrupt affinity error!\n");
-        return;
-    }
-
-    msi_compose_msg(desc, &msg);
-    /* Is this override really needed? */
-    msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
-    msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
-
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_DATA_64, msg.data);
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_ADDRESS_LO, msg.address_lo);
-    pci_conf_write32(seg, bus, dev, func,
-        iommu->msi_cap + PCI_MSI_ADDRESS_HI, msg.address_hi);
-    
-}
-
 static void amd_iommu_msi_enable(struct amd_iommu *iommu, int flag)
 {
     __msi_set_enable(iommu->seg, PCI_BUS(iommu->bdf), PCI_SLOT(iommu->bdf),
-                     PCI_FUNC(iommu->bdf), iommu->msi_cap, flag);
+                     PCI_FUNC(iommu->bdf), iommu->msi.msi_attrib.pos, flag);
 }
 
 static void iommu_msi_unmask(struct irq_desc *desc)
@@ -495,6 +463,7 @@ static void iommu_msi_unmask(struct irq_
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
+    iommu->msi.msi_attrib.masked = 0;
 }
 
 static void iommu_msi_mask(struct irq_desc *desc)
@@ -507,6 +476,7 @@ static void iommu_msi_mask(struct irq_de
     spin_lock_irqsave(&iommu->lock, flags);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
     spin_unlock_irqrestore(&iommu->lock, flags);
+    iommu->msi.msi_attrib.masked = 1;
 }
 
 static unsigned int iommu_msi_startup(struct irq_desc *desc)
@@ -530,7 +500,7 @@ static hw_irq_controller iommu_msi_type 
     .disable = iommu_msi_mask,
     .ack = iommu_msi_mask,
     .end = iommu_msi_end,
-    .set_affinity = iommu_msi_set_affinity,
+    .set_affinity = set_msi_affinity,
 };
 
 static unsigned int iommu_maskable_msi_startup(struct irq_desc *desc)
@@ -561,7 +531,7 @@ static hw_irq_controller iommu_maskable_
     .disable = mask_msi_irq,
     .ack = iommu_maskable_msi_ack,
     .end = iommu_maskable_msi_end,
-    .set_affinity = iommu_msi_set_affinity,
+    .set_affinity = set_msi_affinity,
 };
 
 static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[])
@@ -775,9 +745,11 @@ static void iommu_interrupt_handler(int 
     tasklet_schedule(&amd_iommu_irq_tasklet);
 }
 
-static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
+static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
 {
     int irq, ret;
+    struct irq_desc *desc;
+    unsigned long flags;
     u16 control;
 
     irq = create_irq(NUMA_NO_NODE);
@@ -786,23 +758,38 @@ static int __init set_iommu_interrupt_ha
         dprintk(XENLOG_ERR, "IOMMU: no irqs\n");
         return 0;
     }
-    
+
+    desc = irq_to_desc(irq);
+    spin_lock_irqsave(&pcidevs_lock, flags);
+    iommu->msi.dev = pci_get_pdev(iommu->seg, PCI_BUS(iommu->bdf),
+                                  PCI_DEVFN2(iommu->bdf));
+    spin_unlock_irqrestore(&pcidevs_lock, flags);
+    if ( !iommu->msi.dev )
+    {
+        AMD_IOMMU_DEBUG("IOMMU: no pdev for %04x:%02x:%02x.%u\n",
+                        iommu->seg, PCI_BUS(iommu->bdf),
+                        PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf));
+        return 0;
+    }
+    desc->msi_desc = &iommu->msi;
     control = pci_conf_read16(iommu->seg, PCI_BUS(iommu->bdf),
                               PCI_SLOT(iommu->bdf), PCI_FUNC(iommu->bdf),
-                              iommu->msi_cap + PCI_MSI_FLAGS);
-    irq_desc[irq].handler = control & PCI_MSI_FLAGS_MASKBIT ?
-                            &iommu_maskable_msi_type : &iommu_msi_type;
+                              iommu->msi.msi_attrib.pos + PCI_MSI_FLAGS);
+    iommu->msi.msi_attrib.maskbit = !!(control & PCI_MSI_FLAGS_MASKBIT);
+    desc->handler = control & PCI_MSI_FLAGS_MASKBIT ?
+                    &iommu_maskable_msi_type : &iommu_msi_type;
     ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
     if ( ret )
     {
-        irq_desc[irq].handler = &no_irq_type;
+        desc->handler = &no_irq_type;
         destroy_irq(irq);
         AMD_IOMMU_DEBUG("can't request irq\n");
         return 0;
     }
 
-    iommu->irq = irq;
-    return irq;
+    iommu->msi.irq = irq;
+
+    return 1;
 }
 
 static void enable_iommu(struct amd_iommu *iommu)
@@ -825,7 +812,7 @@ static void enable_iommu(struct amd_iomm
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         register_iommu_ppr_log_in_mmio_space(iommu);
 
-    iommu_msi_set_affinity(irq_to_desc(iommu->irq), &cpu_online_map);
+    set_msi_affinity(irq_to_desc(iommu->msi.irq), &cpu_online_map);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
 
     set_iommu_ht_flags(iommu);
@@ -947,7 +934,7 @@ static int __init amd_iommu_init_one(str
         if ( allocate_ppr_log(iommu) == NULL )
             goto error_out;
 
-    if ( set_iommu_interrupt_handler(iommu) == 0 )
+    if ( !set_iommu_interrupt_handler(iommu) )
         goto error_out;
 
     /* To make sure that device_table.buffer has been successfully allocated */
diff -r 0bc3a489018f -r ba90ecb0231f xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Wed Nov 28 10:05:52 2012 +0100
+++ b/xen/include/asm-x86/amd-iommu.h	Wed Nov 28 10:07:11 2012 +0100
@@ -25,6 +25,7 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/tasklet.h>
+#include <asm/msi.h>
 #include <asm/hvm/svm/amd-iommu-defs.h>
 
 #define iommu_found()           (!list_empty(&amd_iommu_head))
@@ -82,8 +83,9 @@ struct amd_iommu {
 
     u16 seg;
     u16 bdf;
+    struct msi_desc msi;
+
     u16 cap_offset;
-    u8 msi_cap;
     iommu_cap_t cap;
 
     u8 ht_flags;
@@ -103,7 +105,6 @@ struct amd_iommu {
     uint64_t exclusion_limit;
 
     int enabled;
-    int irq;
 };
 
 struct ivrs_mappings {
diff -r 0bc3a489018f -r ba90ecb0231f xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Wed Nov 28 10:05:52 2012 +0100
+++ b/xen/include/asm-x86/msi.h	Wed Nov 28 10:07:11 2012 +0100
@@ -214,5 +214,6 @@ void mask_msi_irq(struct irq_desc *);
 void unmask_msi_irq(struct irq_desc *);
 void ack_nonmaskable_msi_irq(struct irq_desc *);
 void end_nonmaskable_msi_irq(struct irq_desc *, u8 vector);
+void set_msi_affinity(struct irq_desc *, const cpumask_t *);
 
 #endif /* __ASM_MSI_H */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH8-0006q3-H2; Tue, 04 Dec 2012 00:22:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0006pM-96
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Received: from [85.158.138.51:21003] by server-12.bemta-3.messagelabs.com id
	01/4A-22757-3324DB05; Tue, 04 Dec 2012 00:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1354580529!32647052!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24579 invoked from network); 4 Dec 2012 00:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH2-0007FF-VQ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH2-0008Kg-Pu
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:08 +0000
Message-Id: <E1TfgH2-0008Kg-Pu@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: fix hypercall continuation
	cancellation in XENMAPSPACE_gmfn_range compat wrapper
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093346 -3600
# Node ID 7670eabcbafc7251c336550cd7ce3ea4078a36b9
# Parent  0aa1c5136a548a9d2498febc0d3bcee71ebeeafe
x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper

When no continuation was established, there must also not be an attempt
to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
multicall case, adjusts the guest mode return address in a way assuming
that an earlier call hypercall_create_continuation() took place.

Once touching this code, also restructure it slightly to improve
readability and switch to using the more relaxed copy function (copying
from the same guest memory already validated the virtual address
range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 0aa1c5136a54 -r 7670eabcbafc xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Wed Nov 28 10:01:33 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/mm.c	Wed Nov 28 10:02:26 2012 +0100
@@ -66,21 +66,20 @@ int compat_arch_memory_op(int op, XEN_GU
         XLAT_add_to_physmap(nat, &cmp);
         rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
 
-        if ( cmp.space == XENMAPSPACE_gmfn_range )
+        if ( !rc || cmp.space != XENMAPSPACE_gmfn_range )
+            break;
+
+        XLAT_add_to_physmap(&cmp, nat);
+        if ( __copy_to_guest(arg, &cmp, 1) )
         {
-            if ( rc )
-            {
-                XLAT_add_to_physmap(&cmp, nat);
-                if ( copy_to_guest(arg, &cmp, 1) )
-                {
-                    hypercall_cancel_continuation();
-                    return -EFAULT;
-                }
-            }
             if ( rc == __HYPERVISOR_memory_op )
-                hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+                hypercall_cancel_continuation();
+            return -EFAULT;
         }
 
+        if ( rc == __HYPERVISOR_memory_op )
+            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+
         break;
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH9-0006qm-Tu; Tue, 04 Dec 2012 00:22:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0006pg-Un
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Received: from [85.158.143.35:25968] by server-3.bemta-4.messagelabs.com id
	56/3B-06841-6324DB05; Tue, 04 Dec 2012 00:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1354580532!13940703!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8331 invoked from network); 4 Dec 2012 00:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0007Fa-Kp
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0008MQ-JD
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Message-Id: <E1TfgH6-0008MQ-JD@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Comment the definitions of
	_mfn(), _gfn() &c.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1354186193 0
# Node ID 9c6c13bf380355d6814d60f8b2da308cee07a15a
# Parent  5d7e3c2742e8378bdf312b3d9861d6c141e80fff
x86/mm: Comment the definitions of _mfn(), _gfn() &c.

It's not very easy to find them if you don't know to look for the
TYPE_SAFE() macro.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 5d7e3c2742e8 -r 9c6c13bf3803 xen/include/asm-x86/guest_pt.h
--- a/xen/include/asm-x86/guest_pt.h	Thu Nov 29 09:14:55 2012 +0100
+++ b/xen/include/asm-x86/guest_pt.h	Thu Nov 29 10:49:53 2012 +0000
@@ -37,6 +37,11 @@
 TYPE_SAFE(unsigned long,gfn)
 #define PRI_gfn "05lx"
 
+#ifndef gfn_t
+#define gfn_t /* Grep fodder: gfn_t, _gfn() and gfn_x() are defined above */
+#undef gfn_t
+#endif
+
 #define VALID_GFN(m) (m != INVALID_GFN)
 
 static inline int
diff -r 5d7e3c2742e8 -r 9c6c13bf3803 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Nov 29 09:14:55 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Thu Nov 29 10:49:53 2012 +0000
@@ -456,6 +456,11 @@ static inline _type _name##_x(_name##_t 
 
 TYPE_SAFE(unsigned long,mfn);
 
+#ifndef mfn_t
+#define mfn_t /* Grep fodder: mfn_t, _mfn() and mfn_x() are defined above */
+#undef mfn_t
+#endif
+
 /* Macro for printk formats: use as printk("%"PRI_mfn"\n", mfn_x(foo)); */
 #define PRI_mfn "05lx"
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH8-0006qD-MZ; Tue, 04 Dec 2012 00:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH7-0006pg-P6
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Received: from [85.158.143.35:25922] by server-3.bemta-4.messagelabs.com id
	33/3B-06841-4324DB05; Tue, 04 Dec 2012 00:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354580530!4279520!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16144 invoked from network); 4 Dec 2012 00:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH4-0007FL-3A
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH3-0008LA-U9
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:09 +0000
Message-Id: <E1TfgH3-0008LA-U9@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: include IOMMU interrupt
	information in 'M' debug key output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093552 -3600
# Node ID 0bc3a489018f56bad12c5a3e88f735f1c78dc789
# Parent  5faf5b8b702e0c7ad9f362dcde3ee41d950f66b7
VT-d: include IOMMU interrupt information in 'M' debug key output

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 5faf5b8b702e -r 0bc3a489018f xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 28 10:03:51 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 28 10:05:52 2012 +0100
@@ -1008,6 +1008,7 @@ static void dma_msi_unmask(struct irq_de
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
+    iommu->msi.msi_attrib.masked = 0;
 }
 
 static void dma_msi_mask(struct irq_desc *desc)
@@ -1019,6 +1020,7 @@ static void dma_msi_mask(struct irq_desc
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
+    iommu->msi.msi_attrib.masked = 1;
 }
 
 static unsigned int dma_msi_startup(struct irq_desc *desc)
@@ -1059,6 +1061,7 @@ static void dma_msi_set_affinity(struct 
         msg.address_hi = dest & 0xFFFFFF00;
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
+    iommu->msi.msg = msg;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FEDATA_REG, msg.data);
@@ -1082,6 +1085,8 @@ static int __init iommu_set_interrupt(st
 {
     int irq, ret;
     struct acpi_rhsa_unit *rhsa = drhd_to_rhsa(drhd);
+    struct iommu *iommu = drhd->iommu;
+    struct irq_desc *desc;
 
     irq = create_irq(rhsa ? pxm_to_node(rhsa->proximity_domain)
                           : NUMA_NO_NODE);
@@ -1091,17 +1096,24 @@ static int __init iommu_set_interrupt(st
         return -EINVAL;
     }
 
-    irq_desc[irq].handler = &dma_msi_type;
-    ret = request_irq(irq, iommu_page_fault, 0, "dmar", drhd->iommu);
+    desc = irq_to_desc(irq);
+    desc->handler = &dma_msi_type;
+    ret = request_irq(irq, iommu_page_fault, 0, "dmar", iommu);
     if ( ret )
     {
-        irq_desc[irq].handler = &no_irq_type;
+        desc->handler = &no_irq_type;
         destroy_irq(irq);
         dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: can't request irq\n");
         return ret;
     }
 
-    return irq;
+    iommu->msi.irq = irq;
+    iommu->msi.msi_attrib.pos = MSI_TYPE_IOMMU;
+    iommu->msi.msi_attrib.maskbit = 1;
+    iommu->msi.msi_attrib.is_64 = 1;
+    desc->msi_desc = &iommu->msi;
+
+    return 0;
 }
 
 int __init iommu_alloc(struct acpi_drhd_unit *drhd)
@@ -1121,7 +1133,7 @@ int __init iommu_alloc(struct acpi_drhd_
     if ( iommu == NULL )
         return -ENOMEM;
 
-    iommu->irq = -1; /* No irq assigned yet. */
+    iommu->msi.irq = -1; /* No irq assigned yet. */
 
     iommu->intel = alloc_intel_iommu();
     if ( iommu->intel == NULL )
@@ -1218,8 +1230,8 @@ void __init iommu_free(struct acpi_drhd_
     xfree(iommu->domid_map);
 
     free_intel_iommu(iommu->intel);
-    if ( iommu->irq >= 0 )
-        destroy_irq(iommu->irq);
+    if ( iommu->msi.irq >= 0 )
+        destroy_irq(iommu->msi.irq);
     xfree(iommu);
 }
 
@@ -1976,7 +1988,7 @@ static int init_vtd_hw(void)
 
         iommu = drhd->iommu;
 
-        desc = irq_to_desc(iommu->irq);
+        desc = irq_to_desc(iommu->msi.irq);
         dma_msi_set_affinity(desc, desc->arch.cpu_mask);
 
         clear_fault_bits(iommu);
@@ -2122,12 +2134,11 @@ int __init intel_vtd_setup(void)
             iommu_hap_pt_share = 0;
 
         ret = iommu_set_interrupt(drhd);
-        if ( ret < 0 )
+        if ( ret )
         {
             dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: interrupt setup failed\n");
             goto error;
         }
-        iommu->irq = ret;
     }
 
     softirq_tasklet_init(&vtd_fault_tasklet, do_iommu_page_fault, 0);
diff -r 5faf5b8b702e -r 0bc3a489018f xen/drivers/passthrough/vtd/iommu.h
--- a/xen/drivers/passthrough/vtd/iommu.h	Wed Nov 28 10:03:51 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.h	Wed Nov 28 10:05:52 2012 +0100
@@ -21,6 +21,7 @@
 #define _INTEL_IOMMU_H_
 
 #include <xen/iommu.h>
+#include <asm/msi.h>
 
 /*
  * Intel IOMMU register specification per version 1.0 public spec.
@@ -520,7 +521,7 @@ struct iommu {
     spinlock_t lock; /* protect context, domain ids */
     spinlock_t register_lock; /* protect iommu register handling */
     u64 root_maddr; /* root entry machine address */
-    int irq;
+    struct msi_desc msi;
     struct intel_iommu *intel;
     unsigned long *domid_bitmap;  /* domain id bitmap */
     u16 *domid_map;               /* domain id mapping array */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH9-0006qh-Rc; Tue, 04 Dec 2012 00:22:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0006pn-Mb
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Received: from [85.158.139.83:12973] by server-9.bemta-5.messagelabs.com id
	CC/CD-29295-5324DB05; Tue, 04 Dec 2012 00:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354580531!24259905!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5111 invoked from network); 4 Dec 2012 00:22:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH5-0007FR-6b
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH5-0008Le-1j
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:11 +0000
Message-Id: <E1TfgH5-0008Le-1j@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: adjust IOMMU interrupt
	affinities when all CPUs are online
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093704 -3600
# Node ID 1fce7522daa6bab9fce93b95adf592193c904097
# Parent  ba90ecb0231fe7d38522db827515f1d8a4b02045
VT-d: adjust IOMMU interrupt affinities when all CPUs are online

Since these interrupts get setup before APs get brought online, their
affinities naturally could only ever point to CPU 0 alone so far.
Adjust this to include potentially multiple CPUs in the target mask
(when running in one of the cluster modes), and take into account NUMA
information (to handle the interrupts on a CPU on the node where the
respective IOMMU is).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r ba90ecb0231f -r 1fce7522daa6 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c	Wed Nov 28 10:07:11 2012 +0100
+++ b/xen/arch/x86/acpi/power.c	Wed Nov 28 10:08:24 2012 +0100
@@ -219,6 +219,7 @@ static int enter_state(u32 state)
     mtrr_aps_sync_begin();
     enable_nonboot_cpus();
     mtrr_aps_sync_end();
+    adjust_vtd_irq_affinities();
     acpi_dmar_zap();
     thaw_domains();
     system_state = SYS_STATE_active;
diff -r ba90ecb0231f -r 1fce7522daa6 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 28 10:07:11 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 28 10:08:24 2012 +0100
@@ -1971,6 +1971,33 @@ void clear_fault_bits(struct iommu *iomm
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
 
+static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)
+{
+    const struct acpi_rhsa_unit *rhsa = drhd_to_rhsa(drhd);
+    unsigned int node = rhsa ? pxm_to_node(rhsa->proximity_domain)
+                             : NUMA_NO_NODE;
+    const cpumask_t *cpumask = &cpu_online_map;
+
+    if ( node < MAX_NUMNODES && node_online(node) &&
+         cpumask_intersects(&node_to_cpumask(node), cpumask) )
+        cpumask = &node_to_cpumask(node);
+    dma_msi_set_affinity(irq_to_desc(drhd->iommu->msi.irq), cpumask);
+}
+
+int adjust_vtd_irq_affinities(void)
+{
+    struct acpi_drhd_unit *drhd;
+
+    if ( !iommu_enabled )
+        return 0;
+
+    for_each_drhd_unit ( drhd )
+        adjust_irq_affinity(drhd);
+
+    return 0;
+}
+__initcall(adjust_vtd_irq_affinities);
+
 static int init_vtd_hw(void)
 {
     struct acpi_drhd_unit *drhd;
@@ -1984,13 +2011,10 @@ static int init_vtd_hw(void)
      */
     for_each_drhd_unit ( drhd )
     {
-        struct irq_desc *desc;
+        adjust_irq_affinity(drhd);
 
         iommu = drhd->iommu;
 
-        desc = irq_to_desc(iommu->msi.irq);
-        dma_msi_set_affinity(desc, desc->arch.cpu_mask);
-
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
diff -r ba90ecb0231f -r 1fce7522daa6 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Wed Nov 28 10:07:11 2012 +0100
+++ b/xen/include/xen/iommu.h	Wed Nov 28 10:08:24 2012 +0100
@@ -137,6 +137,9 @@ int iommu_do_domctl(struct xen_domctl *,
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);
 
+/* While VT-d specific, this must get declared in a generic header. */
+int adjust_vtd_irq_affinities(void);
+
 /*
  * The purpose of the iommu_dont_flush_iotlb optional cpu flag is to
  * avoid unecessary iotlb_flush in the low level IOMMU code.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH8-0006q3-H2; Tue, 04 Dec 2012 00:22:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0006pM-96
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Received: from [85.158.138.51:21003] by server-12.bemta-3.messagelabs.com id
	01/4A-22757-3324DB05; Tue, 04 Dec 2012 00:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1354580529!32647052!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24579 invoked from network); 4 Dec 2012 00:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH2-0007FF-VQ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH2-0008Kg-Pu
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:08 +0000
Message-Id: <E1TfgH2-0008Kg-Pu@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: fix hypercall continuation
	cancellation in XENMAPSPACE_gmfn_range compat wrapper
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093346 -3600
# Node ID 7670eabcbafc7251c336550cd7ce3ea4078a36b9
# Parent  0aa1c5136a548a9d2498febc0d3bcee71ebeeafe
x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper

When no continuation was established, there must also not be an attempt
to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
multicall case, adjusts the guest mode return address in a way assuming
that an earlier call hypercall_create_continuation() took place.

Once touching this code, also restructure it slightly to improve
readability and switch to using the more relaxed copy function (copying
from the same guest memory already validated the virtual address
range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 0aa1c5136a54 -r 7670eabcbafc xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Wed Nov 28 10:01:33 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/mm.c	Wed Nov 28 10:02:26 2012 +0100
@@ -66,21 +66,20 @@ int compat_arch_memory_op(int op, XEN_GU
         XLAT_add_to_physmap(nat, &cmp);
         rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
 
-        if ( cmp.space == XENMAPSPACE_gmfn_range )
+        if ( !rc || cmp.space != XENMAPSPACE_gmfn_range )
+            break;
+
+        XLAT_add_to_physmap(&cmp, nat);
+        if ( __copy_to_guest(arg, &cmp, 1) )
         {
-            if ( rc )
-            {
-                XLAT_add_to_physmap(&cmp, nat);
-                if ( copy_to_guest(arg, &cmp, 1) )
-                {
-                    hypercall_cancel_continuation();
-                    return -EFAULT;
-                }
-            }
             if ( rc == __HYPERVISOR_memory_op )
-                hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+                hypercall_cancel_continuation();
+            return -EFAULT;
         }
 
+        if ( rc == __HYPERVISOR_memory_op )
+            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+
         break;
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH8-0006q8-Jv; Tue, 04 Dec 2012 00:22:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0006pQ-UK
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Received: from [85.158.139.211:61615] by server-11.bemta-5.messagelabs.com id
	3E/3B-03409-4324DB05; Tue, 04 Dec 2012 00:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354580530!18943642!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11942 invoked from network); 4 Dec 2012 00:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH3-0007FI-N6
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH3-0008Kv-Bn
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:09 +0000
Message-Id: <E1TfgH3-0008Kv-Bn@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ACPI: fix return value of XEN_PM_PDC
	platform op
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093431 -3600
# Node ID 5faf5b8b702e0c7ad9f362dcde3ee41d950f66b7
# Parent  7670eabcbafc7251c336550cd7ce3ea4078a36b9
ACPI: fix return value of XEN_PM_PDC platform op

Should return -EFAULT when copying to guest memory fails.

Once touching this code, also switch to using the more relaxed copy
function (copying from the same guest memory already validated the
virtual address range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 7670eabcbafc -r 5faf5b8b702e xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c	Wed Nov 28 10:02:26 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c	Wed Nov 28 10:03:51 2012 +0100
@@ -521,8 +521,8 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_G
                     ACPI_PDC_SMP_C1PT) & ~mask;
         ret = arch_acpi_set_pdc_bits(acpi_id, bits, mask);
     }
-    if ( !ret )
-        ret = copy_to_guest_offset(pdc, 2, bits + 2, 1);
+    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, 1) )
+        ret = -EFAULT;
 
     return ret;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH7-0006pi-E6; Tue, 04 Dec 2012 00:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0006pN-9J
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Received: from [85.158.138.51:35698] by server-7.bemta-3.messagelabs.com id
	18/0C-01713-3324DB05; Tue, 04 Dec 2012 00:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354580529!29031397!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13647 invoked from network); 4 Dec 2012 00:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH2-0007FC-Jz
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH2-0008KR-5K
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:08 +0000
Message-Id: <E1TfgH2-0008KR-5K@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] README: adjust gcc version
	requirement
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093293 -3600
# Node ID 0aa1c5136a548a9d2498febc0d3bcee71ebeeafe
# Parent  1c69c938f641a643e6ebfbdfc412e2c601e7032d
README: adjust gcc version requirement

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 1c69c938f641 -r 0aa1c5136a54 README
--- a/README	Tue Nov 27 14:13:41 2012 +0000
+++ b/README	Wed Nov 28 10:01:33 2012 +0100
@@ -38,7 +38,7 @@ First, there are a number of prerequisit
 release. Make sure you have all the following installed, either by
 visiting the project webpage or installing a pre-built package
 provided by your OS distributor:
-    * GCC v3.4 or later
+    * GCC v4.1 or later
     * GNU Make
     * GNU Binutils
     * Development install of zlib (e.g., zlib-dev)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH9-0006qh-Rc; Tue, 04 Dec 2012 00:22:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0006pn-Mb
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Received: from [85.158.139.83:12973] by server-9.bemta-5.messagelabs.com id
	CC/CD-29295-5324DB05; Tue, 04 Dec 2012 00:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1354580531!24259905!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5111 invoked from network); 4 Dec 2012 00:22:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH5-0007FR-6b
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH5-0008Le-1j
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:11 +0000
Message-Id: <E1TfgH5-0008Le-1j@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: adjust IOMMU interrupt
	affinities when all CPUs are online
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093704 -3600
# Node ID 1fce7522daa6bab9fce93b95adf592193c904097
# Parent  ba90ecb0231fe7d38522db827515f1d8a4b02045
VT-d: adjust IOMMU interrupt affinities when all CPUs are online

Since these interrupts get setup before APs get brought online, their
affinities naturally could only ever point to CPU 0 alone so far.
Adjust this to include potentially multiple CPUs in the target mask
(when running in one of the cluster modes), and take into account NUMA
information (to handle the interrupts on a CPU on the node where the
respective IOMMU is).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r ba90ecb0231f -r 1fce7522daa6 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c	Wed Nov 28 10:07:11 2012 +0100
+++ b/xen/arch/x86/acpi/power.c	Wed Nov 28 10:08:24 2012 +0100
@@ -219,6 +219,7 @@ static int enter_state(u32 state)
     mtrr_aps_sync_begin();
     enable_nonboot_cpus();
     mtrr_aps_sync_end();
+    adjust_vtd_irq_affinities();
     acpi_dmar_zap();
     thaw_domains();
     system_state = SYS_STATE_active;
diff -r ba90ecb0231f -r 1fce7522daa6 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 28 10:07:11 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 28 10:08:24 2012 +0100
@@ -1971,6 +1971,33 @@ void clear_fault_bits(struct iommu *iomm
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
 
+static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)
+{
+    const struct acpi_rhsa_unit *rhsa = drhd_to_rhsa(drhd);
+    unsigned int node = rhsa ? pxm_to_node(rhsa->proximity_domain)
+                             : NUMA_NO_NODE;
+    const cpumask_t *cpumask = &cpu_online_map;
+
+    if ( node < MAX_NUMNODES && node_online(node) &&
+         cpumask_intersects(&node_to_cpumask(node), cpumask) )
+        cpumask = &node_to_cpumask(node);
+    dma_msi_set_affinity(irq_to_desc(drhd->iommu->msi.irq), cpumask);
+}
+
+int adjust_vtd_irq_affinities(void)
+{
+    struct acpi_drhd_unit *drhd;
+
+    if ( !iommu_enabled )
+        return 0;
+
+    for_each_drhd_unit ( drhd )
+        adjust_irq_affinity(drhd);
+
+    return 0;
+}
+__initcall(adjust_vtd_irq_affinities);
+
 static int init_vtd_hw(void)
 {
     struct acpi_drhd_unit *drhd;
@@ -1984,13 +2011,10 @@ static int init_vtd_hw(void)
      */
     for_each_drhd_unit ( drhd )
     {
-        struct irq_desc *desc;
+        adjust_irq_affinity(drhd);
 
         iommu = drhd->iommu;
 
-        desc = irq_to_desc(iommu->msi.irq);
-        dma_msi_set_affinity(desc, desc->arch.cpu_mask);
-
         clear_fault_bits(iommu);
 
         spin_lock_irqsave(&iommu->register_lock, flags);
diff -r ba90ecb0231f -r 1fce7522daa6 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Wed Nov 28 10:07:11 2012 +0100
+++ b/xen/include/xen/iommu.h	Wed Nov 28 10:08:24 2012 +0100
@@ -137,6 +137,9 @@ int iommu_do_domctl(struct xen_domctl *,
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);
 
+/* While VT-d specific, this must get declared in a generic header. */
+int adjust_vtd_irq_affinities(void);
+
 /*
  * The purpose of the iommu_dont_flush_iotlb optional cpu flag is to
  * avoid unecessary iotlb_flush in the low level IOMMU code.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH8-0006qD-MZ; Tue, 04 Dec 2012 00:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH7-0006pg-P6
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Received: from [85.158.143.35:25922] by server-3.bemta-4.messagelabs.com id
	33/3B-06841-4324DB05; Tue, 04 Dec 2012 00:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1354580530!4279520!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16144 invoked from network); 4 Dec 2012 00:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH4-0007FL-3A
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH3-0008LA-U9
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:09 +0000
Message-Id: <E1TfgH3-0008LA-U9@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: include IOMMU interrupt
	information in 'M' debug key output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093552 -3600
# Node ID 0bc3a489018f56bad12c5a3e88f735f1c78dc789
# Parent  5faf5b8b702e0c7ad9f362dcde3ee41d950f66b7
VT-d: include IOMMU interrupt information in 'M' debug key output

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 5faf5b8b702e -r 0bc3a489018f xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 28 10:03:51 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Nov 28 10:05:52 2012 +0100
@@ -1008,6 +1008,7 @@ static void dma_msi_unmask(struct irq_de
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
+    iommu->msi.msi_attrib.masked = 0;
 }
 
 static void dma_msi_mask(struct irq_desc *desc)
@@ -1019,6 +1020,7 @@ static void dma_msi_mask(struct irq_desc
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FECTL_REG, DMA_FECTL_IM);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
+    iommu->msi.msi_attrib.masked = 1;
 }
 
 static unsigned int dma_msi_startup(struct irq_desc *desc)
@@ -1059,6 +1061,7 @@ static void dma_msi_set_affinity(struct 
         msg.address_hi = dest & 0xFFFFFF00;
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
+    iommu->msi.msg = msg;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FEDATA_REG, msg.data);
@@ -1082,6 +1085,8 @@ static int __init iommu_set_interrupt(st
 {
     int irq, ret;
     struct acpi_rhsa_unit *rhsa = drhd_to_rhsa(drhd);
+    struct iommu *iommu = drhd->iommu;
+    struct irq_desc *desc;
 
     irq = create_irq(rhsa ? pxm_to_node(rhsa->proximity_domain)
                           : NUMA_NO_NODE);
@@ -1091,17 +1096,24 @@ static int __init iommu_set_interrupt(st
         return -EINVAL;
     }
 
-    irq_desc[irq].handler = &dma_msi_type;
-    ret = request_irq(irq, iommu_page_fault, 0, "dmar", drhd->iommu);
+    desc = irq_to_desc(irq);
+    desc->handler = &dma_msi_type;
+    ret = request_irq(irq, iommu_page_fault, 0, "dmar", iommu);
     if ( ret )
     {
-        irq_desc[irq].handler = &no_irq_type;
+        desc->handler = &no_irq_type;
         destroy_irq(irq);
         dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: can't request irq\n");
         return ret;
     }
 
-    return irq;
+    iommu->msi.irq = irq;
+    iommu->msi.msi_attrib.pos = MSI_TYPE_IOMMU;
+    iommu->msi.msi_attrib.maskbit = 1;
+    iommu->msi.msi_attrib.is_64 = 1;
+    desc->msi_desc = &iommu->msi;
+
+    return 0;
 }
 
 int __init iommu_alloc(struct acpi_drhd_unit *drhd)
@@ -1121,7 +1133,7 @@ int __init iommu_alloc(struct acpi_drhd_
     if ( iommu == NULL )
         return -ENOMEM;
 
-    iommu->irq = -1; /* No irq assigned yet. */
+    iommu->msi.irq = -1; /* No irq assigned yet. */
 
     iommu->intel = alloc_intel_iommu();
     if ( iommu->intel == NULL )
@@ -1218,8 +1230,8 @@ void __init iommu_free(struct acpi_drhd_
     xfree(iommu->domid_map);
 
     free_intel_iommu(iommu->intel);
-    if ( iommu->irq >= 0 )
-        destroy_irq(iommu->irq);
+    if ( iommu->msi.irq >= 0 )
+        destroy_irq(iommu->msi.irq);
     xfree(iommu);
 }
 
@@ -1976,7 +1988,7 @@ static int init_vtd_hw(void)
 
         iommu = drhd->iommu;
 
-        desc = irq_to_desc(iommu->irq);
+        desc = irq_to_desc(iommu->msi.irq);
         dma_msi_set_affinity(desc, desc->arch.cpu_mask);
 
         clear_fault_bits(iommu);
@@ -2122,12 +2134,11 @@ int __init intel_vtd_setup(void)
             iommu_hap_pt_share = 0;
 
         ret = iommu_set_interrupt(drhd);
-        if ( ret < 0 )
+        if ( ret )
         {
             dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: interrupt setup failed\n");
             goto error;
         }
-        iommu->irq = ret;
     }
 
     softirq_tasklet_init(&vtd_fault_tasklet, do_iommu_page_fault, 0);
diff -r 5faf5b8b702e -r 0bc3a489018f xen/drivers/passthrough/vtd/iommu.h
--- a/xen/drivers/passthrough/vtd/iommu.h	Wed Nov 28 10:03:51 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.h	Wed Nov 28 10:05:52 2012 +0100
@@ -21,6 +21,7 @@
 #define _INTEL_IOMMU_H_
 
 #include <xen/iommu.h>
+#include <asm/msi.h>
 
 /*
  * Intel IOMMU register specification per version 1.0 public spec.
@@ -520,7 +521,7 @@ struct iommu {
     spinlock_t lock; /* protect context, domain ids */
     spinlock_t register_lock; /* protect iommu register handling */
     u64 root_maddr; /* root entry machine address */
-    int irq;
+    struct msi_desc msi;
     struct intel_iommu *intel;
     unsigned long *domid_bitmap;  /* domain id bitmap */
     u16 *domid_map;               /* domain id mapping array */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH7-0006pi-E6; Tue, 04 Dec 2012 00:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0006pN-9J
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Received: from [85.158.138.51:35698] by server-7.bemta-3.messagelabs.com id
	18/0C-01713-3324DB05; Tue, 04 Dec 2012 00:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1354580529!29031397!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13647 invoked from network); 4 Dec 2012 00:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH2-0007FC-Jz
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH2-0008KR-5K
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:08 +0000
Message-Id: <E1TfgH2-0008KR-5K@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] README: adjust gcc version
	requirement
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093293 -3600
# Node ID 0aa1c5136a548a9d2498febc0d3bcee71ebeeafe
# Parent  1c69c938f641a643e6ebfbdfc412e2c601e7032d
README: adjust gcc version requirement

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 1c69c938f641 -r 0aa1c5136a54 README
--- a/README	Tue Nov 27 14:13:41 2012 +0000
+++ b/README	Wed Nov 28 10:01:33 2012 +0100
@@ -38,7 +38,7 @@ First, there are a number of prerequisit
 release. Make sure you have all the following installed, either by
 visiting the project webpage or installing a pre-built package
 provided by your OS distributor:
-    * GCC v3.4 or later
+    * GCC v4.1 or later
     * GNU Make
     * GNU Binutils
     * Development install of zlib (e.g., zlib-dev)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH9-0006qm-Tu; Tue, 04 Dec 2012 00:22:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0006pg-Un
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Received: from [85.158.143.35:25968] by server-3.bemta-4.messagelabs.com id
	56/3B-06841-6324DB05; Tue, 04 Dec 2012 00:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1354580532!13940703!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8331 invoked from network); 4 Dec 2012 00:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0007Fa-Kp
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0008MQ-JD
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Message-Id: <E1TfgH6-0008MQ-JD@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Comment the definitions of
	_mfn(), _gfn() &c.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1354186193 0
# Node ID 9c6c13bf380355d6814d60f8b2da308cee07a15a
# Parent  5d7e3c2742e8378bdf312b3d9861d6c141e80fff
x86/mm: Comment the definitions of _mfn(), _gfn() &c.

It's not very easy to find them if you don't know to look for the
TYPE_SAFE() macro.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 5d7e3c2742e8 -r 9c6c13bf3803 xen/include/asm-x86/guest_pt.h
--- a/xen/include/asm-x86/guest_pt.h	Thu Nov 29 09:14:55 2012 +0100
+++ b/xen/include/asm-x86/guest_pt.h	Thu Nov 29 10:49:53 2012 +0000
@@ -37,6 +37,11 @@
 TYPE_SAFE(unsigned long,gfn)
 #define PRI_gfn "05lx"
 
+#ifndef gfn_t
+#define gfn_t /* Grep fodder: gfn_t, _gfn() and gfn_x() are defined above */
+#undef gfn_t
+#endif
+
 #define VALID_GFN(m) (m != INVALID_GFN)
 
 static inline int
diff -r 5d7e3c2742e8 -r 9c6c13bf3803 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Nov 29 09:14:55 2012 +0100
+++ b/xen/include/asm-x86/mm.h	Thu Nov 29 10:49:53 2012 +0000
@@ -456,6 +456,11 @@ static inline _type _name##_x(_name##_t 
 
 TYPE_SAFE(unsigned long,mfn);
 
+#ifndef mfn_t
+#define mfn_t /* Grep fodder: mfn_t, _mfn() and mfn_x() are defined above */
+#undef mfn_t
+#endif
+
 /* Macro for printk formats: use as printk("%"PRI_mfn"\n", mfn_x(foo)); */
 #define PRI_mfn "05lx"
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHB-0006rW-4q; Tue, 04 Dec 2012 00:22:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0006px-Ch
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Received: from [85.158.139.83:12983] by server-1.bemta-5.messagelabs.com id
	13/B0-09311-6324DB05; Tue, 04 Dec 2012 00:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354580532!27553630!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32312 invoked from network); 4 Dec 2012 00:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH5-0007FU-KZ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH5-0008Lw-J3
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:11 +0000
Message-Id: <E1TfgH5-0008Lw-J3@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] IOMMU: imply "verbose" from "debug"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354118456 -3600
# Node ID 836697b197462f89a4d296da9482d1719dcc0836
# Parent  1fce7522daa6bab9fce93b95adf592193c904097
IOMMU: imply "verbose" from "debug"

I think that generally enabling debugging code without also enabling
verbose output is rather pointless; if someone really wants this, they
can always pass e.g. "iommu=debug,no-verbose".

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 1fce7522daa6 -r 836697b19746 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Wed Nov 28 10:08:24 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Wed Nov 28 17:00:56 2012 +0100
@@ -92,7 +92,11 @@ static void __init parse_iommu_param(cha
         else if ( !strcmp(s, "intremap") )
             iommu_intremap = val;
         else if ( !strcmp(s, "debug") )
+        {
             iommu_debug = val;
+            if ( val )
+                iommu_verbose = 1;
+        }
         else if ( !strcmp(s, "amd-iommu-perdev-intremap") )
             amd_iommu_perdev_intremap = val;
         else if ( !strcmp(s, "dom0-passthrough") )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgH8-0006q8-Jv; Tue, 04 Dec 2012 00:22:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0006pQ-UK
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Received: from [85.158.139.211:61615] by server-11.bemta-5.messagelabs.com id
	3E/3B-03409-4324DB05; Tue, 04 Dec 2012 00:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354580530!18943642!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11942 invoked from network); 4 Dec 2012 00:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH3-0007FI-N6
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH3-0008Kv-Bn
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:09 +0000
Message-Id: <E1TfgH3-0008Kv-Bn@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ACPI: fix return value of XEN_PM_PDC
	platform op
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354093431 -3600
# Node ID 5faf5b8b702e0c7ad9f362dcde3ee41d950f66b7
# Parent  7670eabcbafc7251c336550cd7ce3ea4078a36b9
ACPI: fix return value of XEN_PM_PDC platform op

Should return -EFAULT when copying to guest memory fails.

Once touching this code, also switch to using the more relaxed copy
function (copying from the same guest memory already validated the
virtual address range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 7670eabcbafc -r 5faf5b8b702e xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c	Wed Nov 28 10:02:26 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c	Wed Nov 28 10:03:51 2012 +0100
@@ -521,8 +521,8 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_G
                     ACPI_PDC_SMP_C1PT) & ~mask;
         ret = arch_acpi_set_pdc_bits(acpi_id, bits, mask);
     }
-    if ( !ret )
-        ret = copy_to_guest_offset(pdc, 2, bits + 2, 1);
+    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, 1) )
+        ret = -EFAULT;
 
     return ret;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHB-0006rW-4q; Tue, 04 Dec 2012 00:22:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0006px-Ch
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Received: from [85.158.139.83:12983] by server-1.bemta-5.messagelabs.com id
	13/B0-09311-6324DB05; Tue, 04 Dec 2012 00:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1354580532!27553630!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32312 invoked from network); 4 Dec 2012 00:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH5-0007FU-KZ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH5-0008Lw-J3
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:11 +0000
Message-Id: <E1TfgH5-0008Lw-J3@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] IOMMU: imply "verbose" from "debug"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354118456 -3600
# Node ID 836697b197462f89a4d296da9482d1719dcc0836
# Parent  1fce7522daa6bab9fce93b95adf592193c904097
IOMMU: imply "verbose" from "debug"

I think that generally enabling debugging code without also enabling
verbose output is rather pointless; if someone really wants this, they
can always pass e.g. "iommu=debug,no-verbose".

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 1fce7522daa6 -r 836697b19746 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Wed Nov 28 10:08:24 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Wed Nov 28 17:00:56 2012 +0100
@@ -92,7 +92,11 @@ static void __init parse_iommu_param(cha
         else if ( !strcmp(s, "intremap") )
             iommu_intremap = val;
         else if ( !strcmp(s, "debug") )
+        {
             iommu_debug = val;
+            if ( val )
+                iommu_verbose = 1;
+        }
         else if ( !strcmp(s, "amd-iommu-perdev-intremap") )
             amd_iommu_perdev_intremap = val;
         else if ( !strcmp(s, "dom0-passthrough") )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHC-0006tH-EA; Tue, 04 Dec 2012 00:22:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0006pg-Um
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:17 +0000
Received: from [85.158.143.35:22565] by server-3.bemta-4.messagelabs.com id
	6A/3B-06841-8324DB05; Tue, 04 Dec 2012 00:22:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354580533!5562232!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26557 invoked from network); 4 Dec 2012 00:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH7-0007Fg-LG
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH7-0008Mu-JH
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Message-Id: <E1TfgH7-0008Mu-JH@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: build as zImage
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1354188497 0
# Node ID 48e2118125512d2664e728da70607cee94199eb3
# Parent  b5cb6cccc32c63b2319a1ab4ba5360fa93b719ec
xen/arm: build as zImage

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- switch from 7*nop + nop to just 8*nop ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b5cb6cccc32c -r 48e211812551 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Nov 29 11:01:00 2012 +0000
+++ b/xen/arch/arm/head.S	Thu Nov 29 11:28:17 2012 +0000
@@ -22,6 +22,8 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +54,21 @@ 99:
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	/* zImage magic header, see:
+	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+	 */
+	.rept 8
+	mov   r0, r0
+	.endr
+	b     past_zImage
+
+	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+	.word 0x00000000             /* absolute load/run zImage address or
+	                              * 0 for PiC */
+	.word (_end - start)         /* zImage end address */
+
+past_zImage:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHB-0006rM-2b; Tue, 04 Dec 2012 00:22:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH9-0006qb-NQ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Received: from [85.158.139.211:2085] by server-5.bemta-5.messagelabs.com id
	1F/A0-11353-6324DB05; Tue, 04 Dec 2012 00:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354580532!18966622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28513 invoked from network); 4 Dec 2012 00:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0007FX-BM
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0008MB-3e
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Message-Id: <E1TfgH6-0008MB-3e@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: make scope parsing code type
	safe
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354176895 -3600
# Node ID 5d7e3c2742e8378bdf312b3d9861d6c141e80fff
# Parent  836697b197462f89a4d296da9482d1719dcc0836
VT-d: make scope parsing code type safe

Rather than requiring the scopes to be the first members of their
respective structures (so that casts can be used to switch between the
different views), properly use types and container_of().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
---


diff -r 836697b19746 -r 5d7e3c2742e8 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c	Wed Nov 28 17:00:56 2012 +0100
+++ b/xen/drivers/passthrough/vtd/dmar.c	Thu Nov 29 09:14:55 2012 +0100
@@ -304,13 +304,15 @@ static int __init scope_device_count(con
 
 
 static int __init acpi_parse_dev_scope(
-    const void *start, const void *end, void *acpi_entry, int type, u16 seg)
+    const void *start, const void *end, struct dmar_scope *scope,
+    int type, u16 seg)
 {
-    struct dmar_scope *scope = acpi_entry;
     struct acpi_ioapic_unit *acpi_ioapic_unit;
     const struct acpi_dmar_device_scope *acpi_scope;
     u16 bus, sub_bus, sec_bus;
     const struct acpi_dmar_pci_path *path;
+    struct acpi_drhd_unit *drhd = type == DMAR_TYPE ?
+        container_of(scope, struct acpi_drhd_unit, scope) : NULL;
     int depth, cnt, didx = 0;
 
     if ( (cnt = scope_device_count(start, end)) < 0 )
@@ -359,9 +361,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
 
-            if ( type == DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd = acpi_entry;
                 struct acpi_hpet_unit *acpi_hpet_unit;
 
                 acpi_hpet_unit = xmalloc(struct acpi_hpet_unit);
@@ -381,10 +382,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
 
-            if ( type == DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd = acpi_entry;
-
                 if ( (seg == 0) && (bus == 0) && (path->dev == 2) &&
                      (path->fn == 0) )
                     igd_drhd_address = drhd->address;
@@ -397,9 +396,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
 
-            if ( type == DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd = acpi_entry;
                 acpi_ioapic_unit = xmalloc(struct acpi_ioapic_unit);
                 if ( !acpi_ioapic_unit )
                     return -ENOMEM;
@@ -463,7 +461,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
     dev_scope_start = (void *)(drhd + 1);
     dev_scope_end = ((void *)drhd) + header->length;
     ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                               dmaru, DMAR_TYPE, drhd->segment);
+                               &dmaru->scope, DMAR_TYPE, drhd->segment);
 
     if ( dmaru->include_all )
     {
@@ -590,7 +588,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
     dev_scope_start = (void *)(rmrr + 1);
     dev_scope_end   = ((void *)rmrr) + header->length;
     ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                               rmrru, RMRR_TYPE, rmrr->segment);
+                               &rmrru->scope, RMRR_TYPE, rmrr->segment);
 
     if ( ret || (rmrru->scope.devices_cnt == 0) )
         xfree(rmrru);
@@ -683,7 +681,7 @@ acpi_parse_one_atsr(struct acpi_dmar_hea
         dev_scope_start = (void *)(atsr + 1);
         dev_scope_end   = ((void *)atsr) + header->length;
         ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                                   atsru, ATSR_TYPE, atsr->segment);
+                                   &atsru->scope, ATSR_TYPE, atsr->segment);
     }
     else
     {
diff -r 836697b19746 -r 5d7e3c2742e8 xen/drivers/passthrough/vtd/dmar.h
--- a/xen/drivers/passthrough/vtd/dmar.h	Wed Nov 28 17:00:56 2012 +0100
+++ b/xen/drivers/passthrough/vtd/dmar.h	Thu Nov 29 09:14:55 2012 +0100
@@ -59,7 +59,7 @@ struct dmar_scope {
 };
 
 struct acpi_drhd_unit {
-    struct dmar_scope scope;            /* must be first member of struct */
+    struct dmar_scope scope;
     struct list_head list;
     u64    address;                     /* register base address of the unit */
     u16    segment;
@@ -70,7 +70,7 @@ struct acpi_drhd_unit {
 };
 
 struct acpi_rmrr_unit {
-    struct dmar_scope scope;            /* must be first member of struct */
+    struct dmar_scope scope;
     struct list_head list;
     u64    base_address;
     u64    end_address;
@@ -79,7 +79,7 @@ struct acpi_rmrr_unit {
 };
 
 struct acpi_atsr_unit {
-    struct dmar_scope scope;            /* must be first member of struct */
+    struct dmar_scope scope;
     struct list_head list;
     u16    segment;
     u8     all_ports:1;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHC-0006tH-EA; Tue, 04 Dec 2012 00:22:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0006pg-Um
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:17 +0000
Received: from [85.158.143.35:22565] by server-3.bemta-4.messagelabs.com id
	6A/3B-06841-8324DB05; Tue, 04 Dec 2012 00:22:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1354580533!5562232!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26557 invoked from network); 4 Dec 2012 00:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH7-0007Fg-LG
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH7-0008Mu-JH
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Message-Id: <E1TfgH7-0008Mu-JH@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: build as zImage
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1354188497 0
# Node ID 48e2118125512d2664e728da70607cee94199eb3
# Parent  b5cb6cccc32c63b2319a1ab4ba5360fa93b719ec
xen/arm: build as zImage

The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- switch from 7*nop + nop to just 8*nop ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b5cb6cccc32c -r 48e211812551 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Nov 29 11:01:00 2012 +0000
+++ b/xen/arch/arm/head.S	Thu Nov 29 11:28:17 2012 +0000
@@ -22,6 +22,8 @@
 #include <asm/processor-ca15.h>
 #include <asm/asm_defns.h>
 
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+
 #define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
 #define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
 #define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
@@ -52,6 +54,21 @@ 99:
 	 * or the initial pagetable code below will need adjustment. */
 	.global start
 start:
+
+	/* zImage magic header, see:
+	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+	 */
+	.rept 8
+	mov   r0, r0
+	.endr
+	b     past_zImage
+
+	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+	.word 0x00000000             /* absolute load/run zImage address or
+	                              * 0 for PiC */
+	.word (_end - start)         /* zImage end address */
+
+past_zImage:
 	cpsid aif                    /* Disable all interrupts */
 
 	/* Save the bootloader arguments in less-clobberable registers */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHB-0006rM-2b; Tue, 04 Dec 2012 00:22:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH9-0006qb-NQ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Received: from [85.158.139.211:2085] by server-5.bemta-5.messagelabs.com id
	1F/A0-11353-6324DB05; Tue, 04 Dec 2012 00:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1354580532!18966622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28513 invoked from network); 4 Dec 2012 00:22:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0007FX-BM
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH6-0008MB-3e
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:12 +0000
Message-Id: <E1TfgH6-0008MB-3e@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VT-d: make scope parsing code type
	safe
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354176895 -3600
# Node ID 5d7e3c2742e8378bdf312b3d9861d6c141e80fff
# Parent  836697b197462f89a4d296da9482d1719dcc0836
VT-d: make scope parsing code type safe

Rather than requiring the scopes to be the first members of their
respective structures (so that casts can be used to switch between the
different views), properly use types and container_of().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
---


diff -r 836697b19746 -r 5d7e3c2742e8 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c	Wed Nov 28 17:00:56 2012 +0100
+++ b/xen/drivers/passthrough/vtd/dmar.c	Thu Nov 29 09:14:55 2012 +0100
@@ -304,13 +304,15 @@ static int __init scope_device_count(con
 
 
 static int __init acpi_parse_dev_scope(
-    const void *start, const void *end, void *acpi_entry, int type, u16 seg)
+    const void *start, const void *end, struct dmar_scope *scope,
+    int type, u16 seg)
 {
-    struct dmar_scope *scope = acpi_entry;
     struct acpi_ioapic_unit *acpi_ioapic_unit;
     const struct acpi_dmar_device_scope *acpi_scope;
     u16 bus, sub_bus, sec_bus;
     const struct acpi_dmar_pci_path *path;
+    struct acpi_drhd_unit *drhd = type == DMAR_TYPE ?
+        container_of(scope, struct acpi_drhd_unit, scope) : NULL;
     int depth, cnt, didx = 0;
 
     if ( (cnt = scope_device_count(start, end)) < 0 )
@@ -359,9 +361,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " MSI HPET: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
 
-            if ( type == DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd = acpi_entry;
                 struct acpi_hpet_unit *acpi_hpet_unit;
 
                 acpi_hpet_unit = xmalloc(struct acpi_hpet_unit);
@@ -381,10 +382,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " endpoint: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
 
-            if ( type == DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd = acpi_entry;
-
                 if ( (seg == 0) && (bus == 0) && (path->dev == 2) &&
                      (path->fn == 0) )
                     igd_drhd_address = drhd->address;
@@ -397,9 +396,8 @@ static int __init acpi_parse_dev_scope(
                 dprintk(VTDPREFIX, " IOAPIC: %04x:%02x:%02x.%u\n",
                         seg, bus, path->dev, path->fn);
 
-            if ( type == DMAR_TYPE )
+            if ( drhd )
             {
-                struct acpi_drhd_unit *drhd = acpi_entry;
                 acpi_ioapic_unit = xmalloc(struct acpi_ioapic_unit);
                 if ( !acpi_ioapic_unit )
                     return -ENOMEM;
@@ -463,7 +461,7 @@ acpi_parse_one_drhd(struct acpi_dmar_hea
     dev_scope_start = (void *)(drhd + 1);
     dev_scope_end = ((void *)drhd) + header->length;
     ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                               dmaru, DMAR_TYPE, drhd->segment);
+                               &dmaru->scope, DMAR_TYPE, drhd->segment);
 
     if ( dmaru->include_all )
     {
@@ -590,7 +588,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
     dev_scope_start = (void *)(rmrr + 1);
     dev_scope_end   = ((void *)rmrr) + header->length;
     ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                               rmrru, RMRR_TYPE, rmrr->segment);
+                               &rmrru->scope, RMRR_TYPE, rmrr->segment);
 
     if ( ret || (rmrru->scope.devices_cnt == 0) )
         xfree(rmrru);
@@ -683,7 +681,7 @@ acpi_parse_one_atsr(struct acpi_dmar_hea
         dev_scope_start = (void *)(atsr + 1);
         dev_scope_end   = ((void *)atsr) + header->length;
         ret = acpi_parse_dev_scope(dev_scope_start, dev_scope_end,
-                                   atsru, ATSR_TYPE, atsr->segment);
+                                   &atsru->scope, ATSR_TYPE, atsr->segment);
     }
     else
     {
diff -r 836697b19746 -r 5d7e3c2742e8 xen/drivers/passthrough/vtd/dmar.h
--- a/xen/drivers/passthrough/vtd/dmar.h	Wed Nov 28 17:00:56 2012 +0100
+++ b/xen/drivers/passthrough/vtd/dmar.h	Thu Nov 29 09:14:55 2012 +0100
@@ -59,7 +59,7 @@ struct dmar_scope {
 };
 
 struct acpi_drhd_unit {
-    struct dmar_scope scope;            /* must be first member of struct */
+    struct dmar_scope scope;
     struct list_head list;
     u64    address;                     /* register base address of the unit */
     u16    segment;
@@ -70,7 +70,7 @@ struct acpi_drhd_unit {
 };
 
 struct acpi_rmrr_unit {
-    struct dmar_scope scope;            /* must be first member of struct */
+    struct dmar_scope scope;
     struct list_head list;
     u64    base_address;
     u64    end_address;
@@ -79,7 +79,7 @@ struct acpi_rmrr_unit {
 };
 
 struct acpi_atsr_unit {
-    struct dmar_scope scope;            /* must be first member of struct */
+    struct dmar_scope scope;
     struct list_head list;
     u16    segment;
     u8     all_ports:1;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHC-0006sq-AC; Tue, 04 Dec 2012 00:22:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0006r1-Ro
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Received: from [193.109.254.147:24039] by server-2.bemta-14.messagelabs.com id
	E2/3A-20829-7324DB05; Tue, 04 Dec 2012 00:22:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1354580534!2385737!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32259 invoked from network); 4 Dec 2012 00:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0007Fj-5n
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0008N9-3Z
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Message-Id: <E1TfgH8-0008N9-3Z@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: fix persistent grants doc typo
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============9048472497243279890=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============9048472497243279890==
Content-Type: text/plain

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1354188498 0
# Node ID 9d88ac6046d81f89990b484a4da780ae70de61eb
# Parent  48e2118125512d2664e728da70607cee94199eb3
docs: fix persistent grants doc typo

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- fix additional typo s/this grants/these grants/g ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 48e211812551 -r 9d88ac6046d8 xen/include/public/io/blkif.h
--- a/xen/include/public/io/blkif.h	Thu Nov 29 11:28:17 2012 +0000
+++ b/xen/include/public/io/blkif.h	Thu Nov 29 11:28:18 2012 +0000
@@ -307,7 +307,7 @@
  *     the grants.
  * (8) The frontend driver has to allow the backend driver to map all grants
  *     with write access, even when they should be mapped read-only, since
- *     further requests may reuse this grants and require write permisions.
+ *     further requests may reuse these grants and require write permissions.
  */
 
 /*


--===============9048472497243279890==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============9048472497243279890==--

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHC-0006sq-AC; Tue, 04 Dec 2012 00:22:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0006r1-Ro
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Received: from [193.109.254.147:24039] by server-2.bemta-14.messagelabs.com id
	E2/3A-20829-7324DB05; Tue, 04 Dec 2012 00:22:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1354580534!2385737!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32259 invoked from network); 4 Dec 2012 00:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0007Fj-5n
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0008N9-3Z
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Message-Id: <E1TfgH8-0008N9-3Z@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: fix persistent grants doc typo
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============9048472497243279890=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============9048472497243279890==
Content-Type: text/plain

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1354188498 0
# Node ID 9d88ac6046d81f89990b484a4da780ae70de61eb
# Parent  48e2118125512d2664e728da70607cee94199eb3
docs: fix persistent grants doc typo

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- fix additional typo s/this grants/these grants/g ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 48e211812551 -r 9d88ac6046d8 xen/include/public/io/blkif.h
--- a/xen/include/public/io/blkif.h	Thu Nov 29 11:28:17 2012 +0000
+++ b/xen/include/public/io/blkif.h	Thu Nov 29 11:28:18 2012 +0000
@@ -307,7 +307,7 @@
  *     the grants.
  * (8) The frontend driver has to allow the backend driver to map all grants
  *     with write access, even when they should be mapped read-only, since
- *     further requests may reuse this grants and require write permisions.
+ *     further requests may reuse these grants and require write permissions.
  */
 
 /*


--===============9048472497243279890==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============9048472497243279890==--

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHC-0006sN-7V; Tue, 04 Dec 2012 00:22:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0006qv-Om
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Received: from [85.158.139.211:2101] by server-4.bemta-5.messagelabs.com id
	E3/A1-15011-7324DB05; Tue, 04 Dec 2012 00:22:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354580533!18875896!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14379 invoked from network); 4 Dec 2012 00:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH7-0007Fd-EQ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH7-0008Mf-3E
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Message-Id: <E1TfgH7-0008Mf-3E@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1354186860 0
# Node ID b5cb6cccc32c63b2319a1ab4ba5360fa93b719ec
# Parent  9c6c13bf380355d6814d60f8b2da308cee07a15a
x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 9c6c13bf3803 -r b5cb6cccc32c xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Nov 29 10:49:53 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Nov 29 11:01:00 2012 +0000
@@ -567,6 +567,9 @@ void hap_teardown(struct domain *d)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
+    xfree(d->arch.hvm_domain.dirty_vram);
+    d->arch.hvm_domain.dirty_vram = NULL;
+
     paging_unlock(d);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHC-0006sN-7V; Tue, 04 Dec 2012 00:22:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0006qv-Om
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Received: from [85.158.139.211:2101] by server-4.bemta-5.messagelabs.com id
	E3/A1-15011-7324DB05; Tue, 04 Dec 2012 00:22:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354580533!18875896!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14379 invoked from network); 4 Dec 2012 00:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH7-0007Fd-EQ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH7-0008Mf-3E
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:13 +0000
Message-Id: <E1TfgH7-0008Mf-3E@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1354186860 0
# Node ID b5cb6cccc32c63b2319a1ab4ba5360fa93b719ec
# Parent  9c6c13bf380355d6814d60f8b2da308cee07a15a
x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 9c6c13bf3803 -r b5cb6cccc32c xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Nov 29 10:49:53 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Nov 29 11:01:00 2012 +0000
@@ -567,6 +567,9 @@ void hap_teardown(struct domain *d)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
+    xfree(d->arch.hvm_domain.dirty_vram);
+    d->arch.hvm_domain.dirty_vram = NULL;
+
     paging_unlock(d);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHD-0006vA-PA; Tue, 04 Dec 2012 00:22:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0006rm-HE
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Received: from [85.158.137.99:56074] by server-11.bemta-3.messagelabs.com id
	B0/95-19361-9324DB05; Tue, 04 Dec 2012 00:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354580535!14584358!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10812 invoked from network); 4 Dec 2012 00:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH9-0007Fp-74
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH9-0008Nd-59
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Message-Id: <E1TfgH9-0008Nd-59@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable NMI-window
	exiting for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267371 0
# Node ID 828cb146d25a2c060b6fe3beee78c034d7f4f8af
# Parent  b08c01906d89db198f01e0f5e8547906c17f0294
nested vmx: enable NMI-window exiting for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r b08c01906d89 -r 828cb146d25a xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:22:08 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:22:51 2012 +0000
@@ -1273,7 +1273,8 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_USE_TSC_OFFSETING |
                CPU_BASED_UNCOND_IO_EXITING |
                CPU_BASED_RDTSC_EXITING |
-               CPU_BASED_MONITOR_TRAP_FLAG;
+               CPU_BASED_MONITOR_TRAP_FLAG |
+               CPU_BASED_VIRTUAL_NMI_PENDING;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHD-0006vA-PA; Tue, 04 Dec 2012 00:22:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0006rm-HE
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Received: from [85.158.137.99:56074] by server-11.bemta-3.messagelabs.com id
	B0/95-19361-9324DB05; Tue, 04 Dec 2012 00:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1354580535!14584358!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10812 invoked from network); 4 Dec 2012 00:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH9-0007Fp-74
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH9-0008Nd-59
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Message-Id: <E1TfgH9-0008Nd-59@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable NMI-window
	exiting for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267371 0
# Node ID 828cb146d25a2c060b6fe3beee78c034d7f4f8af
# Parent  b08c01906d89db198f01e0f5e8547906c17f0294
nested vmx: enable NMI-window exiting for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r b08c01906d89 -r 828cb146d25a xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:22:08 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:22:51 2012 +0000
@@ -1273,7 +1273,8 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_USE_TSC_OFFSETING |
                CPU_BASED_UNCOND_IO_EXITING |
                CPU_BASED_RDTSC_EXITING |
-               CPU_BASED_MONITOR_TRAP_FLAG;
+               CPU_BASED_MONITOR_TRAP_FLAG |
+               CPU_BASED_VIRTUAL_NMI_PENDING;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHD-0006us-JC; Tue, 04 Dec 2012 00:22:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0006rk-6h
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Received: from [85.158.138.51:21186] by server-13.bemta-3.messagelabs.com id
	C6/28-24887-9324DB05; Tue, 04 Dec 2012 00:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354580535!28529301!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5724 invoked from network); 4 Dec 2012 00:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0007Fm-SV
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0008NO-Ka
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Message-Id: <E1TfgH8-0008NO-Ka@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable Monitor Trap Flag
	for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267328 0
# Node ID b08c01906d89db198f01e0f5e8547906c17f0294
# Parent  9d88ac6046d81f89990b484a4da780ae70de61eb
nested vmx: enable Monitor Trap Flag for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9d88ac6046d8 -r b08c01906d89 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Nov 29 11:28:18 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:22:08 2012 +0000
@@ -1259,7 +1259,7 @@ int nvmx_msr_read_intercept(unsigned int
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS:
         /* 1-seetings */
-        data = (CPU_BASED_HLT_EXITING |
+        data = CPU_BASED_HLT_EXITING |
                CPU_BASED_VIRTUAL_INTR_PENDING |
                CPU_BASED_CR8_LOAD_EXITING |
                CPU_BASED_CR8_STORE_EXITING |
@@ -1272,7 +1272,8 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_ACTIVATE_IO_BITMAP |
                CPU_BASED_USE_TSC_OFFSETING |
                CPU_BASED_UNCOND_IO_EXITING |
-               CPU_BASED_RDTSC_EXITING);
+               CPU_BASED_RDTSC_EXITING |
+               CPU_BASED_MONITOR_TRAP_FLAG;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */
@@ -1475,6 +1476,11 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         if ( ctrl & CPU_BASED_VIRTUAL_NMI_PENDING )
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_MONITOR_TRAP_FLAG:
+        ctrl = __n2_exec_control(v);
+        if ( ctrl & CPU_BASED_MONITOR_TRAP_FLAG)
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHD-0006us-JC; Tue, 04 Dec 2012 00:22:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0006rk-6h
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Received: from [85.158.138.51:21186] by server-13.bemta-3.messagelabs.com id
	C6/28-24887-9324DB05; Tue, 04 Dec 2012 00:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354580535!28529301!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5724 invoked from network); 4 Dec 2012 00:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0007Fm-SV
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH8-0008NO-Ka
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:14 +0000
Message-Id: <E1TfgH8-0008NO-Ka@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable Monitor Trap Flag
	for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267328 0
# Node ID b08c01906d89db198f01e0f5e8547906c17f0294
# Parent  9d88ac6046d81f89990b484a4da780ae70de61eb
nested vmx: enable Monitor Trap Flag for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9d88ac6046d8 -r b08c01906d89 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Nov 29 11:28:18 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:22:08 2012 +0000
@@ -1259,7 +1259,7 @@ int nvmx_msr_read_intercept(unsigned int
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS:
         /* 1-seetings */
-        data = (CPU_BASED_HLT_EXITING |
+        data = CPU_BASED_HLT_EXITING |
                CPU_BASED_VIRTUAL_INTR_PENDING |
                CPU_BASED_CR8_LOAD_EXITING |
                CPU_BASED_CR8_STORE_EXITING |
@@ -1272,7 +1272,8 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_ACTIVATE_IO_BITMAP |
                CPU_BASED_USE_TSC_OFFSETING |
                CPU_BASED_UNCOND_IO_EXITING |
-               CPU_BASED_RDTSC_EXITING);
+               CPU_BASED_RDTSC_EXITING |
+               CPU_BASED_MONITOR_TRAP_FLAG;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */
@@ -1475,6 +1476,11 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         if ( ctrl & CPU_BASED_VIRTUAL_NMI_PENDING )
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_MONITOR_TRAP_FLAG:
+        ctrl = __n2_exec_control(v);
+        if ( ctrl & CPU_BASED_MONITOR_TRAP_FLAG)
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHF-0006xY-7R; Tue, 04 Dec 2012 00:22:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHD-0006tb-32
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:19 +0000
Received: from [85.158.139.211:37471] by server-15.bemta-5.messagelabs.com id
	34/EC-26920-A324DB05; Tue, 04 Dec 2012 00:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354580536!18875899!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14403 invoked from network); 4 Dec 2012 00:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH9-0007Ft-O3
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH9-0008Ns-MV
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Message-Id: <E1TfgH9-0008Ns-MV@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable secondary
	processor-based VM-Execution controls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267402 0
# Node ID a15b4080f143787f9e8381c5e00cdfd5585c3456
# Parent  828cb146d25a2c060b6fe3beee78c034d7f4f8af
nested vmx: enable secondary processor-based VM-Execution controls

Enable secondary processor-based control in VMCS

Besides that, add a helper function to get the certain control bit
in secondary processor-based control MSR.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 828cb146d25a -r a15b4080f143 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Nov 30 09:22:51 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Nov 30 09:23:22 2012 +0000
@@ -344,7 +344,7 @@ void vmx_update_cpu_exec_control(struct 
         __vmwrite(CPU_BASED_VM_EXEC_CONTROL, v->arch.hvm_vmx.exec_control);
 }
 
-static void vmx_update_secondary_exec_control(struct vcpu *v)
+void vmx_update_secondary_exec_control(struct vcpu *v)
 {
     if ( nestedhvm_vcpu_in_guestmode(v) )
         nvmx_update_secondary_exec_control(v,
diff -r 828cb146d25a -r a15b4080f143 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:22:51 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:23:22 2012 +0000
@@ -244,6 +244,17 @@ static inline u32 __n2_exec_control(stru
     return __get_vvmcs(nvcpu->nv_vvmcx, CPU_BASED_VM_EXEC_CONTROL);
 }
 
+static inline u32 __n2_secondary_exec_control(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    u64 second_ctrl = 0;
+
+    if ( __n2_exec_control(v) & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
+        second_ctrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+
+    return second_ctrl;
+}
+
 static int vmx_inst_check_privilege(struct cpu_user_regs *regs, int vmxop_check)
 {
     struct vcpu *v = current;
@@ -454,7 +465,6 @@ void nvmx_update_exec_control(struct vcp
     /* Enforce the removed features */
     shadow_cntrl &= ~(CPU_BASED_TPR_SHADOW
                       | CPU_BASED_ACTIVATE_MSR_BITMAP
-                      | CPU_BASED_ACTIVATE_SECONDARY_CONTROLS
                       | CPU_BASED_ACTIVATE_IO_BITMAP
                       | CPU_BASED_UNCOND_IO_EXITING);
     shadow_cntrl |= host_cntrl;
@@ -487,7 +497,12 @@ void nvmx_update_exec_control(struct vcp
 void nvmx_update_secondary_exec_control(struct vcpu *v,
                                             unsigned long value)
 {
-    set_shadow_control(v, SECONDARY_VM_EXEC_CONTROL, value);
+    u32 shadow_cntrl;
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+
+    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+    shadow_cntrl |= value;
+    set_shadow_control(v, SECONDARY_VM_EXEC_CONTROL, shadow_cntrl);
 }
 
 static void nvmx_update_pin_control(struct vcpu *v, unsigned long host_cntrl)
@@ -714,6 +729,7 @@ static void load_shadow_control(struct v
      */
     nvmx_update_pin_control(v, vmx_pin_based_exec_control);
     vmx_update_cpu_exec_control(v);
+    vmx_update_secondary_exec_control(v);
     nvmx_update_exit_control(v, vmx_vmexit_control);
     nvmx_update_entry_control(v);
     vmx_update_exception_bitmap(v);
@@ -923,6 +939,7 @@ static void virtual_vmexit(struct cpu_us
         v->arch.hvm_vcpu.guest_efer &= ~(EFER_LMA | EFER_LME);
 
     vmx_update_cpu_exec_control(v);
+    vmx_update_secondary_exec_control(v);
     vmx_update_exception_bitmap(v);
 
     load_vvmcs_host_state(v);
@@ -1274,12 +1291,20 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_UNCOND_IO_EXITING |
                CPU_BASED_RDTSC_EXITING |
                CPU_BASED_MONITOR_TRAP_FLAG |
-               CPU_BASED_VIRTUAL_NMI_PENDING;
+               CPU_BASED_VIRTUAL_NMI_PENDING |
+               CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */
         data = ((data | tmp) << 32) | (tmp);
         break;
+    case MSR_IA32_VMX_PROCBASED_CTLS2:
+        /* 1-seetings */
+        data = 0;
+        /* 0-settings */
+        tmp = 0;
+        data = (data << 32) | tmp;
+        break;
     case MSR_IA32_VMX_EXIT_CTLS:
         /* 1-seetings */
         /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
diff -r 828cb146d25a -r a15b4080f143 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Nov 30 09:22:51 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Nov 30 09:23:22 2012 +0000
@@ -70,6 +70,7 @@ void vmx_realmode(struct cpu_user_regs *
 void vmx_update_debug_state(struct vcpu *v);
 void vmx_update_exception_bitmap(struct vcpu *v);
 void vmx_update_cpu_exec_control(struct vcpu *v);
+void vmx_update_secondary_exec_control(struct vcpu *v);
 
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHF-0006xY-7R; Tue, 04 Dec 2012 00:22:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHD-0006tb-32
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:19 +0000
Received: from [85.158.139.211:37471] by server-15.bemta-5.messagelabs.com id
	34/EC-26920-A324DB05; Tue, 04 Dec 2012 00:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-206.messagelabs.com!1354580536!18875899!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14403 invoked from network); 4 Dec 2012 00:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH9-0007Ft-O3
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgH9-0008Ns-MV
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:15 +0000
Message-Id: <E1TfgH9-0008Ns-MV@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable secondary
	processor-based VM-Execution controls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267402 0
# Node ID a15b4080f143787f9e8381c5e00cdfd5585c3456
# Parent  828cb146d25a2c060b6fe3beee78c034d7f4f8af
nested vmx: enable secondary processor-based VM-Execution controls

Enable secondary processor-based control in VMCS

Besides that, add a helper function to get the certain control bit
in secondary processor-based control MSR.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 828cb146d25a -r a15b4080f143 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Nov 30 09:22:51 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Nov 30 09:23:22 2012 +0000
@@ -344,7 +344,7 @@ void vmx_update_cpu_exec_control(struct 
         __vmwrite(CPU_BASED_VM_EXEC_CONTROL, v->arch.hvm_vmx.exec_control);
 }
 
-static void vmx_update_secondary_exec_control(struct vcpu *v)
+void vmx_update_secondary_exec_control(struct vcpu *v)
 {
     if ( nestedhvm_vcpu_in_guestmode(v) )
         nvmx_update_secondary_exec_control(v,
diff -r 828cb146d25a -r a15b4080f143 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:22:51 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:23:22 2012 +0000
@@ -244,6 +244,17 @@ static inline u32 __n2_exec_control(stru
     return __get_vvmcs(nvcpu->nv_vvmcx, CPU_BASED_VM_EXEC_CONTROL);
 }
 
+static inline u32 __n2_secondary_exec_control(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    u64 second_ctrl = 0;
+
+    if ( __n2_exec_control(v) & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
+        second_ctrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+
+    return second_ctrl;
+}
+
 static int vmx_inst_check_privilege(struct cpu_user_regs *regs, int vmxop_check)
 {
     struct vcpu *v = current;
@@ -454,7 +465,6 @@ void nvmx_update_exec_control(struct vcp
     /* Enforce the removed features */
     shadow_cntrl &= ~(CPU_BASED_TPR_SHADOW
                       | CPU_BASED_ACTIVATE_MSR_BITMAP
-                      | CPU_BASED_ACTIVATE_SECONDARY_CONTROLS
                       | CPU_BASED_ACTIVATE_IO_BITMAP
                       | CPU_BASED_UNCOND_IO_EXITING);
     shadow_cntrl |= host_cntrl;
@@ -487,7 +497,12 @@ void nvmx_update_exec_control(struct vcp
 void nvmx_update_secondary_exec_control(struct vcpu *v,
                                             unsigned long value)
 {
-    set_shadow_control(v, SECONDARY_VM_EXEC_CONTROL, value);
+    u32 shadow_cntrl;
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+
+    shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, SECONDARY_VM_EXEC_CONTROL);
+    shadow_cntrl |= value;
+    set_shadow_control(v, SECONDARY_VM_EXEC_CONTROL, shadow_cntrl);
 }
 
 static void nvmx_update_pin_control(struct vcpu *v, unsigned long host_cntrl)
@@ -714,6 +729,7 @@ static void load_shadow_control(struct v
      */
     nvmx_update_pin_control(v, vmx_pin_based_exec_control);
     vmx_update_cpu_exec_control(v);
+    vmx_update_secondary_exec_control(v);
     nvmx_update_exit_control(v, vmx_vmexit_control);
     nvmx_update_entry_control(v);
     vmx_update_exception_bitmap(v);
@@ -923,6 +939,7 @@ static void virtual_vmexit(struct cpu_us
         v->arch.hvm_vcpu.guest_efer &= ~(EFER_LMA | EFER_LME);
 
     vmx_update_cpu_exec_control(v);
+    vmx_update_secondary_exec_control(v);
     vmx_update_exception_bitmap(v);
 
     load_vvmcs_host_state(v);
@@ -1274,12 +1291,20 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_UNCOND_IO_EXITING |
                CPU_BASED_RDTSC_EXITING |
                CPU_BASED_MONITOR_TRAP_FLAG |
-               CPU_BASED_VIRTUAL_NMI_PENDING;
+               CPU_BASED_VIRTUAL_NMI_PENDING |
+               CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
         /* 0-settings */
         data = ((data | tmp) << 32) | (tmp);
         break;
+    case MSR_IA32_VMX_PROCBASED_CTLS2:
+        /* 1-seetings */
+        data = 0;
+        /* 0-settings */
+        tmp = 0;
+        data = (data << 32) | tmp;
+        break;
     case MSR_IA32_VMX_EXIT_CTLS:
         /* 1-seetings */
         /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
diff -r 828cb146d25a -r a15b4080f143 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Nov 30 09:22:51 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Nov 30 09:23:22 2012 +0000
@@ -70,6 +70,7 @@ void vmx_realmode(struct cpu_user_regs *
 void vmx_update_debug_state(struct vcpu *v);
 void vmx_update_exception_bitmap(struct vcpu *v);
 void vmx_update_cpu_exec_control(struct vcpu *v);
+void vmx_update_secondary_exec_control(struct vcpu *v);
 
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHF-0006y3-FY; Tue, 04 Dec 2012 00:22:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0006vv-If
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Received: from [85.158.139.83:13133] by server-7.bemta-5.messagelabs.com id
	15/C0-23096-B324DB05; Tue, 04 Dec 2012 00:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1354580537!28198602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25636 invoked from network); 4 Dec 2012 00:22:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHB-0007G5-9g
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHB-0008Ob-7u
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:17 +0000
Message-Id: <E1TfgHB-0008Ob-7u@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable save
	VMX-preemption timer feature for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267509 0
# Node ID f32566fd3d624c91355bd261d83b21511db24a38
# Parent  110201bfc39e0a98cf2533265cc2c5b3327a5cdc
nested vmx: enable save VMX-preemption timer feature for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 110201bfc39e -r f32566fd3d62 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:24:17 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:25:09 2012 +0000
@@ -530,8 +530,7 @@ static void nvmx_update_exit_control(str
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_SAVE_GUEST_PAT
-                      | VM_EXIT_SAVE_GUEST_EFER
-                      | VM_EXIT_SAVE_PREEMPT_TIMER);
+                      | VM_EXIT_SAVE_GUEST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -1318,8 +1317,9 @@ int nvmx_msr_read_intercept(unsigned int
         /* 1-seetings */
         /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
         tmp = 0x36dff;
-        data = VM_EXIT_ACK_INTR_ON_EXIT;
-        data |= VM_EXIT_IA32E_MODE;
+        data = VM_EXIT_ACK_INTR_ON_EXIT |
+               VM_EXIT_IA32E_MODE |
+               VM_EXIT_SAVE_PREEMPT_TIMER;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHF-0006y3-FY; Tue, 04 Dec 2012 00:22:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0006vv-If
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Received: from [85.158.139.83:13133] by server-7.bemta-5.messagelabs.com id
	15/C0-23096-B324DB05; Tue, 04 Dec 2012 00:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1354580537!28198602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25636 invoked from network); 4 Dec 2012 00:22:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHB-0007G5-9g
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHB-0008Ob-7u
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:17 +0000
Message-Id: <E1TfgHB-0008Ob-7u@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable save
	VMX-preemption timer feature for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267509 0
# Node ID f32566fd3d624c91355bd261d83b21511db24a38
# Parent  110201bfc39e0a98cf2533265cc2c5b3327a5cdc
nested vmx: enable save VMX-preemption timer feature for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 110201bfc39e -r f32566fd3d62 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:24:17 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:25:09 2012 +0000
@@ -530,8 +530,7 @@ static void nvmx_update_exit_control(str
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_SAVE_GUEST_PAT
-                      | VM_EXIT_SAVE_GUEST_EFER
-                      | VM_EXIT_SAVE_PREEMPT_TIMER);
+                      | VM_EXIT_SAVE_GUEST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -1318,8 +1317,9 @@ int nvmx_msr_read_intercept(unsigned int
         /* 1-seetings */
         /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
         tmp = 0x36dff;
-        data = VM_EXIT_ACK_INTR_ON_EXIT;
-        data |= VM_EXIT_IA32E_MODE;
+        data = VM_EXIT_ACK_INTR_ON_EXIT |
+               VM_EXIT_IA32E_MODE |
+               VM_EXIT_SAVE_PREEMPT_TIMER;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHF-0006xv-Ce; Tue, 04 Dec 2012 00:22:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0006ux-6d
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Received: from [85.158.137.99:11593] by server-1.bemta-3.messagelabs.com id
	EE/AA-12169-B324DB05; Tue, 04 Dec 2012 00:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354580537!12397346!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29489 invoked from network); 4 Dec 2012 00:22:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0007G2-PM
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0008OM-No
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Message-Id: <E1TfgHA-0008OM-No@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable VMX-preemption
	timer for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267457 0
# Node ID 110201bfc39e0a98cf2533265cc2c5b3327a5cdc
# Parent  8f2c5313298fe6eaf5e2038d0271af8b2e1958af
nested vmx: enable VMX-preemption timer for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 8f2c5313298f -r 110201bfc39e xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:23:57 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:24:17 2012 +0000
@@ -237,6 +237,13 @@ static void reg_write(struct cpu_user_re
     *pval = value;
 }
 
+static inline u32 __n2_pin_exec_control(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+
+    return __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+}
+
 static inline u32 __n2_exec_control(struct vcpu *v)
 {
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
@@ -511,7 +518,6 @@ static void nvmx_update_pin_control(stru
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
-    shadow_cntrl &= ~PIN_BASED_PREEMPT_TIMER;
     shadow_cntrl |= host_cntrl;
     __vmwrite(PIN_BASED_VM_EXEC_CONTROL, shadow_cntrl);
 }
@@ -641,6 +647,7 @@ static const u16 vmcs_gstate_field[] = {
     GUEST_INTERRUPTIBILITY_INFO,
     GUEST_ACTIVITY_STATE,
     GUEST_SYSENTER_CS,
+    GUEST_PREEMPTION_TIMER,
     /* natural */
     GUEST_ES_BASE,
     GUEST_CS_BASE,
@@ -1269,7 +1276,9 @@ int nvmx_msr_read_intercept(unsigned int
         break;
     case MSR_IA32_VMX_PINBASED_CTLS:
         /* 1-seetings */
-        data = PIN_BASED_EXT_INTR_MASK | PIN_BASED_NMI_EXITING;
+        data = PIN_BASED_EXT_INTR_MASK |
+               PIN_BASED_NMI_EXITING |
+               PIN_BASED_PREEMPT_TIMER;
         data <<= 32;
 	/* 0-settings */
         data |= 0;
@@ -1513,6 +1522,11 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         if ( ctrl & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING )
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
+        ctrl = __n2_pin_exec_control(v);
+        if ( ctrl & PIN_BASED_PREEMPT_TIMER )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);
diff -r 8f2c5313298f -r 110201bfc39e xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:23:57 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:24:17 2012 +0000
@@ -357,6 +357,7 @@ enum vmcs_field {
     GUEST_INTERRUPTIBILITY_INFO     = 0x00004824,
     GUEST_ACTIVITY_STATE            = 0x00004826,
     GUEST_SYSENTER_CS               = 0x0000482A,
+    GUEST_PREEMPTION_TIMER          = 0x0000482e,
     HOST_SYSENTER_CS                = 0x00004c00,
     CR0_GUEST_HOST_MASK             = 0x00006000,
     CR4_GUEST_HOST_MASK             = 0x00006002,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHF-0006xv-Ce; Tue, 04 Dec 2012 00:22:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0006ux-6d
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Received: from [85.158.137.99:11593] by server-1.bemta-3.messagelabs.com id
	EE/AA-12169-B324DB05; Tue, 04 Dec 2012 00:22:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354580537!12397346!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29489 invoked from network); 4 Dec 2012 00:22:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0007G2-PM
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0008OM-No
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Message-Id: <E1TfgHA-0008OM-No@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable VMX-preemption
	timer for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267457 0
# Node ID 110201bfc39e0a98cf2533265cc2c5b3327a5cdc
# Parent  8f2c5313298fe6eaf5e2038d0271af8b2e1958af
nested vmx: enable VMX-preemption timer for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 8f2c5313298f -r 110201bfc39e xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:23:57 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:24:17 2012 +0000
@@ -237,6 +237,13 @@ static void reg_write(struct cpu_user_re
     *pval = value;
 }
 
+static inline u32 __n2_pin_exec_control(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+
+    return __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+}
+
 static inline u32 __n2_exec_control(struct vcpu *v)
 {
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
@@ -511,7 +518,6 @@ static void nvmx_update_pin_control(stru
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
-    shadow_cntrl &= ~PIN_BASED_PREEMPT_TIMER;
     shadow_cntrl |= host_cntrl;
     __vmwrite(PIN_BASED_VM_EXEC_CONTROL, shadow_cntrl);
 }
@@ -641,6 +647,7 @@ static const u16 vmcs_gstate_field[] = {
     GUEST_INTERRUPTIBILITY_INFO,
     GUEST_ACTIVITY_STATE,
     GUEST_SYSENTER_CS,
+    GUEST_PREEMPTION_TIMER,
     /* natural */
     GUEST_ES_BASE,
     GUEST_CS_BASE,
@@ -1269,7 +1276,9 @@ int nvmx_msr_read_intercept(unsigned int
         break;
     case MSR_IA32_VMX_PINBASED_CTLS:
         /* 1-seetings */
-        data = PIN_BASED_EXT_INTR_MASK | PIN_BASED_NMI_EXITING;
+        data = PIN_BASED_EXT_INTR_MASK |
+               PIN_BASED_NMI_EXITING |
+               PIN_BASED_PREEMPT_TIMER;
         data <<= 32;
 	/* 0-settings */
         data |= 0;
@@ -1513,6 +1522,11 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         if ( ctrl & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING )
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
+        ctrl = __n2_pin_exec_control(v);
+        if ( ctrl & PIN_BASED_PREEMPT_TIMER )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);
diff -r 8f2c5313298f -r 110201bfc39e xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:23:57 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:24:17 2012 +0000
@@ -357,6 +357,7 @@ enum vmcs_field {
     GUEST_INTERRUPTIBILITY_INFO     = 0x00004824,
     GUEST_ACTIVITY_STATE            = 0x00004826,
     GUEST_SYSENTER_CS               = 0x0000482A,
+    GUEST_PREEMPTION_TIMER          = 0x0000482e,
     HOST_SYSENTER_CS                = 0x00004c00,
     CR0_GUEST_HOST_MASK             = 0x00006000,
     CR4_GUEST_HOST_MASK             = 0x00006002,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHF-0006xl-AB; Tue, 04 Dec 2012 00:22:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0006tw-Bh
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Received: from [85.158.143.99:7159] by server-1.bemta-4.messagelabs.com id
	FF/0D-27934-C324DB05; Tue, 04 Dec 2012 00:22:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354580538!27583876!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24520 invoked from network); 4 Dec 2012 00:22:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHB-0007G8-QJ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHB-0008Oq-OM
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:17 +0000
Message-Id: <E1TfgHB-0008Oq-OM@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable load and save
	IA32_PAT feature for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267534 0
# Node ID 9108c44f2535840960086e7a1255f50b275c83db
# Parent  f32566fd3d624c91355bd261d83b21511db24a38
nested vmx: enable load and save IA32_PAT feature for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f32566fd3d62 -r 9108c44f2535 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:25:09 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:25:34 2012 +0000
@@ -529,7 +529,7 @@ static void nvmx_update_exit_control(str
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
-                      | VM_EXIT_SAVE_GUEST_PAT
+                      | VM_EXIT_LOAD_HOST_PAT
                       | VM_EXIT_SAVE_GUEST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
@@ -624,6 +624,7 @@ static const u16 vmcs_gstate_field[] = {
     /* 64 BITS */
     VMCS_LINK_POINTER,
     GUEST_IA32_DEBUGCTL,
+    GUEST_PAT,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -746,6 +747,7 @@ static void load_shadow_guest_state(stru
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     void *vvmcs = nvcpu->nv_vvmcx;
     int i;
+    u32 control;
 
     /* vvmcs.gstate to shadow vmcs.gstate */
     for ( i = 0; i < ARRAY_SIZE(vmcs_gstate_field); i++ )
@@ -755,6 +757,10 @@ static void load_shadow_guest_state(stru
     hvm_set_cr4(__get_vvmcs(vvmcs, GUEST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, GUEST_CR3));
 
+    control = __get_vvmcs(vvmcs, VM_ENTRY_CONTROLS);
+    if ( control & VM_ENTRY_LOAD_GUEST_PAT )
+        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, GUEST_PAT));
+
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
     vvmcs_to_shadow(vvmcs, VM_ENTRY_INTR_INFO);
@@ -868,6 +874,7 @@ static void load_vvmcs_host_state(struct
     int i;
     u64 r;
     void *vvmcs = vcpu_nestedhvm(v).nv_vvmcx;
+    u32 control;
 
     for ( i = 0; i < ARRAY_SIZE(vmcs_h2g_field); i++ )
     {
@@ -879,6 +886,10 @@ static void load_vvmcs_host_state(struct
     hvm_set_cr4(__get_vvmcs(vvmcs, HOST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, HOST_CR3));
 
+    control = __get_vvmcs(vvmcs, VM_EXIT_CONTROLS);
+    if ( control & VM_EXIT_LOAD_HOST_PAT )
+        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, HOST_PAT));
+
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
     __set_vvmcs(vvmcs, VM_ENTRY_INTR_INFO, 0);
@@ -1319,14 +1330,17 @@ int nvmx_msr_read_intercept(unsigned int
         tmp = 0x36dff;
         data = VM_EXIT_ACK_INTR_ON_EXIT |
                VM_EXIT_IA32E_MODE |
-               VM_EXIT_SAVE_PREEMPT_TIMER;
+               VM_EXIT_SAVE_PREEMPT_TIMER |
+               VM_EXIT_SAVE_GUEST_PAT |
+               VM_EXIT_LOAD_HOST_PAT;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
-        data = 0x11ff;
-        data = (data << 32) | data;
+        tmp = 0x11ff;
+        data = VM_ENTRY_LOAD_GUEST_PAT;
+        data = ((data | tmp) << 32) | tmp;
         break;
 
     case IA32_FEATURE_CONTROL_MSR:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHF-0006xl-AB; Tue, 04 Dec 2012 00:22:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0006tw-Bh
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Received: from [85.158.143.99:7159] by server-1.bemta-4.messagelabs.com id
	FF/0D-27934-C324DB05; Tue, 04 Dec 2012 00:22:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1354580538!27583876!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24520 invoked from network); 4 Dec 2012 00:22:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHB-0007G8-QJ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHB-0008Oq-OM
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:17 +0000
Message-Id: <E1TfgHB-0008Oq-OM@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable load and save
	IA32_PAT feature for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267534 0
# Node ID 9108c44f2535840960086e7a1255f50b275c83db
# Parent  f32566fd3d624c91355bd261d83b21511db24a38
nested vmx: enable load and save IA32_PAT feature for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f32566fd3d62 -r 9108c44f2535 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:25:09 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:25:34 2012 +0000
@@ -529,7 +529,7 @@ static void nvmx_update_exit_control(str
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
-                      | VM_EXIT_SAVE_GUEST_PAT
+                      | VM_EXIT_LOAD_HOST_PAT
                       | VM_EXIT_SAVE_GUEST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
@@ -624,6 +624,7 @@ static const u16 vmcs_gstate_field[] = {
     /* 64 BITS */
     VMCS_LINK_POINTER,
     GUEST_IA32_DEBUGCTL,
+    GUEST_PAT,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -746,6 +747,7 @@ static void load_shadow_guest_state(stru
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
     void *vvmcs = nvcpu->nv_vvmcx;
     int i;
+    u32 control;
 
     /* vvmcs.gstate to shadow vmcs.gstate */
     for ( i = 0; i < ARRAY_SIZE(vmcs_gstate_field); i++ )
@@ -755,6 +757,10 @@ static void load_shadow_guest_state(stru
     hvm_set_cr4(__get_vvmcs(vvmcs, GUEST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, GUEST_CR3));
 
+    control = __get_vvmcs(vvmcs, VM_ENTRY_CONTROLS);
+    if ( control & VM_ENTRY_LOAD_GUEST_PAT )
+        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, GUEST_PAT));
+
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
     vvmcs_to_shadow(vvmcs, VM_ENTRY_INTR_INFO);
@@ -868,6 +874,7 @@ static void load_vvmcs_host_state(struct
     int i;
     u64 r;
     void *vvmcs = vcpu_nestedhvm(v).nv_vvmcx;
+    u32 control;
 
     for ( i = 0; i < ARRAY_SIZE(vmcs_h2g_field); i++ )
     {
@@ -879,6 +886,10 @@ static void load_vvmcs_host_state(struct
     hvm_set_cr4(__get_vvmcs(vvmcs, HOST_CR4));
     hvm_set_cr3(__get_vvmcs(vvmcs, HOST_CR3));
 
+    control = __get_vvmcs(vvmcs, VM_EXIT_CONTROLS);
+    if ( control & VM_EXIT_LOAD_HOST_PAT )
+        hvm_set_guest_pat(v, __get_vvmcs(vvmcs, HOST_PAT));
+
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
     __set_vvmcs(vvmcs, VM_ENTRY_INTR_INFO, 0);
@@ -1319,14 +1330,17 @@ int nvmx_msr_read_intercept(unsigned int
         tmp = 0x36dff;
         data = VM_EXIT_ACK_INTR_ON_EXIT |
                VM_EXIT_IA32E_MODE |
-               VM_EXIT_SAVE_PREEMPT_TIMER;
+               VM_EXIT_SAVE_PREEMPT_TIMER |
+               VM_EXIT_SAVE_GUEST_PAT |
+               VM_EXIT_LOAD_HOST_PAT;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
-        data = 0x11ff;
-        data = (data << 32) | data;
+        tmp = 0x11ff;
+        data = VM_ENTRY_LOAD_GUEST_PAT;
+        data = ((data | tmp) << 32) | tmp;
         break;
 
     case IA32_FEATURE_CONTROL_MSR:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHF-0006xS-4r; Tue, 04 Dec 2012 00:22:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHD-0006tw-A0
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:19 +0000
Received: from [85.158.143.35:22605] by server-1.bemta-4.messagelabs.com id
	ED/0D-27934-A324DB05; Tue, 04 Dec 2012 00:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1354580536!14708904!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4066 invoked from network); 4 Dec 2012 00:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0007Fw-8p
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0008O7-78
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Message-Id: <E1TfgHA-0008O7-78@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable Descriptor-table
	exiting for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267437 0
# Node ID 8f2c5313298fe6eaf5e2038d0271af8b2e1958af
# Parent  a15b4080f143787f9e8381c5e00cdfd5585c3456
nested vmx: enable Descriptor-table exiting for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r a15b4080f143 -r 8f2c5313298f xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:23:22 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:23:57 2012 +0000
@@ -1300,7 +1300,7 @@ int nvmx_msr_read_intercept(unsigned int
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS2:
         /* 1-seetings */
-        data = 0;
+        data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING;
         /* 0-settings */
         tmp = 0;
         data = (data << 32) | tmp;
@@ -1507,6 +1507,12 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         if ( ctrl & CPU_BASED_MONITOR_TRAP_FLAG)
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_ACCESS_GDTR_OR_IDTR:
+    case EXIT_REASON_ACCESS_LDTR_OR_TR:
+        ctrl = __n2_secondary_exec_control(v);
+        if ( ctrl & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);
diff -r a15b4080f143 -r 8f2c5313298f xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:23:22 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:23:57 2012 +0000
@@ -179,6 +179,7 @@ extern u32 vmx_vmentry_control;
 
 #define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
 #define SECONDARY_EXEC_ENABLE_EPT               0x00000002
+#define SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING 0x00000004
 #define SECONDARY_EXEC_ENABLE_RDTSCP            0x00000008
 #define SECONDARY_EXEC_ENABLE_VPID              0x00000020
 #define SECONDARY_EXEC_WBINVD_EXITING           0x00000040

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHF-0006xS-4r; Tue, 04 Dec 2012 00:22:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHD-0006tw-A0
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:19 +0000
Received: from [85.158.143.35:22605] by server-1.bemta-4.messagelabs.com id
	ED/0D-27934-A324DB05; Tue, 04 Dec 2012 00:22:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1354580536!14708904!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4066 invoked from network); 4 Dec 2012 00:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0007Fw-8p
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHA-0008O7-78
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:16 +0000
Message-Id: <E1TfgHA-0008O7-78@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable Descriptor-table
	exiting for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267437 0
# Node ID 8f2c5313298fe6eaf5e2038d0271af8b2e1958af
# Parent  a15b4080f143787f9e8381c5e00cdfd5585c3456
nested vmx: enable Descriptor-table exiting for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r a15b4080f143 -r 8f2c5313298f xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:23:22 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:23:57 2012 +0000
@@ -1300,7 +1300,7 @@ int nvmx_msr_read_intercept(unsigned int
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS2:
         /* 1-seetings */
-        data = 0;
+        data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING;
         /* 0-settings */
         tmp = 0;
         data = (data << 32) | tmp;
@@ -1507,6 +1507,12 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         if ( ctrl & CPU_BASED_MONITOR_TRAP_FLAG)
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_ACCESS_GDTR_OR_IDTR:
+    case EXIT_REASON_ACCESS_LDTR_OR_TR:
+        ctrl = __n2_secondary_exec_control(v);
+        if ( ctrl & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     /* L1 has priority handling several other types of exits */
     case EXIT_REASON_HLT:
         ctrl = __n2_exec_control(v);
diff -r a15b4080f143 -r 8f2c5313298f xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:23:22 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:23:57 2012 +0000
@@ -179,6 +179,7 @@ extern u32 vmx_vmentry_control;
 
 #define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
 #define SECONDARY_EXEC_ENABLE_EPT               0x00000002
+#define SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING 0x00000004
 #define SECONDARY_EXEC_ENABLE_RDTSCP            0x00000008
 #define SECONDARY_EXEC_ENABLE_VPID              0x00000020
 #define SECONDARY_EXEC_WBINVD_EXITING           0x00000040

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHG-0006zv-J3; Tue, 04 Dec 2012 00:22:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHF-0006rm-1D
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:21 +0000
Received: from [85.158.138.51:36035] by server-11.bemta-3.messagelabs.com id
	46/95-19361-C324DB05; Tue, 04 Dec 2012 00:22:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354580538!23685449!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6220 invoked from network); 4 Dec 2012 00:22:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0007GB-Ab
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0008P5-91
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Message-Id: <E1TfgHC-0008P5-91@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable load and save
	IA32_EFER feature for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267561 0
# Node ID 8208ac732f6851d2be8b816ccbab548f0cc70303
# Parent  9108c44f2535840960086e7a1255f50b275c83db
nested vmx: enable load and save IA32_EFER feature for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9108c44f2535 -r 8208ac732f68 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:25:34 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:26:01 2012 +0000
@@ -530,7 +530,7 @@ static void nvmx_update_exit_control(str
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_LOAD_HOST_PAT
-                      | VM_EXIT_SAVE_GUEST_EFER);
+                      | VM_EXIT_LOAD_HOST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -625,6 +625,7 @@ static const u16 vmcs_gstate_field[] = {
     VMCS_LINK_POINTER,
     GUEST_IA32_DEBUGCTL,
     GUEST_PAT,
+    GUEST_EFER,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -1332,14 +1333,17 @@ int nvmx_msr_read_intercept(unsigned int
                VM_EXIT_IA32E_MODE |
                VM_EXIT_SAVE_PREEMPT_TIMER |
                VM_EXIT_SAVE_GUEST_PAT |
-               VM_EXIT_LOAD_HOST_PAT;
+               VM_EXIT_LOAD_HOST_PAT |
+               VM_EXIT_SAVE_GUEST_EFER |
+               VM_EXIT_LOAD_HOST_EFER;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
         tmp = 0x11ff;
-        data = VM_ENTRY_LOAD_GUEST_PAT;
+        data = VM_ENTRY_LOAD_GUEST_PAT |
+               VM_ENTRY_LOAD_GUEST_EFER;
         data = ((data | tmp) << 32) | tmp;
         break;
 
diff -r 9108c44f2535 -r 8208ac732f68 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:25:34 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:26:01 2012 +0000
@@ -300,6 +300,8 @@ enum vmcs_field {
     GUEST_IA32_DEBUGCTL_HIGH        = 0x00002803,
     GUEST_PAT                       = 0x00002804,
     GUEST_PAT_HIGH                  = 0x00002805,
+    GUEST_EFER                      = 0x00002806,
+    GUEST_EFER_HIGH                 = 0x00002807,
     GUEST_PDPTR0                    = 0x0000280a,
     GUEST_PDPTR0_HIGH               = 0x0000280b,
     GUEST_PDPTR1                    = 0x0000280c,
@@ -310,6 +312,8 @@ enum vmcs_field {
     GUEST_PDPTR3_HIGH               = 0x00002811,
     HOST_PAT                        = 0x00002c00,
     HOST_PAT_HIGH                   = 0x00002c01,
+    HOST_EFER                       = 0x00002c02,
+    HOST_EFER_HIGH                  = 0x00002c03,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHG-0006zv-J3; Tue, 04 Dec 2012 00:22:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHF-0006rm-1D
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:21 +0000
Received: from [85.158.138.51:36035] by server-11.bemta-3.messagelabs.com id
	46/95-19361-C324DB05; Tue, 04 Dec 2012 00:22:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1354580538!23685449!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6220 invoked from network); 4 Dec 2012 00:22:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0007GB-Ab
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0008P5-91
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Message-Id: <E1TfgHC-0008P5-91@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable load and save
	IA32_EFER feature for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267561 0
# Node ID 8208ac732f6851d2be8b816ccbab548f0cc70303
# Parent  9108c44f2535840960086e7a1255f50b275c83db
nested vmx: enable load and save IA32_EFER feature for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9108c44f2535 -r 8208ac732f68 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:25:34 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:26:01 2012 +0000
@@ -530,7 +530,7 @@ static void nvmx_update_exit_control(str
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_LOAD_HOST_PAT
-                      | VM_EXIT_SAVE_GUEST_EFER);
+                      | VM_EXIT_LOAD_HOST_EFER);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -625,6 +625,7 @@ static const u16 vmcs_gstate_field[] = {
     VMCS_LINK_POINTER,
     GUEST_IA32_DEBUGCTL,
     GUEST_PAT,
+    GUEST_EFER,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -1332,14 +1333,17 @@ int nvmx_msr_read_intercept(unsigned int
                VM_EXIT_IA32E_MODE |
                VM_EXIT_SAVE_PREEMPT_TIMER |
                VM_EXIT_SAVE_GUEST_PAT |
-               VM_EXIT_LOAD_HOST_PAT;
+               VM_EXIT_LOAD_HOST_PAT |
+               VM_EXIT_SAVE_GUEST_EFER |
+               VM_EXIT_LOAD_HOST_EFER;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
         tmp = 0x11ff;
-        data = VM_ENTRY_LOAD_GUEST_PAT;
+        data = VM_ENTRY_LOAD_GUEST_PAT |
+               VM_ENTRY_LOAD_GUEST_EFER;
         data = ((data | tmp) << 32) | tmp;
         break;
 
diff -r 9108c44f2535 -r 8208ac732f68 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:25:34 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:26:01 2012 +0000
@@ -300,6 +300,8 @@ enum vmcs_field {
     GUEST_IA32_DEBUGCTL_HIGH        = 0x00002803,
     GUEST_PAT                       = 0x00002804,
     GUEST_PAT_HIGH                  = 0x00002805,
+    GUEST_EFER                      = 0x00002806,
+    GUEST_EFER_HIGH                 = 0x00002807,
     GUEST_PDPTR0                    = 0x0000280a,
     GUEST_PDPTR0_HIGH               = 0x0000280b,
     GUEST_PDPTR1                    = 0x0000280c,
@@ -310,6 +312,8 @@ enum vmcs_field {
     GUEST_PDPTR3_HIGH               = 0x00002811,
     HOST_PAT                        = 0x00002c00,
     HOST_PAT_HIGH                   = 0x00002c01,
+    HOST_EFER                       = 0x00002c02,
+    HOST_EFER_HIGH                  = 0x00002c03,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHH-00071G-QR; Tue, 04 Dec 2012 00:22:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHG-0006yP-6K
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:22 +0000
Received: from [85.158.138.51:21333] by server-15.bemta-3.messagelabs.com id
	E2/61-23779-D324DB05; Tue, 04 Dec 2012 00:22:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354580539!30640048!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20339 invoked from network); 4 Dec 2012 00:22:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0007GE-VA
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0008PK-R1
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Message-Id: <E1TfgHC-0008PK-R1@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable load
	IA32_PERF_GLOBAL_CTRL feature for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267590 0
# Node ID 0cf1f79bc4f880d5f961630d4f29119ac70139f0
# Parent  8208ac732f6851d2be8b816ccbab548f0cc70303
nested vmx: enable load IA32_PERF_GLOBAL_CTRL feature for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 8208ac732f68 -r 0cf1f79bc4f8 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:26:01 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:26:30 2012 +0000
@@ -530,7 +530,8 @@ static void nvmx_update_exit_control(str
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_LOAD_HOST_PAT
-                      | VM_EXIT_LOAD_HOST_EFER);
+                      | VM_EXIT_LOAD_HOST_EFER
+                      | VM_EXIT_LOAD_PERF_GLOBAL_CTRL);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -541,7 +542,9 @@ static void nvmx_update_entry_control(st
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_ENTRY_CONTROLS);
-    shadow_cntrl &= ~(VM_ENTRY_LOAD_GUEST_PAT | VM_ENTRY_LOAD_GUEST_EFER);
+    shadow_cntrl &= ~(VM_ENTRY_LOAD_GUEST_PAT
+                      | VM_ENTRY_LOAD_GUEST_EFER
+                      | VM_ENTRY_LOAD_PERF_GLOBAL_CTRL);
     __vmwrite(VM_ENTRY_CONTROLS, shadow_cntrl);
 }
 
@@ -626,6 +629,7 @@ static const u16 vmcs_gstate_field[] = {
     GUEST_IA32_DEBUGCTL,
     GUEST_PAT,
     GUEST_EFER,
+    GUEST_PERF_GLOBAL_CTRL,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -761,6 +765,8 @@ static void load_shadow_guest_state(stru
     control = __get_vvmcs(vvmcs, VM_ENTRY_CONTROLS);
     if ( control & VM_ENTRY_LOAD_GUEST_PAT )
         hvm_set_guest_pat(v, __get_vvmcs(vvmcs, GUEST_PAT));
+    if ( control & VM_ENTRY_LOAD_PERF_GLOBAL_CTRL )
+        hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL, __get_vvmcs(vvmcs, GUEST_PERF_GLOBAL_CTRL));
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
@@ -890,6 +896,8 @@ static void load_vvmcs_host_state(struct
     control = __get_vvmcs(vvmcs, VM_EXIT_CONTROLS);
     if ( control & VM_EXIT_LOAD_HOST_PAT )
         hvm_set_guest_pat(v, __get_vvmcs(vvmcs, HOST_PAT));
+    if ( control & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
+        hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL, __get_vvmcs(vvmcs, HOST_PERF_GLOBAL_CTRL));
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
@@ -1335,7 +1343,8 @@ int nvmx_msr_read_intercept(unsigned int
                VM_EXIT_SAVE_GUEST_PAT |
                VM_EXIT_LOAD_HOST_PAT |
                VM_EXIT_SAVE_GUEST_EFER |
-               VM_EXIT_LOAD_HOST_EFER;
+               VM_EXIT_LOAD_HOST_EFER |
+               VM_EXIT_LOAD_PERF_GLOBAL_CTRL;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
@@ -1343,7 +1352,8 @@ int nvmx_msr_read_intercept(unsigned int
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
         tmp = 0x11ff;
         data = VM_ENTRY_LOAD_GUEST_PAT |
-               VM_ENTRY_LOAD_GUEST_EFER;
+               VM_ENTRY_LOAD_GUEST_EFER |
+               VM_ENTRY_LOAD_PERF_GLOBAL_CTRL;
         data = ((data | tmp) << 32) | tmp;
         break;
 
diff -r 8208ac732f68 -r 0cf1f79bc4f8 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:26:01 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:26:30 2012 +0000
@@ -162,6 +162,7 @@ extern u32 vmx_pin_based_exec_control;
 
 #define VM_EXIT_SAVE_DEBUG_CNTRLS       0x00000004
 #define VM_EXIT_IA32E_MODE              0x00000200
+#define VM_EXIT_LOAD_PERF_GLOBAL_CTRL   0x00001000
 #define VM_EXIT_ACK_INTR_ON_EXIT        0x00008000
 #define VM_EXIT_SAVE_GUEST_PAT          0x00040000
 #define VM_EXIT_LOAD_HOST_PAT           0x00080000
@@ -173,6 +174,7 @@ extern u32 vmx_vmexit_control;
 #define VM_ENTRY_IA32E_MODE             0x00000200
 #define VM_ENTRY_SMM                    0x00000400
 #define VM_ENTRY_DEACT_DUAL_MONITOR     0x00000800
+#define VM_ENTRY_LOAD_PERF_GLOBAL_CTRL  0x00002000
 #define VM_ENTRY_LOAD_GUEST_PAT         0x00004000
 #define VM_ENTRY_LOAD_GUEST_EFER        0x00008000
 extern u32 vmx_vmentry_control;
@@ -302,6 +304,8 @@ enum vmcs_field {
     GUEST_PAT_HIGH                  = 0x00002805,
     GUEST_EFER                      = 0x00002806,
     GUEST_EFER_HIGH                 = 0x00002807,
+    GUEST_PERF_GLOBAL_CTRL          = 0x00002808,
+    GUEST_PERF_GLOBAL_CTRL_HIGH     = 0x00002809,
     GUEST_PDPTR0                    = 0x0000280a,
     GUEST_PDPTR0_HIGH               = 0x0000280b,
     GUEST_PDPTR1                    = 0x0000280c,
@@ -314,6 +318,8 @@ enum vmcs_field {
     HOST_PAT_HIGH                   = 0x00002c01,
     HOST_EFER                       = 0x00002c02,
     HOST_EFER_HIGH                  = 0x00002c03,
+    HOST_PERF_GLOBAL_CTRL           = 0x00002c04,
+    HOST_PERF_GLOBAL_CTRL_HIGH      = 0x00002c05,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHH-00071G-QR; Tue, 04 Dec 2012 00:22:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHG-0006yP-6K
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:22 +0000
Received: from [85.158.138.51:21333] by server-15.bemta-3.messagelabs.com id
	E2/61-23779-D324DB05; Tue, 04 Dec 2012 00:22:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354580539!30640048!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20339 invoked from network); 4 Dec 2012 00:22:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0007GE-VA
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHC-0008PK-R1
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:18 +0000
Message-Id: <E1TfgHC-0008PK-R1@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable load
	IA32_PERF_GLOBAL_CTRL feature for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354267590 0
# Node ID 0cf1f79bc4f880d5f961630d4f29119ac70139f0
# Parent  8208ac732f6851d2be8b816ccbab548f0cc70303
nested vmx: enable load IA32_PERF_GLOBAL_CTRL feature for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 8208ac732f68 -r 0cf1f79bc4f8 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:26:01 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Fri Nov 30 09:26:30 2012 +0000
@@ -530,7 +530,8 @@ static void nvmx_update_exit_control(str
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_EXIT_CONTROLS);
     shadow_cntrl &= ~(VM_EXIT_SAVE_DEBUG_CNTRLS 
                       | VM_EXIT_LOAD_HOST_PAT
-                      | VM_EXIT_LOAD_HOST_EFER);
+                      | VM_EXIT_LOAD_HOST_EFER
+                      | VM_EXIT_LOAD_PERF_GLOBAL_CTRL);
     shadow_cntrl |= host_cntrl;
     __vmwrite(VM_EXIT_CONTROLS, shadow_cntrl);
 }
@@ -541,7 +542,9 @@ static void nvmx_update_entry_control(st
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
 
     shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, VM_ENTRY_CONTROLS);
-    shadow_cntrl &= ~(VM_ENTRY_LOAD_GUEST_PAT | VM_ENTRY_LOAD_GUEST_EFER);
+    shadow_cntrl &= ~(VM_ENTRY_LOAD_GUEST_PAT
+                      | VM_ENTRY_LOAD_GUEST_EFER
+                      | VM_ENTRY_LOAD_PERF_GLOBAL_CTRL);
     __vmwrite(VM_ENTRY_CONTROLS, shadow_cntrl);
 }
 
@@ -626,6 +629,7 @@ static const u16 vmcs_gstate_field[] = {
     GUEST_IA32_DEBUGCTL,
     GUEST_PAT,
     GUEST_EFER,
+    GUEST_PERF_GLOBAL_CTRL,
     /* 32 BITS */
     GUEST_ES_LIMIT,
     GUEST_CS_LIMIT,
@@ -761,6 +765,8 @@ static void load_shadow_guest_state(stru
     control = __get_vvmcs(vvmcs, VM_ENTRY_CONTROLS);
     if ( control & VM_ENTRY_LOAD_GUEST_PAT )
         hvm_set_guest_pat(v, __get_vvmcs(vvmcs, GUEST_PAT));
+    if ( control & VM_ENTRY_LOAD_PERF_GLOBAL_CTRL )
+        hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL, __get_vvmcs(vvmcs, GUEST_PERF_GLOBAL_CTRL));
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
@@ -890,6 +896,8 @@ static void load_vvmcs_host_state(struct
     control = __get_vvmcs(vvmcs, VM_EXIT_CONTROLS);
     if ( control & VM_EXIT_LOAD_HOST_PAT )
         hvm_set_guest_pat(v, __get_vvmcs(vvmcs, HOST_PAT));
+    if ( control & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
+        hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL, __get_vvmcs(vvmcs, HOST_PERF_GLOBAL_CTRL));
 
     hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset);
 
@@ -1335,7 +1343,8 @@ int nvmx_msr_read_intercept(unsigned int
                VM_EXIT_SAVE_GUEST_PAT |
                VM_EXIT_LOAD_HOST_PAT |
                VM_EXIT_SAVE_GUEST_EFER |
-               VM_EXIT_LOAD_HOST_EFER;
+               VM_EXIT_LOAD_HOST_EFER |
+               VM_EXIT_LOAD_PERF_GLOBAL_CTRL;
 	/* 0-settings */
         data = ((data | tmp) << 32) | tmp;
         break;
@@ -1343,7 +1352,8 @@ int nvmx_msr_read_intercept(unsigned int
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
         tmp = 0x11ff;
         data = VM_ENTRY_LOAD_GUEST_PAT |
-               VM_ENTRY_LOAD_GUEST_EFER;
+               VM_ENTRY_LOAD_GUEST_EFER |
+               VM_ENTRY_LOAD_PERF_GLOBAL_CTRL;
         data = ((data | tmp) << 32) | tmp;
         break;
 
diff -r 8208ac732f68 -r 0cf1f79bc4f8 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:26:01 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Fri Nov 30 09:26:30 2012 +0000
@@ -162,6 +162,7 @@ extern u32 vmx_pin_based_exec_control;
 
 #define VM_EXIT_SAVE_DEBUG_CNTRLS       0x00000004
 #define VM_EXIT_IA32E_MODE              0x00000200
+#define VM_EXIT_LOAD_PERF_GLOBAL_CTRL   0x00001000
 #define VM_EXIT_ACK_INTR_ON_EXIT        0x00008000
 #define VM_EXIT_SAVE_GUEST_PAT          0x00040000
 #define VM_EXIT_LOAD_HOST_PAT           0x00080000
@@ -173,6 +174,7 @@ extern u32 vmx_vmexit_control;
 #define VM_ENTRY_IA32E_MODE             0x00000200
 #define VM_ENTRY_SMM                    0x00000400
 #define VM_ENTRY_DEACT_DUAL_MONITOR     0x00000800
+#define VM_ENTRY_LOAD_PERF_GLOBAL_CTRL  0x00002000
 #define VM_ENTRY_LOAD_GUEST_PAT         0x00004000
 #define VM_ENTRY_LOAD_GUEST_EFER        0x00008000
 extern u32 vmx_vmentry_control;
@@ -302,6 +304,8 @@ enum vmcs_field {
     GUEST_PAT_HIGH                  = 0x00002805,
     GUEST_EFER                      = 0x00002806,
     GUEST_EFER_HIGH                 = 0x00002807,
+    GUEST_PERF_GLOBAL_CTRL          = 0x00002808,
+    GUEST_PERF_GLOBAL_CTRL_HIGH     = 0x00002809,
     GUEST_PDPTR0                    = 0x0000280a,
     GUEST_PDPTR0_HIGH               = 0x0000280b,
     GUEST_PDPTR1                    = 0x0000280c,
@@ -314,6 +318,8 @@ enum vmcs_field {
     HOST_PAT_HIGH                   = 0x00002c01,
     HOST_EFER                       = 0x00002c02,
     HOST_EFER_HIGH                  = 0x00002c03,
+    HOST_PERF_GLOBAL_CTRL           = 0x00002c04,
+    HOST_PERF_GLOBAL_CTRL_HIGH      = 0x00002c05,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHI-00072l-T4; Tue, 04 Dec 2012 00:22:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-00070Z-Fn
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:23 +0000
Received: from [85.158.143.35:22686] by server-3.bemta-4.messagelabs.com id
	53/4B-06841-E324DB05; Tue, 04 Dec 2012 00:22:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354580540!13453297!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20614 invoked from network); 4 Dec 2012 00:22:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0007GN-HP
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0008Q3-Fp
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Message-Id: <E1TfgHE-0008Q3-Fp@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios/console: console_input() weak
	reference
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1354268233 0
# Node ID 69ff13e8c17df1789ed0049a86fbfb6aff11a041
# Parent  07396f4fb4766df322f1cafc1175ecab22c6f4af
minios/console: console_input() weak reference

In exactly the same style as app_main() in kernel.c, create a weak
reference console_input() function for applications to override to
quickly gain access to the console.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 07396f4fb476 -r 69ff13e8c17d extras/mini-os/console/console.c
--- a/extras/mini-os/console/console.c	Fri Nov 30 09:32:27 2012 +0000
+++ b/extras/mini-os/console/console.c	Fri Nov 30 09:37:13 2012 +0000
@@ -54,9 +54,7 @@
    NOTE: you need to enable verbose in xen/Rules.mk for it to work. */
 static int console_initialised = 0;
 
-
-#ifndef HAVE_LIBC
-void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
+__attribute__((weak)) void console_input(char * buf, unsigned len)
 {
     if(len > 0)
     {
@@ -69,6 +67,12 @@ void xencons_rx(char *buf, unsigned len,
     }
 }
 
+#ifndef HAVE_LIBC
+void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
+{
+    console_input(buf, len);
+}
+
 void xencons_tx(void)
 {
     /* Do nothing, handled by _rx */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHI-00072l-T4; Tue, 04 Dec 2012 00:22:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-00070Z-Fn
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:23 +0000
Received: from [85.158.143.35:22686] by server-3.bemta-4.messagelabs.com id
	53/4B-06841-E324DB05; Tue, 04 Dec 2012 00:22:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354580540!13453297!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20614 invoked from network); 4 Dec 2012 00:22:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0007GN-HP
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0008Q3-Fp
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Message-Id: <E1TfgHE-0008Q3-Fp@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] minios/console: console_input() weak
	reference
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1354268233 0
# Node ID 69ff13e8c17df1789ed0049a86fbfb6aff11a041
# Parent  07396f4fb4766df322f1cafc1175ecab22c6f4af
minios/console: console_input() weak reference

In exactly the same style as app_main() in kernel.c, create a weak
reference console_input() function for applications to override to
quickly gain access to the console.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 07396f4fb476 -r 69ff13e8c17d extras/mini-os/console/console.c
--- a/extras/mini-os/console/console.c	Fri Nov 30 09:32:27 2012 +0000
+++ b/extras/mini-os/console/console.c	Fri Nov 30 09:37:13 2012 +0000
@@ -54,9 +54,7 @@
    NOTE: you need to enable verbose in xen/Rules.mk for it to work. */
 static int console_initialised = 0;
 
-
-#ifndef HAVE_LIBC
-void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
+__attribute__((weak)) void console_input(char * buf, unsigned len)
 {
     if(len > 0)
     {
@@ -69,6 +67,12 @@ void xencons_rx(char *buf, unsigned len,
     }
 }
 
+#ifndef HAVE_LIBC
+void xencons_rx(char *buf, unsigned len, struct pt_regs *regs)
+{
+    console_input(buf, len);
+}
+
 void xencons_tx(void)
 {
     /* Do nothing, handled by _rx */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHI-00072t-VI; Tue, 04 Dec 2012 00:22:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-0006tw-TO
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:24 +0000
Received: from [85.158.143.99:7238] by server-1.bemta-4.messagelabs.com id
	85/1D-27934-F324DB05; Tue, 04 Dec 2012 00:22:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1354580541!18275463!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4716 invoked from network); 4 Dec 2012 00:22:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHF-0007GT-KQ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHF-0008QX-Hf
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:21 +0000
Message-Id: <E1TfgHF-0008QX-Hf@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] AMD IOMMU: add locking missing from
	c/s 26198:ba90ecb0231f
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354272175 -3600
# Node ID a7b0a7cf62e109db00b91f8ae7134da52956df9b
# Parent  f3b6af40e79e1b28cef0225c76874001dfa33bc8
AMD IOMMU: add locking missing from c/s 26198:ba90ecb0231f

An oversight of mine; I'm sorry.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r f3b6af40e79e -r a7b0a7cf62e1 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Nov 30 09:43:29 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Fri Nov 30 11:42:55 2012 +0100
@@ -795,6 +795,7 @@ static bool_t __init set_iommu_interrupt
 static void enable_iommu(struct amd_iommu *iommu)
 {
     unsigned long flags;
+    struct irq_desc *desc;
 
     spin_lock_irqsave(&iommu->lock, flags);
 
@@ -812,7 +813,11 @@ static void enable_iommu(struct amd_iomm
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         register_iommu_ppr_log_in_mmio_space(iommu);
 
-    set_msi_affinity(irq_to_desc(iommu->msi.irq), &cpu_online_map);
+    desc = irq_to_desc(iommu->msi.irq);
+    spin_lock(&desc->lock);
+    set_msi_affinity(desc, &cpu_online_map);
+    spin_unlock(&desc->lock);
+
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
 
     set_iommu_ht_flags(iommu);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHI-00072t-VI; Tue, 04 Dec 2012 00:22:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-0006tw-TO
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:24 +0000
Received: from [85.158.143.99:7238] by server-1.bemta-4.messagelabs.com id
	85/1D-27934-F324DB05; Tue, 04 Dec 2012 00:22:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1354580541!18275463!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4716 invoked from network); 4 Dec 2012 00:22:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHF-0007GT-KQ
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHF-0008QX-Hf
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:21 +0000
Message-Id: <E1TfgHF-0008QX-Hf@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] AMD IOMMU: add locking missing from
	c/s 26198:ba90ecb0231f
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354272175 -3600
# Node ID a7b0a7cf62e109db00b91f8ae7134da52956df9b
# Parent  f3b6af40e79e1b28cef0225c76874001dfa33bc8
AMD IOMMU: add locking missing from c/s 26198:ba90ecb0231f

An oversight of mine; I'm sorry.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r f3b6af40e79e -r a7b0a7cf62e1 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Fri Nov 30 09:43:29 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Fri Nov 30 11:42:55 2012 +0100
@@ -795,6 +795,7 @@ static bool_t __init set_iommu_interrupt
 static void enable_iommu(struct amd_iommu *iommu)
 {
     unsigned long flags;
+    struct irq_desc *desc;
 
     spin_lock_irqsave(&iommu->lock, flags);
 
@@ -812,7 +813,11 @@ static void enable_iommu(struct amd_iomm
     if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         register_iommu_ppr_log_in_mmio_space(iommu);
 
-    set_msi_affinity(irq_to_desc(iommu->msi.irq), &cpu_online_map);
+    desc = irq_to_desc(iommu->msi.irq);
+    spin_lock(&desc->lock);
+    set_msi_affinity(desc, &cpu_online_map);
+    spin_unlock(&desc->lock);
+
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
 
     set_iommu_ht_flags(iommu);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHK-00074h-4r; Tue, 04 Dec 2012 00:22:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHI-00070Z-F6
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:24 +0000
Received: from [85.158.143.35:26166] by server-3.bemta-4.messagelabs.com id
	D5/4B-06841-0424DB05; Tue, 04 Dec 2012 00:22:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1354580542!14708912!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4490 invoked from network); 4 Dec 2012 00:22:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHG-0007Gb-4K
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHG-0008Qm-2h
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:22 +0000
Message-Id: <E1TfgHG-0008Qm-2h@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Enable build without
	CONFIG_DTB_FILE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354278021 0
# Node ID d11ef8a27f5e2625f94fa9658b602043f46f4f75
# Parent  a7b0a7cf62e109db00b91f8ae7134da52956df9b
arm: Enable build without CONFIG_DTB_FILE

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r a7b0a7cf62e1 -r d11ef8a27f5e xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Fri Nov 30 11:42:55 2012 +0100
+++ b/xen/arch/arm/Makefile	Fri Nov 30 12:20:21 2012 +0000
@@ -34,10 +34,6 @@ obj-y += hvm.o
 ifdef CONFIG_DTB_FILE
 obj-y += dtb.o
 AFLAGS += -DCONFIG_DTB_FILE=\"$(CONFIG_DTB_FILE)\"
-else
-# XXX: When running on the model there is no bootloader to provide a
-# device tree.  It must be linked into Xen.
-$(error CONFIG_DTB_FILE must be set to the absolute filename of a DTB)
 endif
 
 ALL_OBJS := head.o $(ALL_OBJS)
diff -r a7b0a7cf62e1 -r d11ef8a27f5e xen/arch/arm/xen.lds.S
--- a/xen/arch/arm/xen.lds.S	Fri Nov 30 11:42:55 2012 +0100
+++ b/xen/arch/arm/xen.lds.S	Fri Nov 30 12:20:21 2012 +0000
@@ -123,9 +123,11 @@ SECTIONS
   } :text
   _end = . ;
 
+#ifdef CONFIG_DTB_FILE
   /* Section for the device tree blob (if any). */
   _sdtb = .;
   .dtb : { *(.dtb) } :text
+#endif
 
   /* Sections to be discarded */
   /DISCARD/ : {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHK-00074h-4r; Tue, 04 Dec 2012 00:22:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHI-00070Z-F6
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:24 +0000
Received: from [85.158.143.35:26166] by server-3.bemta-4.messagelabs.com id
	D5/4B-06841-0424DB05; Tue, 04 Dec 2012 00:22:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1354580542!14708912!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4490 invoked from network); 4 Dec 2012 00:22:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHG-0007Gb-4K
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHG-0008Qm-2h
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:22 +0000
Message-Id: <E1TfgHG-0008Qm-2h@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Enable build without
	CONFIG_DTB_FILE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354278021 0
# Node ID d11ef8a27f5e2625f94fa9658b602043f46f4f75
# Parent  a7b0a7cf62e109db00b91f8ae7134da52956df9b
arm: Enable build without CONFIG_DTB_FILE

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r a7b0a7cf62e1 -r d11ef8a27f5e xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Fri Nov 30 11:42:55 2012 +0100
+++ b/xen/arch/arm/Makefile	Fri Nov 30 12:20:21 2012 +0000
@@ -34,10 +34,6 @@ obj-y += hvm.o
 ifdef CONFIG_DTB_FILE
 obj-y += dtb.o
 AFLAGS += -DCONFIG_DTB_FILE=\"$(CONFIG_DTB_FILE)\"
-else
-# XXX: When running on the model there is no bootloader to provide a
-# device tree.  It must be linked into Xen.
-$(error CONFIG_DTB_FILE must be set to the absolute filename of a DTB)
 endif
 
 ALL_OBJS := head.o $(ALL_OBJS)
diff -r a7b0a7cf62e1 -r d11ef8a27f5e xen/arch/arm/xen.lds.S
--- a/xen/arch/arm/xen.lds.S	Fri Nov 30 11:42:55 2012 +0100
+++ b/xen/arch/arm/xen.lds.S	Fri Nov 30 12:20:21 2012 +0000
@@ -123,9 +123,11 @@ SECTIONS
   } :text
   _end = . ;
 
+#ifdef CONFIG_DTB_FILE
   /* Section for the device tree blob (if any). */
   _sdtb = .;
   .dtb : { *(.dtb) } :text
+#endif
 
   /* Sections to be discarded */
   /DISCARD/ : {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHK-00074U-2W; Tue, 04 Dec 2012 00:22:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHI-000712-0U
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:24 +0000
Received: from [85.158.139.211:37628] by server-2.bemta-5.messagelabs.com id
	87/61-04892-F324DB05; Tue, 04 Dec 2012 00:22:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354580541!18943658!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12199 invoked from network); 4 Dec 2012 00:22:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHF-0007GQ-2R
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHF-0008QI-0g
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:21 +0000
Message-Id: <E1TfgHF-0008QI-0g@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add gtags and tags rune in gitignore.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1354268609 0
# Node ID f3b6af40e79e1b28cef0225c76874001dfa33bc8
# Parent  69ff13e8c17df1789ed0049a86fbfb6aff11a041
Add gtags and tags rune in gitignore.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 69ff13e8c17d -r f3b6af40e79e .gitignore
--- a/.gitignore	Fri Nov 30 09:37:13 2012 +0000
+++ b/.gitignore	Fri Nov 30 09:43:29 2012 +0000
@@ -14,6 +14,11 @@
 *.spot
 *.spit
 TAGS
+GTAGS
+GRTAGS
+GPATH
+GSYMS
+tags
 cscope.files
 cscope.in.out
 cscope.out

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHK-00074U-2W; Tue, 04 Dec 2012 00:22:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHI-000712-0U
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:24 +0000
Received: from [85.158.139.211:37628] by server-2.bemta-5.messagelabs.com id
	87/61-04892-F324DB05; Tue, 04 Dec 2012 00:22:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-206.messagelabs.com!1354580541!18943658!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12199 invoked from network); 4 Dec 2012 00:22:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHF-0007GQ-2R
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHF-0008QI-0g
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:21 +0000
Message-Id: <E1TfgHF-0008QI-0g@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add gtags and tags rune in gitignore.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1354268609 0
# Node ID f3b6af40e79e1b28cef0225c76874001dfa33bc8
# Parent  69ff13e8c17df1789ed0049a86fbfb6aff11a041
Add gtags and tags rune in gitignore.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 69ff13e8c17d -r f3b6af40e79e .gitignore
--- a/.gitignore	Fri Nov 30 09:37:13 2012 +0000
+++ b/.gitignore	Fri Nov 30 09:43:29 2012 +0000
@@ -14,6 +14,11 @@
 *.spot
 *.spit
 TAGS
+GTAGS
+GRTAGS
+GPATH
+GSYMS
+tags
 cscope.files
 cscope.in.out
 cscope.out

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHM-000789-BO; Tue, 04 Dec 2012 00:22:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHK-000746-8q
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:26 +0000
Received: from [85.158.137.99:14740] by server-10.bemta-3.messagelabs.com id
	38/00-19806-1424DB05; Tue, 04 Dec 2012 00:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354580543!17768647!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 726 invoked from network); 4 Dec 2012 00:22:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-0007Gy-4z
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-0008RG-3U
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:23 +0000
Message-Id: <E1TfgHH-0008RG-3U@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: handle xenheap which isn't at
	the start of RAM.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354278022 0
# Node ID ee9c6e49f20aa6cfbd2f8e33a441496a4843f725
# Parent  88a6381a4f2a6378767942cfc6e9a5abf46bf08b
arm: handle xenheap which isn't at the start of RAM.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 88a6381a4f2a -r ee9c6e49f20a xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Fri Nov 30 12:20:22 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Fri Nov 30 12:20:22 2012 +0000
@@ -214,17 +214,15 @@ static inline struct page_info *virt_to_
     ASSERT(va >= XENHEAP_VIRT_START);
     ASSERT(va < xenheap_virt_end);
 
-    return frame_table + ((va - XENHEAP_VIRT_START) >> PAGE_SHIFT);
+    return frame_table
+        + ((va - XENHEAP_VIRT_START) >> PAGE_SHIFT)
+        + xenheap_mfn_start
+        - frametable_base_mfn;
 }
 
 static inline void *page_to_virt(const struct page_info *pg)
 {
-    ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < frametable_virt_end);
-    return (void *)(XENHEAP_VIRT_START +
-                    ((unsigned long)pg - FRAMETABLE_VIRT_START) /
-                    (sizeof(*pg) / (sizeof(*pg) & -sizeof(*pg))) *
-                    (PAGE_SIZE / (sizeof(*pg) & -sizeof(*pg))));
-
+    return mfn_to_virt(page_to_mfn(pg));
 }
 
 struct domain *page_get_owner_and_reference(struct page_info *page);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHM-000789-BO; Tue, 04 Dec 2012 00:22:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHK-000746-8q
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:26 +0000
Received: from [85.158.137.99:14740] by server-10.bemta-3.messagelabs.com id
	38/00-19806-1424DB05; Tue, 04 Dec 2012 00:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354580543!17768647!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 726 invoked from network); 4 Dec 2012 00:22:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-0007Gy-4z
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-0008RG-3U
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:23 +0000
Message-Id: <E1TfgHH-0008RG-3U@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: handle xenheap which isn't at
	the start of RAM.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354278022 0
# Node ID ee9c6e49f20aa6cfbd2f8e33a441496a4843f725
# Parent  88a6381a4f2a6378767942cfc6e9a5abf46bf08b
arm: handle xenheap which isn't at the start of RAM.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 88a6381a4f2a -r ee9c6e49f20a xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Fri Nov 30 12:20:22 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Fri Nov 30 12:20:22 2012 +0000
@@ -214,17 +214,15 @@ static inline struct page_info *virt_to_
     ASSERT(va >= XENHEAP_VIRT_START);
     ASSERT(va < xenheap_virt_end);
 
-    return frame_table + ((va - XENHEAP_VIRT_START) >> PAGE_SHIFT);
+    return frame_table
+        + ((va - XENHEAP_VIRT_START) >> PAGE_SHIFT)
+        + xenheap_mfn_start
+        - frametable_base_mfn;
 }
 
 static inline void *page_to_virt(const struct page_info *pg)
 {
-    ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < frametable_virt_end);
-    return (void *)(XENHEAP_VIRT_START +
-                    ((unsigned long)pg - FRAMETABLE_VIRT_START) /
-                    (sizeof(*pg) / (sizeof(*pg) & -sizeof(*pg))) *
-                    (PAGE_SIZE / (sizeof(*pg) & -sizeof(*pg))));
-
+    return mfn_to_virt(page_to_mfn(pg));
 }
 
 struct domain *page_get_owner_and_reference(struct page_info *page);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHM-00078K-EF; Tue, 04 Dec 2012 00:22:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHK-000746-OU
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:26 +0000
Received: from [85.158.138.51:21488] by server-10.bemta-3.messagelabs.com id
	F8/00-19806-1424DB05; Tue, 04 Dec 2012 00:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354580543!28529315!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5963 invoked from network); 4 Dec 2012 00:22:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-0007HD-L8
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-0008RV-Jc
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:23 +0000
Message-Id: <E1TfgHH-0008RV-Jc@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: const-correctness in
	virt_to_maddr
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354278023 0
# Node ID 8037099671f30824f3d7f229f223e1e7fbf12d0f
# Parent  ee9c6e49f20aa6cfbd2f8e33a441496a4843f725
arm: const-correctness in virt_to_maddr

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ee9c6e49f20a -r 8037099671f3 xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Fri Nov 30 12:20:22 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Fri Nov 30 12:20:23 2012 +0000
@@ -179,7 +179,7 @@ extern void clear_fixmap(unsigned map);
 #define paddr_to_pdx(pa)    pfn_to_pdx(paddr_to_pfn(pa))
 
 
-static inline paddr_t virt_to_maddr(void *va)
+static inline paddr_t virt_to_maddr(const void *va)
 {
     uint64_t par = va_to_par((uint32_t)va);
     return (par & PADDR_MASK & PAGE_MASK) | ((unsigned long) va & ~PAGE_MASK);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHM-00078K-EF; Tue, 04 Dec 2012 00:22:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHK-000746-OU
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:26 +0000
Received: from [85.158.138.51:21488] by server-10.bemta-3.messagelabs.com id
	F8/00-19806-1424DB05; Tue, 04 Dec 2012 00:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1354580543!28529315!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5963 invoked from network); 4 Dec 2012 00:22:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-0007HD-L8
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHH-0008RV-Jc
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:23 +0000
Message-Id: <E1TfgHH-0008RV-Jc@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: const-correctness in
	virt_to_maddr
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354278023 0
# Node ID 8037099671f30824f3d7f229f223e1e7fbf12d0f
# Parent  ee9c6e49f20aa6cfbd2f8e33a441496a4843f725
arm: const-correctness in virt_to_maddr

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ee9c6e49f20a -r 8037099671f3 xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Fri Nov 30 12:20:22 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Fri Nov 30 12:20:23 2012 +0000
@@ -179,7 +179,7 @@ extern void clear_fixmap(unsigned map);
 #define paddr_to_pdx(pa)    pfn_to_pdx(paddr_to_pfn(pa))
 
 
-static inline paddr_t virt_to_maddr(void *va)
+static inline paddr_t virt_to_maddr(const void *va)
 {
     uint64_t par = va_to_par((uint32_t)va);
     return (par & PADDR_MASK & PAGE_MASK) | ((unsigned long) va & ~PAGE_MASK);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHM-00078T-HT; Tue, 04 Dec 2012 00:22:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHK-000745-Ps
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:26 +0000
Received: from [193.109.254.147:24259] by server-9.bemta-14.messagelabs.com id
	7A/AA-30773-1424DB05; Tue, 04 Dec 2012 00:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1354580544!8854458!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 340 invoked from network); 4 Dec 2012 00:22:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHI-0007HJ-4r
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHI-0008Rk-3N
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:24 +0000
Message-Id: <E1TfgHI-0008Rk-3N@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] mini-os: shutdown_thread depends on
	xenbus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1354312277 0
# Node ID 29247e44df47d46c21beebdfcea6b3fba7480dff
# Parent  8037099671f30824f3d7f229f223e1e7fbf12d0f
mini-os: shutdown_thread depends on xenbus

This fixes the build of the xenstore stub domain, which should never
be shut down and so does not need this feature.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 8037099671f3 -r 29247e44df47 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c	Fri Nov 30 12:20:23 2012 +0000
+++ b/extras/mini-os/kernel.c	Fri Nov 30 21:51:17 2012 +0000
@@ -68,6 +68,7 @@ void setup_xen_features(void)
     }
 }
 
+#ifdef CONFIG_XENBUS
 static void shutdown_thread(void *p)
 {
     const char *path = "control/shutdown";
@@ -96,6 +97,7 @@ static void shutdown_thread(void *p)
     wmb();
     wake_up(&shutdown_queue);
 }
+#endif
 
 
 /* This should be overridden by the application we are linked against. */
@@ -160,7 +162,9 @@ void start_kernel(start_info_t *si)
     /* Init XenBus */
     init_xenbus();
 
+#ifdef CONFIG_XENBUS
     create_thread("shutdown", shutdown_thread, NULL);
+#endif
 
     /* Call (possibly overridden) app_main() */
     app_main(&start_info);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHM-00078T-HT; Tue, 04 Dec 2012 00:22:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHK-000745-Ps
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:26 +0000
Received: from [193.109.254.147:24259] by server-9.bemta-14.messagelabs.com id
	7A/AA-30773-1424DB05; Tue, 04 Dec 2012 00:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1354580544!8854458!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 340 invoked from network); 4 Dec 2012 00:22:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHI-0007HJ-4r
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHI-0008Rk-3N
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:24 +0000
Message-Id: <E1TfgHI-0008Rk-3N@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] mini-os: shutdown_thread depends on
	xenbus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1354312277 0
# Node ID 29247e44df47d46c21beebdfcea6b3fba7480dff
# Parent  8037099671f30824f3d7f229f223e1e7fbf12d0f
mini-os: shutdown_thread depends on xenbus

This fixes the build of the xenstore stub domain, which should never
be shut down and so does not need this feature.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 8037099671f3 -r 29247e44df47 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c	Fri Nov 30 12:20:23 2012 +0000
+++ b/extras/mini-os/kernel.c	Fri Nov 30 21:51:17 2012 +0000
@@ -68,6 +68,7 @@ void setup_xen_features(void)
     }
 }
 
+#ifdef CONFIG_XENBUS
 static void shutdown_thread(void *p)
 {
     const char *path = "control/shutdown";
@@ -96,6 +97,7 @@ static void shutdown_thread(void *p)
     wmb();
     wake_up(&shutdown_queue);
 }
+#endif
 
 
 /* This should be overridden by the application we are linked against. */
@@ -160,7 +162,9 @@ void start_kernel(start_info_t *si)
     /* Init XenBus */
     init_xenbus();
 
+#ifdef CONFIG_XENBUS
     create_thread("shutdown", shutdown_thread, NULL);
+#endif
 
     /* Call (possibly overridden) app_main() */
     app_main(&start_info);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHM-00078n-M2; Tue, 04 Dec 2012 00:22:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHK-00074g-L6
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:26 +0000
Received: from [85.158.139.211:37700] by server-16.bemta-5.messagelabs.com id
	42/4F-21311-1424DB05; Tue, 04 Dec 2012 00:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1354580540!18923445!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30734 invoked from network); 4 Dec 2012 00:22:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0007GK-0O
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHD-0008Po-Ut
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:19 +0000
Message-Id: <E1TfgHD-0008Po-Ut@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] [minios] Add xenbus shutdown control
	support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Samuel Thibault <samuel.thibault@ens-lyon.org>
# Date 1354267947 0
# Node ID 07396f4fb4766df322f1cafc1175ecab22c6f4af
# Parent  eb3bf80d8dac0b4cd2eed227245aa469baf5ca5b
[minios] Add xenbus shutdown control support

Add a thread watching the xenbus shutdown control path and notifies a
wait queue.

Add HYPERVISOR_shutdown convenient inline for minios shutdown.

Add proper shutdown to the minios test application.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r eb3bf80d8dac -r 07396f4fb476 extras/mini-os/include/kernel.h
--- a/extras/mini-os/include/kernel.h	Fri Nov 30 09:31:58 2012 +0000
+++ b/extras/mini-os/include/kernel.h	Fri Nov 30 09:32:27 2012 +0000
@@ -1,6 +1,9 @@
 #ifndef _KERNEL_H_
 #define _KERNEL_H_
 
+extern unsigned int do_shutdown;
+extern unsigned int shutdown_reason;
+extern struct wait_queue_head shutdown_queue;
 extern void do_exit(void) __attribute__((noreturn));
 extern void stop_kernel(void);
 
diff -r eb3bf80d8dac -r 07396f4fb476 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
--- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Fri Nov 30 09:31:58 2012 +0000
+++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Fri Nov 30 09:32:27 2012 +0000
@@ -172,6 +172,14 @@ HYPERVISOR_sched_op(
 	return _hypercall2(int, sched_op, cmd, arg);
 }
 
+static inline int
+HYPERVISOR_shutdown(
+	unsigned int reason)
+{
+	struct sched_shutdown shutdown = { .reason = reason };
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
 	uint64_t timeout)
diff -r eb3bf80d8dac -r 07396f4fb476 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
--- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Fri Nov 30 09:31:58 2012 +0000
+++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Fri Nov 30 09:32:27 2012 +0000
@@ -176,6 +176,14 @@ HYPERVISOR_sched_op(
 	return _hypercall2(int, sched_op, cmd, arg);
 }
 
+static inline int
+HYPERVISOR_shutdown(
+	unsigned int reason)
+{
+	struct sched_shutdown shutdown = { .reason = reason };
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
 	uint64_t timeout)
diff -r eb3bf80d8dac -r 07396f4fb476 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c	Fri Nov 30 09:31:58 2012 +0000
+++ b/extras/mini-os/kernel.c	Fri Nov 30 09:32:27 2012 +0000
@@ -48,6 +48,10 @@
 
 uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
 
+unsigned int do_shutdown = 0;
+unsigned int shutdown_reason;
+DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
+
 void setup_xen_features(void)
 {
     xen_feature_info_t fi;
@@ -64,6 +68,36 @@ void setup_xen_features(void)
     }
 }
 
+static void shutdown_thread(void *p)
+{
+    const char *path = "control/shutdown";
+    const char *token = path;
+    xenbus_event_queue events = NULL;
+    char *shutdown, *err;
+    xenbus_watch_path_token(XBT_NIL, path, token, &events);
+    while ((err = xenbus_read(XBT_NIL, path, &shutdown)) != NULL)
+    {
+        free(err);
+        xenbus_wait_for_watch(&events);
+    }
+    xenbus_unwatch_path_token(XBT_NIL, path, token);
+    xenbus_write(XBT_NIL, path, "");
+    printk("Shutting down (%s)\n", shutdown);
+
+    if (!strcmp(shutdown, "poweroff"))
+        shutdown_reason = SHUTDOWN_poweroff;
+    else if (!strcmp(shutdown, "reboot"))
+        shutdown_reason = SHUTDOWN_reboot;
+    else
+        /* Unknown */
+        shutdown_reason = SHUTDOWN_crash;
+    wmb();
+    do_shutdown = 1;
+    wmb();
+    wake_up(&shutdown_queue);
+}
+
+
 /* This should be overridden by the application we are linked against. */
 __attribute__((weak)) int app_main(start_info_t *si)
 {
@@ -126,6 +160,8 @@ void start_kernel(start_info_t *si)
     /* Init XenBus */
     init_xenbus();
 
+    create_thread("shutdown", shutdown_thread, NULL);
+
     /* Call (possibly overridden) app_main() */
     app_main(&start_info);
 
diff -r eb3bf80d8dac -r 07396f4fb476 extras/mini-os/test.c
--- a/extras/mini-os/test.c	Fri Nov 30 09:31:58 2012 +0000
+++ b/extras/mini-os/test.c	Fri Nov 30 09:32:27 2012 +0000
@@ -46,6 +46,7 @@
 #include <xen/version.h>
 
 static struct netfront_dev *net_dev;
+static struct semaphore net_sem = __SEMAPHORE_INITIALIZER(net_sem, 0);
 
 void test_xenbus(void);
 
@@ -70,12 +71,14 @@ static void periodic_thread(void *p)
 static void netfront_thread(void *p)
 {
     net_dev = init_netfront(NULL, NULL, NULL, NULL);
+    up(&net_sem);
 }
 
 static struct blkfront_dev *blk_dev;
 static struct blkfront_info blk_info;
 static uint64_t blk_size_read;
 static uint64_t blk_size_write;
+static struct semaphore blk_sem = __SEMAPHORE_INITIALIZER(blk_sem, 0);;
 
 struct blk_req {
     struct blkfront_aiocb aiocb;
@@ -189,8 +192,10 @@ static void blkfront_thread(void *p)
     time_t lasttime = 0;
 
     blk_dev = init_blkfront(NULL, &blk_info);
-    if (!blk_dev)
+    if (!blk_dev) {
+        up(&blk_sem);
         return;
+    }
 
     if (blk_info.info & VDISK_CDROM)
         printk("Block device is a CDROM\n");
@@ -210,7 +215,7 @@ static void blkfront_thread(void *p)
         blk_read_sector(blk_info.sectors-1);
     }
 
-    while (1) {
+    while (!do_shutdown) {
         uint64_t sector = rand() % blk_info.sectors;
         struct timeval tv;
 #ifdef BLKTEST_WRITE
@@ -235,6 +240,7 @@ static void blkfront_thread(void *p)
         }
 #endif
     }
+    up(&blk_sem);
 }
 
 #define WIDTH 800
@@ -293,7 +299,6 @@ static void fbfront_thread(void *p)
     xfree(mfns);
     if (!fb_dev) {
         xfree(fb);
-        return;
     }
     up(&fbfront_sem);
 }
@@ -330,17 +335,21 @@ static void refresh_cursor(int new_x, in
 }
 
 static struct kbdfront_dev *kbd_dev;
+static struct semaphore kbd_sem = __SEMAPHORE_INITIALIZER(kbd_sem, 0);
 static void kbdfront_thread(void *p)
 {
     DEFINE_WAIT(w);
     DEFINE_WAIT(w2);
+    DEFINE_WAIT(w3);
     int x = WIDTH / 2, y = HEIGHT / 2, z = 0;
 
     kbd_dev = init_kbdfront(NULL, 1);
-    if (!kbd_dev)
+    down(&fbfront_sem);
+    if (!kbd_dev) {
+        up(&kbd_sem);
         return;
+    }
 
-    down(&fbfront_sem);
     refresh_cursor(x, y);
     while (1) {
         union xenkbd_in_event kbdevent;
@@ -349,6 +358,11 @@ static void kbdfront_thread(void *p)
 
         add_waiter(w, kbdfront_queue);
         add_waiter(w2, fbfront_queue);
+        add_waiter(w3, shutdown_queue);
+
+        rmb();
+        if (do_shutdown)
+            break;
 
         while (kbdfront_receive(kbd_dev, &kbdevent, 1) != 0) {
             sleep = 0;
@@ -391,9 +405,11 @@ static void kbdfront_thread(void *p)
                         fbfront_update(fb_dev, x - 16, y - 16, 33, 33);
                     }
                 } else if (kbdevent.key.keycode == KEY_Q) {
-                    struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_poweroff };
-                    HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
-                    do_exit();
+                    shutdown_reason = SHUTDOWN_poweroff;
+                    wmb();
+                    do_shutdown = 1;
+                    wmb();
+                    wake_up(&shutdown_queue);
                 }
                 break;
             }
@@ -410,11 +426,16 @@ static void kbdfront_thread(void *p)
         }
         if (sleep)
             schedule();
+        remove_waiter(w3, shutdown_queue);
+        remove_waiter(w2, fbfront_queue);
+        remove_waiter(w, kbdfront_queue);
     }
+    up(&kbd_sem);
 }
 
 #ifdef CONFIG_PCIFRONT
 static struct pcifront_dev *pci_dev;
+static struct semaphore pci_sem = __SEMAPHORE_INITIALIZER(pci_sem, 0);
 
 static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
 {
@@ -432,13 +453,60 @@ static void pcifront_thread(void *p)
 {
     pcifront_watches(NULL);
     pci_dev = init_pcifront(NULL);
-    if (!pci_dev)
+    if (!pci_dev) {
+        up(&pci_sem);
         return;
+    }
     printk("PCI devices:\n");
     pcifront_scan(pci_dev, print_pcidev);
+    up(&pci_sem);
 }
 #endif
 
+void shutdown_frontends(void)
+{
+    down(&net_sem);
+    if (net_dev)
+        shutdown_netfront(net_dev);
+
+    down(&blk_sem);
+    if (blk_dev)
+        shutdown_blkfront(blk_dev);
+
+    if (fb_dev)
+        shutdown_fbfront(fb_dev);
+
+    down(&kbd_sem);
+    if (kbd_dev)
+        shutdown_kbdfront(kbd_dev);
+
+#ifdef CONFIG_PCIFRONT
+    down(&pci_sem);
+    if (pci_dev)
+        shutdown_pcifront(pci_dev);
+#endif
+}
+
+static void shutdown_thread(void *p)
+{
+    DEFINE_WAIT(w);
+
+    while (1) {
+        add_waiter(w, shutdown_queue);
+        rmb();
+        if (do_shutdown) {
+            rmb();
+            break;
+        }
+        schedule();
+        remove_waiter(w, shutdown_queue);
+    }
+
+    shutdown_frontends();
+
+    HYPERVISOR_shutdown(shutdown_reason);
+}
+
 int app_main(start_info_t *si)
 {
     printk("Test main: start_info=%p\n", si);
@@ -451,25 +519,6 @@ int app_main(start_info_t *si)
 #ifdef CONFIG_PCIFRONT
     create_thread("pcifront", pcifront_thread, si);
 #endif
+    create_thread("shutdown", shutdown_thread, si);
     return 0;
 }
-
-void shutdown_frontends(void)
-{
-    if (net_dev)
-        shutdown_netfront(net_dev);
-
-    if (blk_dev)
-        shutdown_blkfront(blk_dev);
-
-    if (fb_dev)
-        shutdown_fbfront(fb_dev);
-
-    if (kbd_dev)
-        shutdown_kbdfront(kbd_dev);
-
-#ifdef CONFIG_PCIFRONT
-    if (pci_dev)
-        shutdown_pcifront(pci_dev);
-#endif
-}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHM-00078n-M2; Tue, 04 Dec 2012 00:22:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHK-00074g-L6
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:26 +0000
Received: from [85.158.139.211:37700] by server-16.bemta-5.messagelabs.com id
	42/4F-21311-1424DB05; Tue, 04 Dec 2012 00:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1354580540!18923445!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30734 invoked from network); 4 Dec 2012 00:22:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHE-0007GK-0O
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHD-0008Po-Ut
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:19 +0000
Message-Id: <E1TfgHD-0008Po-Ut@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] [minios] Add xenbus shutdown control
	support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Samuel Thibault <samuel.thibault@ens-lyon.org>
# Date 1354267947 0
# Node ID 07396f4fb4766df322f1cafc1175ecab22c6f4af
# Parent  eb3bf80d8dac0b4cd2eed227245aa469baf5ca5b
[minios] Add xenbus shutdown control support

Add a thread watching the xenbus shutdown control path and notifies a
wait queue.

Add HYPERVISOR_shutdown convenient inline for minios shutdown.

Add proper shutdown to the minios test application.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r eb3bf80d8dac -r 07396f4fb476 extras/mini-os/include/kernel.h
--- a/extras/mini-os/include/kernel.h	Fri Nov 30 09:31:58 2012 +0000
+++ b/extras/mini-os/include/kernel.h	Fri Nov 30 09:32:27 2012 +0000
@@ -1,6 +1,9 @@
 #ifndef _KERNEL_H_
 #define _KERNEL_H_
 
+extern unsigned int do_shutdown;
+extern unsigned int shutdown_reason;
+extern struct wait_queue_head shutdown_queue;
 extern void do_exit(void) __attribute__((noreturn));
 extern void stop_kernel(void);
 
diff -r eb3bf80d8dac -r 07396f4fb476 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
--- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Fri Nov 30 09:31:58 2012 +0000
+++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Fri Nov 30 09:32:27 2012 +0000
@@ -172,6 +172,14 @@ HYPERVISOR_sched_op(
 	return _hypercall2(int, sched_op, cmd, arg);
 }
 
+static inline int
+HYPERVISOR_shutdown(
+	unsigned int reason)
+{
+	struct sched_shutdown shutdown = { .reason = reason };
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
 	uint64_t timeout)
diff -r eb3bf80d8dac -r 07396f4fb476 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
--- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Fri Nov 30 09:31:58 2012 +0000
+++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Fri Nov 30 09:32:27 2012 +0000
@@ -176,6 +176,14 @@ HYPERVISOR_sched_op(
 	return _hypercall2(int, sched_op, cmd, arg);
 }
 
+static inline int
+HYPERVISOR_shutdown(
+	unsigned int reason)
+{
+	struct sched_shutdown shutdown = { .reason = reason };
+	return _hypercall2(int, sched_op, SCHEDOP_shutdown, &shutdown);
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
 	uint64_t timeout)
diff -r eb3bf80d8dac -r 07396f4fb476 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c	Fri Nov 30 09:31:58 2012 +0000
+++ b/extras/mini-os/kernel.c	Fri Nov 30 09:32:27 2012 +0000
@@ -48,6 +48,10 @@
 
 uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
 
+unsigned int do_shutdown = 0;
+unsigned int shutdown_reason;
+DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
+
 void setup_xen_features(void)
 {
     xen_feature_info_t fi;
@@ -64,6 +68,36 @@ void setup_xen_features(void)
     }
 }
 
+static void shutdown_thread(void *p)
+{
+    const char *path = "control/shutdown";
+    const char *token = path;
+    xenbus_event_queue events = NULL;
+    char *shutdown, *err;
+    xenbus_watch_path_token(XBT_NIL, path, token, &events);
+    while ((err = xenbus_read(XBT_NIL, path, &shutdown)) != NULL)
+    {
+        free(err);
+        xenbus_wait_for_watch(&events);
+    }
+    xenbus_unwatch_path_token(XBT_NIL, path, token);
+    xenbus_write(XBT_NIL, path, "");
+    printk("Shutting down (%s)\n", shutdown);
+
+    if (!strcmp(shutdown, "poweroff"))
+        shutdown_reason = SHUTDOWN_poweroff;
+    else if (!strcmp(shutdown, "reboot"))
+        shutdown_reason = SHUTDOWN_reboot;
+    else
+        /* Unknown */
+        shutdown_reason = SHUTDOWN_crash;
+    wmb();
+    do_shutdown = 1;
+    wmb();
+    wake_up(&shutdown_queue);
+}
+
+
 /* This should be overridden by the application we are linked against. */
 __attribute__((weak)) int app_main(start_info_t *si)
 {
@@ -126,6 +160,8 @@ void start_kernel(start_info_t *si)
     /* Init XenBus */
     init_xenbus();
 
+    create_thread("shutdown", shutdown_thread, NULL);
+
     /* Call (possibly overridden) app_main() */
     app_main(&start_info);
 
diff -r eb3bf80d8dac -r 07396f4fb476 extras/mini-os/test.c
--- a/extras/mini-os/test.c	Fri Nov 30 09:31:58 2012 +0000
+++ b/extras/mini-os/test.c	Fri Nov 30 09:32:27 2012 +0000
@@ -46,6 +46,7 @@
 #include <xen/version.h>
 
 static struct netfront_dev *net_dev;
+static struct semaphore net_sem = __SEMAPHORE_INITIALIZER(net_sem, 0);
 
 void test_xenbus(void);
 
@@ -70,12 +71,14 @@ static void periodic_thread(void *p)
 static void netfront_thread(void *p)
 {
     net_dev = init_netfront(NULL, NULL, NULL, NULL);
+    up(&net_sem);
 }
 
 static struct blkfront_dev *blk_dev;
 static struct blkfront_info blk_info;
 static uint64_t blk_size_read;
 static uint64_t blk_size_write;
+static struct semaphore blk_sem = __SEMAPHORE_INITIALIZER(blk_sem, 0);;
 
 struct blk_req {
     struct blkfront_aiocb aiocb;
@@ -189,8 +192,10 @@ static void blkfront_thread(void *p)
     time_t lasttime = 0;
 
     blk_dev = init_blkfront(NULL, &blk_info);
-    if (!blk_dev)
+    if (!blk_dev) {
+        up(&blk_sem);
         return;
+    }
 
     if (blk_info.info & VDISK_CDROM)
         printk("Block device is a CDROM\n");
@@ -210,7 +215,7 @@ static void blkfront_thread(void *p)
         blk_read_sector(blk_info.sectors-1);
     }
 
-    while (1) {
+    while (!do_shutdown) {
         uint64_t sector = rand() % blk_info.sectors;
         struct timeval tv;
 #ifdef BLKTEST_WRITE
@@ -235,6 +240,7 @@ static void blkfront_thread(void *p)
         }
 #endif
     }
+    up(&blk_sem);
 }
 
 #define WIDTH 800
@@ -293,7 +299,6 @@ static void fbfront_thread(void *p)
     xfree(mfns);
     if (!fb_dev) {
         xfree(fb);
-        return;
     }
     up(&fbfront_sem);
 }
@@ -330,17 +335,21 @@ static void refresh_cursor(int new_x, in
 }
 
 static struct kbdfront_dev *kbd_dev;
+static struct semaphore kbd_sem = __SEMAPHORE_INITIALIZER(kbd_sem, 0);
 static void kbdfront_thread(void *p)
 {
     DEFINE_WAIT(w);
     DEFINE_WAIT(w2);
+    DEFINE_WAIT(w3);
     int x = WIDTH / 2, y = HEIGHT / 2, z = 0;
 
     kbd_dev = init_kbdfront(NULL, 1);
-    if (!kbd_dev)
+    down(&fbfront_sem);
+    if (!kbd_dev) {
+        up(&kbd_sem);
         return;
+    }
 
-    down(&fbfront_sem);
     refresh_cursor(x, y);
     while (1) {
         union xenkbd_in_event kbdevent;
@@ -349,6 +358,11 @@ static void kbdfront_thread(void *p)
 
         add_waiter(w, kbdfront_queue);
         add_waiter(w2, fbfront_queue);
+        add_waiter(w3, shutdown_queue);
+
+        rmb();
+        if (do_shutdown)
+            break;
 
         while (kbdfront_receive(kbd_dev, &kbdevent, 1) != 0) {
             sleep = 0;
@@ -391,9 +405,11 @@ static void kbdfront_thread(void *p)
                         fbfront_update(fb_dev, x - 16, y - 16, 33, 33);
                     }
                 } else if (kbdevent.key.keycode == KEY_Q) {
-                    struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_poweroff };
-                    HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
-                    do_exit();
+                    shutdown_reason = SHUTDOWN_poweroff;
+                    wmb();
+                    do_shutdown = 1;
+                    wmb();
+                    wake_up(&shutdown_queue);
                 }
                 break;
             }
@@ -410,11 +426,16 @@ static void kbdfront_thread(void *p)
         }
         if (sleep)
             schedule();
+        remove_waiter(w3, shutdown_queue);
+        remove_waiter(w2, fbfront_queue);
+        remove_waiter(w, kbdfront_queue);
     }
+    up(&kbd_sem);
 }
 
 #ifdef CONFIG_PCIFRONT
 static struct pcifront_dev *pci_dev;
+static struct semaphore pci_sem = __SEMAPHORE_INITIALIZER(pci_sem, 0);
 
 static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
 {
@@ -432,13 +453,60 @@ static void pcifront_thread(void *p)
 {
     pcifront_watches(NULL);
     pci_dev = init_pcifront(NULL);
-    if (!pci_dev)
+    if (!pci_dev) {
+        up(&pci_sem);
         return;
+    }
     printk("PCI devices:\n");
     pcifront_scan(pci_dev, print_pcidev);
+    up(&pci_sem);
 }
 #endif
 
+void shutdown_frontends(void)
+{
+    down(&net_sem);
+    if (net_dev)
+        shutdown_netfront(net_dev);
+
+    down(&blk_sem);
+    if (blk_dev)
+        shutdown_blkfront(blk_dev);
+
+    if (fb_dev)
+        shutdown_fbfront(fb_dev);
+
+    down(&kbd_sem);
+    if (kbd_dev)
+        shutdown_kbdfront(kbd_dev);
+
+#ifdef CONFIG_PCIFRONT
+    down(&pci_sem);
+    if (pci_dev)
+        shutdown_pcifront(pci_dev);
+#endif
+}
+
+static void shutdown_thread(void *p)
+{
+    DEFINE_WAIT(w);
+
+    while (1) {
+        add_waiter(w, shutdown_queue);
+        rmb();
+        if (do_shutdown) {
+            rmb();
+            break;
+        }
+        schedule();
+        remove_waiter(w, shutdown_queue);
+    }
+
+    shutdown_frontends();
+
+    HYPERVISOR_shutdown(shutdown_reason);
+}
+
 int app_main(start_info_t *si)
 {
     printk("Test main: start_info=%p\n", si);
@@ -451,25 +519,6 @@ int app_main(start_info_t *si)
 #ifdef CONFIG_PCIFRONT
     create_thread("pcifront", pcifront_thread, si);
 #endif
+    create_thread("shutdown", shutdown_thread, si);
     return 0;
 }
-
-void shutdown_frontends(void)
-{
-    if (net_dev)
-        shutdown_netfront(net_dev);
-
-    if (blk_dev)
-        shutdown_blkfront(blk_dev);
-
-    if (fb_dev)
-        shutdown_fbfront(fb_dev);
-
-    if (kbd_dev)
-        shutdown_kbdfront(kbd_dev);
-
-#ifdef CONFIG_PCIFRONT
-    if (pci_dev)
-        shutdown_pcifront(pci_dev);
-#endif
-}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHM-00077z-8y; Tue, 04 Dec 2012 00:22:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHK-000745-8x
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:26 +0000
Received: from [193.109.254.147:24250] by server-9.bemta-14.messagelabs.com id
	D9/AA-30773-1424DB05; Tue, 04 Dec 2012 00:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354580539!8818474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 335 invoked from network); 4 Dec 2012 00:22:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHD-0007GH-G5
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHD-0008PZ-EF
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:19 +0000
Message-Id: <E1TfgHD-0008PZ-EF@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] [minios] Fix test application link
	when pcifront is not enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Samuel Thibault <samuel.thibault@ens-lyon.org>
# Date 1354267918 0
# Node ID eb3bf80d8dac0b4cd2eed227245aa469baf5ca5b
# Parent  0cf1f79bc4f880d5f961630d4f29119ac70139f0
[minios] Fix test application link when pcifront is not enabled

When pcifront is not enabled, the test application needs to disable
the PCI test.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 0cf1f79bc4f8 -r eb3bf80d8dac extras/mini-os/test.c
--- a/extras/mini-os/test.c	Fri Nov 30 09:26:30 2012 +0000
+++ b/extras/mini-os/test.c	Fri Nov 30 09:31:58 2012 +0000
@@ -413,6 +413,7 @@ static void kbdfront_thread(void *p)
     }
 }
 
+#ifdef CONFIG_PCIFRONT
 static struct pcifront_dev *pci_dev;
 
 static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
@@ -436,6 +437,7 @@ static void pcifront_thread(void *p)
     printk("PCI devices:\n");
     pcifront_scan(pci_dev, print_pcidev);
 }
+#endif
 
 int app_main(start_info_t *si)
 {
@@ -446,7 +448,9 @@ int app_main(start_info_t *si)
     create_thread("blkfront", blkfront_thread, si);
     create_thread("fbfront", fbfront_thread, si);
     create_thread("kbdfront", kbdfront_thread, si);
+#ifdef CONFIG_PCIFRONT
     create_thread("pcifront", pcifront_thread, si);
+#endif
     return 0;
 }
 
@@ -464,6 +468,8 @@ void shutdown_frontends(void)
     if (kbd_dev)
         shutdown_kbdfront(kbd_dev);
 
+#ifdef CONFIG_PCIFRONT
     if (pci_dev)
         shutdown_pcifront(pci_dev);
+#endif
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHM-00077z-8y; Tue, 04 Dec 2012 00:22:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHK-000745-8x
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:26 +0000
Received: from [193.109.254.147:24250] by server-9.bemta-14.messagelabs.com id
	D9/AA-30773-1424DB05; Tue, 04 Dec 2012 00:22:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1354580539!8818474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 335 invoked from network); 4 Dec 2012 00:22:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHD-0007GH-G5
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHD-0008PZ-EF
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:19 +0000
Message-Id: <E1TfgHD-0008PZ-EF@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] [minios] Fix test application link
	when pcifront is not enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Samuel Thibault <samuel.thibault@ens-lyon.org>
# Date 1354267918 0
# Node ID eb3bf80d8dac0b4cd2eed227245aa469baf5ca5b
# Parent  0cf1f79bc4f880d5f961630d4f29119ac70139f0
[minios] Fix test application link when pcifront is not enabled

When pcifront is not enabled, the test application needs to disable
the PCI test.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 0cf1f79bc4f8 -r eb3bf80d8dac extras/mini-os/test.c
--- a/extras/mini-os/test.c	Fri Nov 30 09:26:30 2012 +0000
+++ b/extras/mini-os/test.c	Fri Nov 30 09:31:58 2012 +0000
@@ -413,6 +413,7 @@ static void kbdfront_thread(void *p)
     }
 }
 
+#ifdef CONFIG_PCIFRONT
 static struct pcifront_dev *pci_dev;
 
 static void print_pcidev(unsigned int domain, unsigned int bus, unsigned int slot, unsigned int fun)
@@ -436,6 +437,7 @@ static void pcifront_thread(void *p)
     printk("PCI devices:\n");
     pcifront_scan(pci_dev, print_pcidev);
 }
+#endif
 
 int app_main(start_info_t *si)
 {
@@ -446,7 +448,9 @@ int app_main(start_info_t *si)
     create_thread("blkfront", blkfront_thread, si);
     create_thread("fbfront", fbfront_thread, si);
     create_thread("kbdfront", kbdfront_thread, si);
+#ifdef CONFIG_PCIFRONT
     create_thread("pcifront", pcifront_thread, si);
+#endif
     return 0;
 }
 
@@ -464,6 +468,8 @@ void shutdown_frontends(void)
     if (kbd_dev)
         shutdown_kbdfront(kbd_dev);
 
+#ifdef CONFIG_PCIFRONT
     if (pci_dev)
         shutdown_pcifront(pci_dev);
+#endif
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:36 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHT-0007IL-Uz; Tue, 04 Dec 2012 00:22:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHS-0007FZ-HB
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:34 +0000
Received: from [193.109.254.147:24459] by server-10.bemta-14.messagelabs.com
	id 92/AB-31741-9424DB05; Tue, 04 Dec 2012 00:22:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1354580542!8942931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7887 invoked from network); 4 Dec 2012 00:22:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHG-0007Gl-Ko
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHG-0008R1-JD
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:22 +0000
Message-Id: <E1TfgHG-0008R1-JD@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: create a raw binary target.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354278022 0
# Node ID 88a6381a4f2a6378767942cfc6e9a5abf46bf08b
# Parent  d11ef8a27f5e2625f94fa9658b602043f46f4f75
arm: create a raw binary target.

This is suitable for direct loading by a bootloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d11ef8a27f5e -r 88a6381a4f2a xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Fri Nov 30 12:20:21 2012 +0000
+++ b/xen/arch/arm/Makefile	Fri Nov 30 12:20:22 2012 +0000
@@ -38,12 +38,16 @@ endif
 
 ALL_OBJS := head.o $(ALL_OBJS)
 
-$(TARGET): $(TARGET)-syms
+$(TARGET): $(TARGET)-syms $(TARGET).bin
 	# XXX: VE model loads by VMA so instead of
 	# making a proper ELF we link with LMA == VMA and adjust crudely
 	$(OBJCOPY) --change-addresses +0x80000000 $< $@
 	$(STRIP) $@
 
+#
+$(TARGET).bin: $(TARGET)-syms
+	objcopy -O binary -S $< $@
+
 #$(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 #	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
 #	`$(NM) -nr $(TARGET)-syms | head -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 04 00:22:36 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 04 Dec 2012 00:22:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TfgHT-0007IL-Uz; Tue, 04 Dec 2012 00:22:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHS-0007FZ-HB
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:34 +0000
Received: from [193.109.254.147:24459] by server-10.bemta-14.messagelabs.com
	id 92/AB-31741-9424DB05; Tue, 04 Dec 2012 00:22:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1354580542!8942931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7887 invoked from network); 4 Dec 2012 00:22:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Dec 2012 00:22:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHG-0007Gl-Ko
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TfgHG-0008R1-JD
	for xen-changelog@lists.xensource.com; Tue, 04 Dec 2012 00:22:22 +0000
Message-Id: <E1TfgHG-0008R1-JD@xenbits.xen.org>
Date: Tue, 04 Dec 2012 00:22:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: create a raw binary target.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354278022 0
# Node ID 88a6381a4f2a6378767942cfc6e9a5abf46bf08b
# Parent  d11ef8a27f5e2625f94fa9658b602043f46f4f75
arm: create a raw binary target.

This is suitable for direct loading by a bootloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d11ef8a27f5e -r 88a6381a4f2a xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Fri Nov 30 12:20:21 2012 +0000
+++ b/xen/arch/arm/Makefile	Fri Nov 30 12:20:22 2012 +0000
@@ -38,12 +38,16 @@ endif
 
 ALL_OBJS := head.o $(ALL_OBJS)
 
-$(TARGET): $(TARGET)-syms
+$(TARGET): $(TARGET)-syms $(TARGET).bin
 	# XXX: VE model loads by VMA so instead of
 	# making a proper ELF we link with LMA == VMA and adjust crudely
 	$(OBJCOPY) --change-addresses +0x80000000 $< $@
 	$(STRIP) $@
 
+#
+$(TARGET).bin: $(TARGET)-syms
+	objcopy -O binary -S $< $@
+
 #$(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 #	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \
 #	`$(NM) -nr $(TARGET)-syms | head -n 1 | sed -e 's/^\([^ ]*\).*/0x\1/'`

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:36 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uA-0002CB-Ku; Wed, 05 Dec 2012 08:00:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u8-0002C4-K4
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:28 +0000
Received: from [85.158.137.99:28304] by server-5.bemta-3.messagelabs.com id
	A0/91-26311-B1FFEB05; Wed, 05 Dec 2012 08:00:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354694424!17663726!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22537 invoked from network); 5 Dec 2012 08:00:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u4-00019R-Ip
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9tz-0008Fy-3z
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:24 +0000
Message-Id: <E1Tg9tz-0008Fy-3z@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:18 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] libxl: fix a variable underflow
	in libxl_wait_for_free_memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ronny Hegewald <ronny.hegewald@online.de>
# Date 1354208383 0
# Node ID 9e13427c023020756768c73217dab05295709fb3
# Parent  b3dafd42268af1ea9558b536702841625dd52500
libxl: fix a variable underflow in libxl_wait_for_free_memory

When xl is called to create a domU and there is not enough memory available,
then the autoballooning is called to extract memory from dom0. During the
ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory
is available to create the domU.

But because of a variable-underflow the loop can finish too soon and xl
finally aborts with the message:

xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low memory for domain: Out of memory
libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: Device or resource busy
libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build domain: -3

The variable-underflow happens when freemem_slack is larger then
info.free_pages*4, because the solution of this operation is converted
implicit to a unsigned int to match the type of memory_kb.

Add a extra check for this condition to solve the problem.

Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26190:678718a2e565
Backport-requested-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r b3dafd42268a -r 9e13427c0230 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Nov 29 16:07:55 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Nov 29 16:59:43 2012 +0000
@@ -3592,7 +3592,8 @@ int libxl_wait_for_free_memory(libxl_ctx
         rc = libxl_get_physinfo(ctx, &info);
         if (rc < 0)
             goto out;
-        if (info.free_pages * 4 - freemem_slack >= memory_kb) {
+        if (info.free_pages * 4 >= freemem_slack &&
+            info.free_pages * 4 - freemem_slack >= memory_kb) {
             rc = 0;
             goto out;
         }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:36 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uA-0002CB-Ku; Wed, 05 Dec 2012 08:00:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u8-0002C4-K4
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:28 +0000
Received: from [85.158.137.99:28304] by server-5.bemta-3.messagelabs.com id
	A0/91-26311-B1FFEB05; Wed, 05 Dec 2012 08:00:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-217.messagelabs.com!1354694424!17663726!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22537 invoked from network); 5 Dec 2012 08:00:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u4-00019R-Ip
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9tz-0008Fy-3z
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:24 +0000
Message-Id: <E1Tg9tz-0008Fy-3z@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:18 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] libxl: fix a variable underflow
	in libxl_wait_for_free_memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ronny Hegewald <ronny.hegewald@online.de>
# Date 1354208383 0
# Node ID 9e13427c023020756768c73217dab05295709fb3
# Parent  b3dafd42268af1ea9558b536702841625dd52500
libxl: fix a variable underflow in libxl_wait_for_free_memory

When xl is called to create a domU and there is not enough memory available,
then the autoballooning is called to extract memory from dom0. During the
ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory
is available to create the domU.

But because of a variable-underflow the loop can finish too soon and xl
finally aborts with the message:

xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low memory for domain: Out of memory
libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: Device or resource busy
libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build domain: -3

The variable-underflow happens when freemem_slack is larger then
info.free_pages*4, because the solution of this operation is converted
implicit to a unsigned int to match the type of memory_kb.

Add a extra check for this condition to solve the problem.

Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26190:678718a2e565
Backport-requested-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r b3dafd42268a -r 9e13427c0230 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Nov 29 16:07:55 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Nov 29 16:59:43 2012 +0000
@@ -3592,7 +3592,8 @@ int libxl_wait_for_free_memory(libxl_ctx
         rc = libxl_get_physinfo(ctx, &info);
         if (rc < 0)
             goto out;
-        if (info.free_pages * 4 - freemem_slack >= memory_kb) {
+        if (info.free_pages * 4 >= freemem_slack &&
+            info.free_pages * 4 - freemem_slack >= memory_kb) {
             rc = 0;
             goto out;
         }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uE-0002CZ-NU; Wed, 05 Dec 2012 08:00:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uD-0002CN-4r
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:33 +0000
Received: from [85.158.143.99:26827] by server-2.bemta-4.messagelabs.com id
	9F/72-30861-02FFEB05; Wed, 05 Dec 2012 08:00:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1354694429!27220965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13779 invoked from network); 5 Dec 2012 08:00:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u9-00019c-Fu
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u8-0008HI-LE
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:28 +0000
Message-Id: <E1Tg9u8-0008HI-LE@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:28 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] xen: add missing guest address
	range checks to XENMEM_exchange handlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354644164 0
# Node ID 83ab3cd0f8e44ad588932aba93d3b5f92a888a08
# Parent  5771c761ff1bb249dc683d7ec019d76a2a03a048
xen: add missing guest address range checks to XENMEM_exchange handlers

Ever since its existence (3.0.3 iirc) the handler for this has been
using non address range checking guest memory accessors (i.e.
the ones prefixed with two underscores) without first range
checking the accessed space (via guest_handle_okay()), allowing
a guest to access and overwrite hypervisor memory.

This is XSA-29 / CVE-2012-5513.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 5771c761ff1b -r 83ab3cd0f8e4 xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Tue Dec 04 18:02:38 2012 +0000
+++ b/xen/common/compat/memory.c	Tue Dec 04 18:02:44 2012 +0000
@@ -115,6 +115,12 @@ int compat_memory_op(unsigned int cmd, X
                   (cmp.xchg.out.nr_extents << cmp.xchg.out.extent_order)) )
                 return -EINVAL;
 
+            if ( !compat_handle_okay(cmp.xchg.in.extent_start,
+                                     cmp.xchg.in.nr_extents) ||
+                 !compat_handle_okay(cmp.xchg.out.extent_start,
+                                     cmp.xchg.out.nr_extents) )
+                return -EFAULT;
+
             start_extent = cmp.xchg.nr_exchanged;
             end_extent = (COMPAT_ARG_XLAT_SIZE - sizeof(*nat.xchg)) /
                          (((1U << ABS(order_delta)) + 1) *
diff -r 5771c761ff1b -r 83ab3cd0f8e4 xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:02:38 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:02:44 2012 +0000
@@ -308,6 +308,13 @@ static long memory_exchange(XEN_GUEST_HA
         goto fail_early;
     }
 
+    if ( !guest_handle_okay(exch.in.extent_start, exch.in.nr_extents) ||
+         !guest_handle_okay(exch.out.extent_start, exch.out.nr_extents) )
+    {
+        rc = -EFAULT;
+        goto fail_early;
+    }
+
     /* Only privileged guests can allocate multi-page contiguous extents. */
     if ( !multipage_allocation_permitted(current->domain,
                                          exch.in.extent_order) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uE-0002CZ-NU; Wed, 05 Dec 2012 08:00:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uD-0002CN-4r
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:33 +0000
Received: from [85.158.143.99:26827] by server-2.bemta-4.messagelabs.com id
	9F/72-30861-02FFEB05; Wed, 05 Dec 2012 08:00:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1354694429!27220965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13779 invoked from network); 5 Dec 2012 08:00:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u9-00019c-Fu
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u8-0008HI-LE
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:28 +0000
Message-Id: <E1Tg9u8-0008HI-LE@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:28 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] xen: add missing guest address
	range checks to XENMEM_exchange handlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354644164 0
# Node ID 83ab3cd0f8e44ad588932aba93d3b5f92a888a08
# Parent  5771c761ff1bb249dc683d7ec019d76a2a03a048
xen: add missing guest address range checks to XENMEM_exchange handlers

Ever since its existence (3.0.3 iirc) the handler for this has been
using non address range checking guest memory accessors (i.e.
the ones prefixed with two underscores) without first range
checking the accessed space (via guest_handle_okay()), allowing
a guest to access and overwrite hypervisor memory.

This is XSA-29 / CVE-2012-5513.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 5771c761ff1b -r 83ab3cd0f8e4 xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Tue Dec 04 18:02:38 2012 +0000
+++ b/xen/common/compat/memory.c	Tue Dec 04 18:02:44 2012 +0000
@@ -115,6 +115,12 @@ int compat_memory_op(unsigned int cmd, X
                   (cmp.xchg.out.nr_extents << cmp.xchg.out.extent_order)) )
                 return -EINVAL;
 
+            if ( !compat_handle_okay(cmp.xchg.in.extent_start,
+                                     cmp.xchg.in.nr_extents) ||
+                 !compat_handle_okay(cmp.xchg.out.extent_start,
+                                     cmp.xchg.out.nr_extents) )
+                return -EFAULT;
+
             start_extent = cmp.xchg.nr_exchanged;
             end_extent = (COMPAT_ARG_XLAT_SIZE - sizeof(*nat.xchg)) /
                          (((1U << ABS(order_delta)) + 1) *
diff -r 5771c761ff1b -r 83ab3cd0f8e4 xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:02:38 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:02:44 2012 +0000
@@ -308,6 +308,13 @@ static long memory_exchange(XEN_GUEST_HA
         goto fail_early;
     }
 
+    if ( !guest_handle_okay(exch.in.extent_start, exch.in.nr_extents) ||
+         !guest_handle_okay(exch.out.extent_start, exch.out.nr_extents) )
+    {
+        rc = -EFAULT;
+        goto fail_early;
+    }
+
     /* Only privileged guests can allocate multi-page contiguous extents. */
     if ( !multipage_allocation_permitted(current->domain,
                                          exch.in.extent_order) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uG-0002D8-Ql; Wed, 05 Dec 2012 08:00:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uE-0002CY-H7
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:34 +0000
Received: from [85.158.139.211:4859] by server-2.bemta-5.messagelabs.com id
	97/CF-04892-12FFEB05; Wed, 05 Dec 2012 08:00:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354694428!19123427!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4630 invoked from network); 5 Dec 2012 08:00:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u8-00019Z-8v
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u7-0008H3-74
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:27 +0000
Message-Id: <E1Tg9u7-0008H3-74@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:26 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] hvm: Limit the size of large HVM
	op batches
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1354644158 0
# Node ID 5771c761ff1bb249dc683d7ec019d76a2a03a048
# Parent  dea7d4e5bfc1627133c0c19706fea1fbc9e5a378
hvm: Limit the size of large HVM op batches

Doing large p2m updates for HVMOP_track_dirty_vram without preemption
ties up the physical processor. Integrating preemption into the p2m
updates is hard so simply limit to 1GB which is sufficient for a 15000
* 15000 * 32bpp framebuffer.

For HVMOP_modified_memory and HVMOP_set_mem_type preemptible add the
necessary machinery to handle preemption.

This is CVE-2012-5511 / XSA-27.

Signed-off-by: Tim Deegan <tim@xen.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>

v2: Provide definition of GB to fix x86-32 compile.

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r dea7d4e5bfc1 -r 5771c761ff1b xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:02:18 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:02:38 2012 +0000
@@ -3969,6 +3969,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
+        if ( a.nr > GB(1) >> PAGE_SHIFT )
+            goto param_fail2;
+
         rc = xsm_hvm_param(d, op);
         if ( rc )
             goto param_fail2;
@@ -3995,7 +3998,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
     {
         struct xen_hvm_modified_memory a;
         struct domain *d;
-        unsigned long pfn;
 
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
@@ -4022,9 +4024,11 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( !paging_mode_log_dirty(d) )
             goto param_fail3;
 
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr > 0 )
         {
+            unsigned long pfn = a.first_pfn;
             struct page_info *page;
+
             page = get_page_from_gfn(d, pfn, NULL, P2M_UNSHARE);
             if ( page )
             {
@@ -4034,6 +4038,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 sh_remove_shadows(d->vcpu[0], _mfn(page_to_mfn(page)), 1, 0);
                 put_page(page);
             }
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                break;
+            }
         }
 
     param_fail3:
@@ -4089,7 +4106,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
     {
         struct xen_hvm_set_mem_type a;
         struct domain *d;
-        unsigned long pfn;
         
         /* Interface types to internal p2m types */
         p2m_type_t memtype[] = {
@@ -4122,8 +4138,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( a.hvmmem_type >= ARRAY_SIZE(memtype) )
             goto param_fail4;
 
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr )
         {
+            unsigned long pfn = a.first_pfn;
             p2m_type_t t;
             p2m_type_t nt;
             mfn_t mfn;
@@ -4163,6 +4180,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 }
             }
             put_gfn(d, pfn);
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                goto param_fail4;
+            }
         }
 
         rc = 0;
diff -r dea7d4e5bfc1 -r 5771c761ff1b xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Tue Dec 04 18:02:18 2012 +0000
+++ b/xen/include/asm-x86/config.h	Tue Dec 04 18:02:38 2012 +0000
@@ -119,6 +119,9 @@ extern char wakeup_start[];
 extern unsigned int video_mode, video_flags;
 extern unsigned short boot_edid_caps;
 extern unsigned char boot_edid_info[128];
+
+#define GB(_gb) (_gb ## UL << 30)
+
 #endif
 
 #define asmlinkage
@@ -134,7 +137,6 @@ extern unsigned char boot_edid_info[128]
 #define PML4_ADDR(_slot)                             \
     ((((_slot ## UL) >> 8) * 0xffff000000000000UL) | \
      (_slot ## UL << PML4_ENTRY_BITS))
-#define GB(_gb) (_gb ## UL << 30)
 #else
 #define PML4_ENTRY_BYTES (1 << PML4_ENTRY_BITS)
 #define PML4_ADDR(_slot)                             \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uG-0002D8-Ql; Wed, 05 Dec 2012 08:00:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uE-0002CY-H7
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:34 +0000
Received: from [85.158.139.211:4859] by server-2.bemta-5.messagelabs.com id
	97/CF-04892-12FFEB05; Wed, 05 Dec 2012 08:00:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354694428!19123427!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4630 invoked from network); 5 Dec 2012 08:00:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u8-00019Z-8v
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u7-0008H3-74
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:27 +0000
Message-Id: <E1Tg9u7-0008H3-74@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:26 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] hvm: Limit the size of large HVM
	op batches
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1354644158 0
# Node ID 5771c761ff1bb249dc683d7ec019d76a2a03a048
# Parent  dea7d4e5bfc1627133c0c19706fea1fbc9e5a378
hvm: Limit the size of large HVM op batches

Doing large p2m updates for HVMOP_track_dirty_vram without preemption
ties up the physical processor. Integrating preemption into the p2m
updates is hard so simply limit to 1GB which is sufficient for a 15000
* 15000 * 32bpp framebuffer.

For HVMOP_modified_memory and HVMOP_set_mem_type preemptible add the
necessary machinery to handle preemption.

This is CVE-2012-5511 / XSA-27.

Signed-off-by: Tim Deegan <tim@xen.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>

v2: Provide definition of GB to fix x86-32 compile.

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r dea7d4e5bfc1 -r 5771c761ff1b xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:02:18 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:02:38 2012 +0000
@@ -3969,6 +3969,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
+        if ( a.nr > GB(1) >> PAGE_SHIFT )
+            goto param_fail2;
+
         rc = xsm_hvm_param(d, op);
         if ( rc )
             goto param_fail2;
@@ -3995,7 +3998,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
     {
         struct xen_hvm_modified_memory a;
         struct domain *d;
-        unsigned long pfn;
 
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
@@ -4022,9 +4024,11 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( !paging_mode_log_dirty(d) )
             goto param_fail3;
 
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr > 0 )
         {
+            unsigned long pfn = a.first_pfn;
             struct page_info *page;
+
             page = get_page_from_gfn(d, pfn, NULL, P2M_UNSHARE);
             if ( page )
             {
@@ -4034,6 +4038,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 sh_remove_shadows(d->vcpu[0], _mfn(page_to_mfn(page)), 1, 0);
                 put_page(page);
             }
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                break;
+            }
         }
 
     param_fail3:
@@ -4089,7 +4106,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
     {
         struct xen_hvm_set_mem_type a;
         struct domain *d;
-        unsigned long pfn;
         
         /* Interface types to internal p2m types */
         p2m_type_t memtype[] = {
@@ -4122,8 +4138,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( a.hvmmem_type >= ARRAY_SIZE(memtype) )
             goto param_fail4;
 
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr )
         {
+            unsigned long pfn = a.first_pfn;
             p2m_type_t t;
             p2m_type_t nt;
             mfn_t mfn;
@@ -4163,6 +4180,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 }
             }
             put_gfn(d, pfn);
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                goto param_fail4;
+            }
         }
 
         rc = 0;
diff -r dea7d4e5bfc1 -r 5771c761ff1b xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Tue Dec 04 18:02:18 2012 +0000
+++ b/xen/include/asm-x86/config.h	Tue Dec 04 18:02:38 2012 +0000
@@ -119,6 +119,9 @@ extern char wakeup_start[];
 extern unsigned int video_mode, video_flags;
 extern unsigned short boot_edid_caps;
 extern unsigned char boot_edid_info[128];
+
+#define GB(_gb) (_gb ## UL << 30)
+
 #endif
 
 #define asmlinkage
@@ -134,7 +137,6 @@ extern unsigned char boot_edid_info[128]
 #define PML4_ADDR(_slot)                             \
     ((((_slot ## UL) >> 8) * 0xffff000000000000UL) | \
      (_slot ## UL << PML4_ENTRY_BITS))
-#define GB(_gb) (_gb ## UL << 30)
 #else
 #define PML4_ENTRY_BYTES (1 << PML4_ENTRY_BITS)
 #define PML4_ADDR(_slot)                             \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uG-0002DD-Tu; Wed, 05 Dec 2012 08:00:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uF-0002Ck-NX
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:35 +0000
Received: from [193.109.254.147:59920] by server-1.bemta-14.messagelabs.com id
	7A/06-25314-32FFEB05; Wed, 05 Dec 2012 08:00:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1354694432!1726109!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24019 invoked from network); 5 Dec 2012 08:00:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uC-00019f-6G
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u9-0008HX-W5
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:31 +0000
Message-Id: <E1Tg9u9-0008HX-W5@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:29 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] xen: fix error handling of
	guest_physmap_mark_populate_on_demand()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354644168 0
# Node ID 09a48c5da6368ac61bdba5ee09253c2b20d7b577
# Parent  83ab3cd0f8e44ad588932aba93d3b5f92a888a08
xen: fix error handling of guest_physmap_mark_populate_on_demand()

The only user of the "out" label bypasses a necessary unlock, thus
enabling the caller to lock up Xen.

Also, the function was never meant to be called by a guest for itself,
so rather than inspecting the code paths in depth for potential other
problems this might cause, and adjusting e.g. the non-guest printk()
in the above error path, just disallow the guest access to it.

Finally, the printk() (considering its potential of spamming the log,
the more that it's not using XENLOG_GUEST), is being converted to
P2M_DEBUG(), as debugging is what it apparently was added for in the
first place.

This is XSA-30 / CVE-2012-5514.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 83ab3cd0f8e4 -r 09a48c5da636 xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Tue Dec 04 18:02:44 2012 +0000
+++ b/xen/arch/x86/mm/p2m-pod.c	Tue Dec 04 18:02:48 2012 +0000
@@ -1117,6 +1117,9 @@ guest_physmap_mark_populate_on_demand(st
     mfn_t omfn;
     int rc = 0;
 
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+
     if ( !paging_mode_translate(d) )
         return -EINVAL;
 
@@ -1135,8 +1138,7 @@ guest_physmap_mark_populate_on_demand(st
         omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
         if ( p2m_is_ram(ot) )
         {
-            printk("%s: gfn_to_mfn returned type %d!\n",
-                   __func__, ot);
+            P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
             rc = -EBUSY;
             goto out;
         }
@@ -1160,9 +1162,9 @@ guest_physmap_mark_populate_on_demand(st
         pod_unlock(p2m);
     }
 
+out:
     gfn_unlock(p2m, gfn, order);
 
-out:
     return rc;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uG-0002DD-Tu; Wed, 05 Dec 2012 08:00:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uF-0002Ck-NX
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:35 +0000
Received: from [193.109.254.147:59920] by server-1.bemta-14.messagelabs.com id
	7A/06-25314-32FFEB05; Wed, 05 Dec 2012 08:00:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1354694432!1726109!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24019 invoked from network); 5 Dec 2012 08:00:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uC-00019f-6G
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u9-0008HX-W5
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:31 +0000
Message-Id: <E1Tg9u9-0008HX-W5@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:29 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] xen: fix error handling of
	guest_physmap_mark_populate_on_demand()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354644168 0
# Node ID 09a48c5da6368ac61bdba5ee09253c2b20d7b577
# Parent  83ab3cd0f8e44ad588932aba93d3b5f92a888a08
xen: fix error handling of guest_physmap_mark_populate_on_demand()

The only user of the "out" label bypasses a necessary unlock, thus
enabling the caller to lock up Xen.

Also, the function was never meant to be called by a guest for itself,
so rather than inspecting the code paths in depth for potential other
problems this might cause, and adjusting e.g. the non-guest printk()
in the above error path, just disallow the guest access to it.

Finally, the printk() (considering its potential of spamming the log,
the more that it's not using XENLOG_GUEST), is being converted to
P2M_DEBUG(), as debugging is what it apparently was added for in the
first place.

This is XSA-30 / CVE-2012-5514.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 83ab3cd0f8e4 -r 09a48c5da636 xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Tue Dec 04 18:02:44 2012 +0000
+++ b/xen/arch/x86/mm/p2m-pod.c	Tue Dec 04 18:02:48 2012 +0000
@@ -1117,6 +1117,9 @@ guest_physmap_mark_populate_on_demand(st
     mfn_t omfn;
     int rc = 0;
 
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+
     if ( !paging_mode_translate(d) )
         return -EINVAL;
 
@@ -1135,8 +1138,7 @@ guest_physmap_mark_populate_on_demand(st
         omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
         if ( p2m_is_ram(ot) )
         {
-            printk("%s: gfn_to_mfn returned type %d!\n",
-                   __func__, ot);
+            P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
             rc = -EBUSY;
             goto out;
         }
@@ -1160,9 +1162,9 @@ guest_physmap_mark_populate_on_demand(st
         pod_unlock(p2m);
     }
 
+out:
     gfn_unlock(p2m, gfn, order);
 
-out:
     return rc;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uI-0002DZ-0Q; Wed, 05 Dec 2012 08:00:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uG-0002D6-W5
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:37 +0000
Received: from [85.158.143.35:13514] by server-3.bemta-4.messagelabs.com id
	ED/D8-06841-42FFEB05; Wed, 05 Dec 2012 08:00:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354694432!12874351!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6853 invoked from network); 5 Dec 2012 08:00:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uC-00019i-Ln
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uC-0008Hn-Ha
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:32 +0000
Message-Id: <E1Tg9uC-0008Hn-Ha@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:32 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] memop: limit guest specified
	extent order
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354644172 0
# Node ID 2c3f00c5189b9269f9840be93d03f058c8994f6e
# Parent  09a48c5da6368ac61bdba5ee09253c2b20d7b577
memop: limit guest specified extent order

Allowing unbounded order values here causes almost unbounded loops
and/or partially incomplete requests, particularly in PoD code.

The added range checks in populate_physmap(), decrease_reservation(),
and the "in" one in memory_exchange() architecturally all could use
PADDR_BITS - PAGE_SHIFT, and are being artificially constrained to
MAX_ORDER.

This is XSA-31 / CVE-2012-5515.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 09a48c5da636 -r 2c3f00c5189b xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:02:48 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:02:52 2012 +0000
@@ -115,7 +115,8 @@ static void populate_physmap(struct memo
 
         if ( a->memflags & MEMF_populate_on_demand )
         {
-            if ( guest_physmap_mark_populate_on_demand(d, gpfn,
+            if ( a->extent_order > MAX_ORDER ||
+                 guest_physmap_mark_populate_on_demand(d, gpfn,
                                                        a->extent_order) < 0 )
                 goto out;
         }
@@ -235,7 +236,8 @@ static void decrease_reservation(struct 
     xen_pfn_t gmfn;
 
     if ( !guest_handle_subrange_okay(a->extent_list, a->nr_done,
-                                     a->nr_extents-1) )
+                                     a->nr_extents-1) ||
+         a->extent_order > MAX_ORDER )
         return;
 
     for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -297,6 +299,9 @@ static long memory_exchange(XEN_GUEST_HA
     if ( (exch.nr_exchanged > exch.in.nr_extents) ||
          /* Input and output domain identifiers match? */
          (exch.in.domid != exch.out.domid) ||
+         /* Extent orders are sensible? */
+         (exch.in.extent_order > MAX_ORDER) ||
+         (exch.out.extent_order > MAX_ORDER) ||
          /* Sizes of input and output lists do not overflow a long? */
          ((~0UL >> exch.in.extent_order) < exch.in.nr_extents) ||
          ((~0UL >> exch.out.extent_order) < exch.out.nr_extents) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uI-0002DZ-0Q; Wed, 05 Dec 2012 08:00:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uG-0002D6-W5
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:37 +0000
Received: from [85.158.143.35:13514] by server-3.bemta-4.messagelabs.com id
	ED/D8-06841-42FFEB05; Wed, 05 Dec 2012 08:00:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1354694432!12874351!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6853 invoked from network); 5 Dec 2012 08:00:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uC-00019i-Ln
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uC-0008Hn-Ha
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:32 +0000
Message-Id: <E1Tg9uC-0008Hn-Ha@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:32 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] memop: limit guest specified
	extent order
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354644172 0
# Node ID 2c3f00c5189b9269f9840be93d03f058c8994f6e
# Parent  09a48c5da6368ac61bdba5ee09253c2b20d7b577
memop: limit guest specified extent order

Allowing unbounded order values here causes almost unbounded loops
and/or partially incomplete requests, particularly in PoD code.

The added range checks in populate_physmap(), decrease_reservation(),
and the "in" one in memory_exchange() architecturally all could use
PADDR_BITS - PAGE_SHIFT, and are being artificially constrained to
MAX_ORDER.

This is XSA-31 / CVE-2012-5515.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 09a48c5da636 -r 2c3f00c5189b xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:02:48 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:02:52 2012 +0000
@@ -115,7 +115,8 @@ static void populate_physmap(struct memo
 
         if ( a->memflags & MEMF_populate_on_demand )
         {
-            if ( guest_physmap_mark_populate_on_demand(d, gpfn,
+            if ( a->extent_order > MAX_ORDER ||
+                 guest_physmap_mark_populate_on_demand(d, gpfn,
                                                        a->extent_order) < 0 )
                 goto out;
         }
@@ -235,7 +236,8 @@ static void decrease_reservation(struct 
     xen_pfn_t gmfn;
 
     if ( !guest_handle_subrange_okay(a->extent_list, a->nr_done,
-                                     a->nr_extents-1) )
+                                     a->nr_extents-1) ||
+         a->extent_order > MAX_ORDER )
         return;
 
     for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -297,6 +299,9 @@ static long memory_exchange(XEN_GUEST_HA
     if ( (exch.nr_exchanged > exch.in.nr_extents) ||
          /* Input and output domain identifiers match? */
          (exch.in.domid != exch.out.domid) ||
+         /* Extent orders are sensible? */
+         (exch.in.extent_order > MAX_ORDER) ||
+         (exch.out.extent_order > MAX_ORDER) ||
          /* Sizes of input and output lists do not overflow a long? */
          ((~0UL >> exch.in.extent_order) < exch.in.nr_extents) ||
          ((~0UL >> exch.out.extent_order) < exch.out.nr_extents) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uJ-0002Dl-2u; Wed, 05 Dec 2012 08:00:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uH-0002D6-L0
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:37 +0000
Received: from [85.158.143.35:13556] by server-3.bemta-4.messagelabs.com id
	D3/E8-06841-52FFEB05; Wed, 05 Dec 2012 08:00:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354694433!16144202!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22435 invoked from network); 5 Dec 2012 08:00:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uD-00019l-4R
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uD-0008I2-39
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:33 +0000
Message-Id: <E1Tg9uD-0008I2-39@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:32 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: get_page_from_gfn() must
	return NULL for invalid GFNs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354644179 0
# Node ID b306bce613413c772af7a7660c9fd44d347b5ee2
# Parent  2c3f00c5189b9269f9840be93d03f058c8994f6e
x86: get_page_from_gfn() must return NULL for invalid GFNs

... also in the non-translated case.

This is XSA-32 / CVE-2012-xxxx.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 2c3f00c5189b -r b306bce61341 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Tue Dec 04 18:02:52 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Tue Dec 04 18:02:59 2012 +0000
@@ -400,7 +400,7 @@ static inline struct page_info *get_page
     if (t)
         *t = p2m_ram_rw;
     page = __mfn_to_page(gfn);
-    return get_page(page, d) ? page : NULL;
+    return mfn_valid(gfn) && get_page(page, d) ? page : NULL;
 }
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uJ-0002Dl-2u; Wed, 05 Dec 2012 08:00:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uH-0002D6-L0
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:37 +0000
Received: from [85.158.143.35:13556] by server-3.bemta-4.messagelabs.com id
	D3/E8-06841-52FFEB05; Wed, 05 Dec 2012 08:00:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1354694433!16144202!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22435 invoked from network); 5 Dec 2012 08:00:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uD-00019l-4R
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uD-0008I2-39
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:33 +0000
Message-Id: <E1Tg9uD-0008I2-39@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:32 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: get_page_from_gfn() must
	return NULL for invalid GFNs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354644179 0
# Node ID b306bce613413c772af7a7660c9fd44d347b5ee2
# Parent  2c3f00c5189b9269f9840be93d03f058c8994f6e
x86: get_page_from_gfn() must return NULL for invalid GFNs

... also in the non-translated case.

This is XSA-32 / CVE-2012-xxxx.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 2c3f00c5189b -r b306bce61341 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Tue Dec 04 18:02:52 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Tue Dec 04 18:02:59 2012 +0000
@@ -400,7 +400,7 @@ static inline struct page_info *get_page
     if (t)
         *t = p2m_ram_rw;
     page = __mfn_to_page(gfn);
-    return get_page(page, d) ? page : NULL;
+    return mfn_valid(gfn) && get_page(page, d) ? page : NULL;
 }
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:48 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uQ-0002GD-6G; Wed, 05 Dec 2012 08:00:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uO-0002Fs-Tw
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:45 +0000
Received: from [193.109.254.147:46894] by server-8.bemta-14.messagelabs.com id
	17/44-05026-C2FFEB05; Wed, 05 Dec 2012 08:00:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1354694427!6317657!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20850 invoked from network); 5 Dec 2012 08:00:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u6-00019U-Qs
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u5-0008Gl-Du
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:26 +0000
Message-Id: <E1Tg9u5-0008Gl-Du@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:24 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] gnttab: fix releasing of memory
	upon switches between versions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354644138 0
# Node ID dea7d4e5bfc1627133c0c19706fea1fbc9e5a378
# Parent  9e13427c023020756768c73217dab05295709fb3
gnttab: fix releasing of memory upon switches between versions

gnttab_unpopulate_status_frames() incompletely freed the pages
previously used as status frame in that they did not get removed from
the domain's xenpage_list, thus causing subsequent list corruption
when those pages did get allocated again for the same or another purpose.

Similarly, grant_table_create() and gnttab_grow_table() both improperly
clean up in the event of an error - pages already shared with the guest
can't be freed by just passing them to free_xenheap_page(). Fix this by
sharing the pages only after all allocations succeeded.

This is CVE-2012-5510 / XSA-26.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 9e13427c0230 -r dea7d4e5bfc1 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Nov 29 16:59:43 2012 +0000
+++ b/xen/common/grant_table.c	Tue Dec 04 18:02:18 2012 +0000
@@ -1173,12 +1173,13 @@ fault:
 }
 
 static int
-gnttab_populate_status_frames(struct domain *d, struct grant_table *gt)
+gnttab_populate_status_frames(struct domain *d, struct grant_table *gt,
+                              unsigned int req_nr_frames)
 {
     unsigned i;
     unsigned req_status_frames;
 
-    req_status_frames = grant_to_status_frames(gt->nr_grant_frames);
+    req_status_frames = grant_to_status_frames(req_nr_frames);
     for ( i = nr_status_frames(gt); i < req_status_frames; i++ )
     {
         if ( (gt->status[i] = alloc_xenheap_page()) == NULL )
@@ -1209,7 +1210,12 @@ gnttab_unpopulate_status_frames(struct d
 
     for ( i = 0; i < nr_status_frames(gt); i++ )
     {
-        page_set_owner(virt_to_page(gt->status[i]), dom_xen);
+        struct page_info *pg = virt_to_page(gt->status[i]);
+
+        BUG_ON(page_get_owner(pg) != d);
+        if ( test_and_clear_bit(_PGC_allocated, &pg->count_info) )
+            put_page(pg);
+        BUG_ON(pg->count_info & ~PGC_xen_heap);
         free_xenheap_page(gt->status[i]);
         gt->status[i] = NULL;
     }
@@ -1247,19 +1253,18 @@ gnttab_grow_table(struct domain *d, unsi
         clear_page(gt->shared_raw[i]);
     }
 
+    /* Status pages - version 2 */
+    if (gt->gt_version > 1)
+    {
+        if ( gnttab_populate_status_frames(d, gt, req_nr_frames) )
+            goto shared_alloc_failed;
+    }
+
     /* Share the new shared frames with the recipient domain */
     for ( i = nr_grant_frames(gt); i < req_nr_frames; i++ )
         gnttab_create_shared_page(d, gt, i);
-
     gt->nr_grant_frames = req_nr_frames;
 
-    /* Status pages - version 2 */
-    if (gt->gt_version > 1)
-    {
-        if ( gnttab_populate_status_frames(d, gt) )
-            goto shared_alloc_failed;
-    }
-
     return 1;
 
 shared_alloc_failed:
@@ -2157,7 +2162,7 @@ gnttab_set_version(XEN_GUEST_HANDLE(gntt
 
     if ( op.version == 2 && gt->gt_version < 2 )
     {
-        res = gnttab_populate_status_frames(d, gt);
+        res = gnttab_populate_status_frames(d, gt, nr_grant_frames(gt));
         if ( res < 0)
             goto out_unlock;
     }
@@ -2600,14 +2605,15 @@ grant_table_create(
         clear_page(t->shared_raw[i]);
     }
     
-    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
-        gnttab_create_shared_page(d, t, i);
-
     /* Status pages for grant table - for version 2 */
     t->status = xzalloc_array(grant_status_t *,
                               grant_to_status_frames(max_nr_grant_frames));
     if ( t->status == NULL )
         goto no_mem_4;
+
+    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
+        gnttab_create_shared_page(d, t, i);
+
     t->nr_status_frames = 0;
 
     /* Okay, install the structure. */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 08:00:48 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 08:00:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tg9uQ-0002GD-6G; Wed, 05 Dec 2012 08:00:46 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9uO-0002Fs-Tw
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:45 +0000
Received: from [193.109.254.147:46894] by server-8.bemta-14.messagelabs.com id
	17/44-05026-C2FFEB05; Wed, 05 Dec 2012 08:00:44 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1354694427!6317657!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20850 invoked from network); 5 Dec 2012 08:00:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 08:00:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u6-00019U-Qs
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tg9u5-0008Gl-Du
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 08:00:26 +0000
Message-Id: <E1Tg9u5-0008Gl-Du@xenbits.xen.org>
Date: Wed, 05 Dec 2012 08:00:24 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] gnttab: fix releasing of memory
	upon switches between versions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354644138 0
# Node ID dea7d4e5bfc1627133c0c19706fea1fbc9e5a378
# Parent  9e13427c023020756768c73217dab05295709fb3
gnttab: fix releasing of memory upon switches between versions

gnttab_unpopulate_status_frames() incompletely freed the pages
previously used as status frame in that they did not get removed from
the domain's xenpage_list, thus causing subsequent list corruption
when those pages did get allocated again for the same or another purpose.

Similarly, grant_table_create() and gnttab_grow_table() both improperly
clean up in the event of an error - pages already shared with the guest
can't be freed by just passing them to free_xenheap_page(). Fix this by
sharing the pages only after all allocations succeeded.

This is CVE-2012-5510 / XSA-26.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 9e13427c0230 -r dea7d4e5bfc1 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Nov 29 16:59:43 2012 +0000
+++ b/xen/common/grant_table.c	Tue Dec 04 18:02:18 2012 +0000
@@ -1173,12 +1173,13 @@ fault:
 }
 
 static int
-gnttab_populate_status_frames(struct domain *d, struct grant_table *gt)
+gnttab_populate_status_frames(struct domain *d, struct grant_table *gt,
+                              unsigned int req_nr_frames)
 {
     unsigned i;
     unsigned req_status_frames;
 
-    req_status_frames = grant_to_status_frames(gt->nr_grant_frames);
+    req_status_frames = grant_to_status_frames(req_nr_frames);
     for ( i = nr_status_frames(gt); i < req_status_frames; i++ )
     {
         if ( (gt->status[i] = alloc_xenheap_page()) == NULL )
@@ -1209,7 +1210,12 @@ gnttab_unpopulate_status_frames(struct d
 
     for ( i = 0; i < nr_status_frames(gt); i++ )
     {
-        page_set_owner(virt_to_page(gt->status[i]), dom_xen);
+        struct page_info *pg = virt_to_page(gt->status[i]);
+
+        BUG_ON(page_get_owner(pg) != d);
+        if ( test_and_clear_bit(_PGC_allocated, &pg->count_info) )
+            put_page(pg);
+        BUG_ON(pg->count_info & ~PGC_xen_heap);
         free_xenheap_page(gt->status[i]);
         gt->status[i] = NULL;
     }
@@ -1247,19 +1253,18 @@ gnttab_grow_table(struct domain *d, unsi
         clear_page(gt->shared_raw[i]);
     }
 
+    /* Status pages - version 2 */
+    if (gt->gt_version > 1)
+    {
+        if ( gnttab_populate_status_frames(d, gt, req_nr_frames) )
+            goto shared_alloc_failed;
+    }
+
     /* Share the new shared frames with the recipient domain */
     for ( i = nr_grant_frames(gt); i < req_nr_frames; i++ )
         gnttab_create_shared_page(d, gt, i);
-
     gt->nr_grant_frames = req_nr_frames;
 
-    /* Status pages - version 2 */
-    if (gt->gt_version > 1)
-    {
-        if ( gnttab_populate_status_frames(d, gt) )
-            goto shared_alloc_failed;
-    }
-
     return 1;
 
 shared_alloc_failed:
@@ -2157,7 +2162,7 @@ gnttab_set_version(XEN_GUEST_HANDLE(gntt
 
     if ( op.version == 2 && gt->gt_version < 2 )
     {
-        res = gnttab_populate_status_frames(d, gt);
+        res = gnttab_populate_status_frames(d, gt, nr_grant_frames(gt));
         if ( res < 0)
             goto out_unlock;
     }
@@ -2600,14 +2605,15 @@ grant_table_create(
         clear_page(t->shared_raw[i]);
     }
     
-    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
-        gnttab_create_shared_page(d, t, i);
-
     /* Status pages for grant table - for version 2 */
     t->status = xzalloc_array(grant_status_t *,
                               grant_to_status_frames(max_nr_grant_frames));
     if ( t->status == NULL )
         goto no_mem_4;
+
+    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
+        gnttab_create_shared_page(d, t, i);
+
     t->nr_status_frames = 0;
 
     /* Okay, install the structure. */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDop-0004Sd-7D; Wed, 05 Dec 2012 12:11:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDon-0004SR-JF
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:13 +0000
Received: from [85.158.139.83:33497] by server-10.bemta-5.messagelabs.com id
	5D/81-09257-0E93FB05; Wed, 05 Dec 2012 12:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1354709471!28504551!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13983 invoked from network); 5 Dec 2012 12:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDok-00044S-Ty
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDok-0007O6-In
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:10 +0000
Message-Id: <E1TgDok-0007O6-In@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: Use $(OBJCOPY) not bare
	objcopy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354636219 0
# Node ID 36d5d8ee5643e49ca205704a2999a5b2df4b8fd6
# Parent  2ddd5138eca731853bd72c815511b081831d9fde
xen: arm: Use $(OBJCOPY) not bare objcopy

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2ddd5138eca7 -r 36d5d8ee5643 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Tue Dec 04 15:50:18 2012 +0000
+++ b/xen/arch/arm/Makefile	Tue Dec 04 15:50:19 2012 +0000
@@ -46,7 +46,7 @@ ALL_OBJS := head.o $(ALL_OBJS)
 
 #
 $(TARGET).bin: $(TARGET)-syms
-	objcopy -O binary -S $< $@
+	$(OBJCOPY) -O binary -S $< $@
 
 #$(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 #	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDop-0004Sd-7D; Wed, 05 Dec 2012 12:11:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDon-0004SR-JF
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:13 +0000
Received: from [85.158.139.83:33497] by server-10.bemta-5.messagelabs.com id
	5D/81-09257-0E93FB05; Wed, 05 Dec 2012 12:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1354709471!28504551!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13983 invoked from network); 5 Dec 2012 12:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDok-00044S-Ty
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDok-0007O6-In
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:10 +0000
Message-Id: <E1TgDok-0007O6-In@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: Use $(OBJCOPY) not bare
	objcopy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354636219 0
# Node ID 36d5d8ee5643e49ca205704a2999a5b2df4b8fd6
# Parent  2ddd5138eca731853bd72c815511b081831d9fde
xen: arm: Use $(OBJCOPY) not bare objcopy

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2ddd5138eca7 -r 36d5d8ee5643 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Tue Dec 04 15:50:18 2012 +0000
+++ b/xen/arch/arm/Makefile	Tue Dec 04 15:50:19 2012 +0000
@@ -46,7 +46,7 @@ ALL_OBJS := head.o $(ALL_OBJS)
 
 #
 $(TARGET).bin: $(TARGET)-syms
-	objcopy -O binary -S $< $@
+	$(OBJCOPY) -O binary -S $< $@
 
 #$(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 #	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDor-0004Ta-IE; Wed, 05 Dec 2012 12:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoq-0004Su-1a
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:16 +0000
Received: from [85.158.143.99:44341] by server-3.bemta-4.messagelabs.com id
	98/E8-06841-3E93FB05; Wed, 05 Dec 2012 12:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354709473!22902723!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12082 invoked from network); 5 Dec 2012 12:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDom-00044e-SJ
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDom-0007P6-QM
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:12 +0000
Message-Id: <E1TgDom-0007P6-QM@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: add missing guest address range
	checks to XENMEM_exchange handlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646294 0
# Node ID b406e395995fcf174475e4ca3db21a2d55e627cd
# Parent  96fed5bcd0971c74e8751489278011407f9f91f3
xen: add missing guest address range checks to XENMEM_exchange handlers

Ever since its existence (3.0.3 iirc) the handler for this has been
using non address range checking guest memory accessors (i.e.
the ones prefixed with two underscores) without first range
checking the accessed space (via guest_handle_okay()), allowing
a guest to access and overwrite hypervisor memory.

This is XSA-29 / CVE-2012-5513.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 96fed5bcd097 -r b406e395995f xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Tue Dec 04 18:38:05 2012 +0000
+++ b/xen/common/compat/memory.c	Tue Dec 04 18:38:14 2012 +0000
@@ -115,6 +115,12 @@ int compat_memory_op(unsigned int cmd, X
                   (cmp.xchg.out.nr_extents << cmp.xchg.out.extent_order)) )
                 return -EINVAL;
 
+            if ( !compat_handle_okay(cmp.xchg.in.extent_start,
+                                     cmp.xchg.in.nr_extents) ||
+                 !compat_handle_okay(cmp.xchg.out.extent_start,
+                                     cmp.xchg.out.nr_extents) )
+                return -EFAULT;
+
             start_extent = cmp.xchg.nr_exchanged;
             end_extent = (COMPAT_ARG_XLAT_SIZE - sizeof(*nat.xchg)) /
                          (((1U << ABS(order_delta)) + 1) *
diff -r 96fed5bcd097 -r b406e395995f xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:38:05 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:38:14 2012 +0000
@@ -308,6 +308,13 @@ static long memory_exchange(XEN_GUEST_HA
         goto fail_early;
     }
 
+    if ( !guest_handle_okay(exch.in.extent_start, exch.in.nr_extents) ||
+         !guest_handle_okay(exch.out.extent_start, exch.out.nr_extents) )
+    {
+        rc = -EFAULT;
+        goto fail_early;
+    }
+
     /* Only privileged guests can allocate multi-page contiguous extents. */
     if ( !multipage_allocation_permitted(current->domain,
                                          exch.in.extent_order) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDor-0004Ta-IE; Wed, 05 Dec 2012 12:11:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoq-0004Su-1a
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:16 +0000
Received: from [85.158.143.99:44341] by server-3.bemta-4.messagelabs.com id
	98/E8-06841-3E93FB05; Wed, 05 Dec 2012 12:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1354709473!22902723!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12082 invoked from network); 5 Dec 2012 12:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDom-00044e-SJ
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDom-0007P6-QM
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:12 +0000
Message-Id: <E1TgDom-0007P6-QM@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: add missing guest address range
	checks to XENMEM_exchange handlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646294 0
# Node ID b406e395995fcf174475e4ca3db21a2d55e627cd
# Parent  96fed5bcd0971c74e8751489278011407f9f91f3
xen: add missing guest address range checks to XENMEM_exchange handlers

Ever since its existence (3.0.3 iirc) the handler for this has been
using non address range checking guest memory accessors (i.e.
the ones prefixed with two underscores) without first range
checking the accessed space (via guest_handle_okay()), allowing
a guest to access and overwrite hypervisor memory.

This is XSA-29 / CVE-2012-5513.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 96fed5bcd097 -r b406e395995f xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Tue Dec 04 18:38:05 2012 +0000
+++ b/xen/common/compat/memory.c	Tue Dec 04 18:38:14 2012 +0000
@@ -115,6 +115,12 @@ int compat_memory_op(unsigned int cmd, X
                   (cmp.xchg.out.nr_extents << cmp.xchg.out.extent_order)) )
                 return -EINVAL;
 
+            if ( !compat_handle_okay(cmp.xchg.in.extent_start,
+                                     cmp.xchg.in.nr_extents) ||
+                 !compat_handle_okay(cmp.xchg.out.extent_start,
+                                     cmp.xchg.out.nr_extents) )
+                return -EFAULT;
+
             start_extent = cmp.xchg.nr_exchanged;
             end_extent = (COMPAT_ARG_XLAT_SIZE - sizeof(*nat.xchg)) /
                          (((1U << ABS(order_delta)) + 1) *
diff -r 96fed5bcd097 -r b406e395995f xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:38:05 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:38:14 2012 +0000
@@ -308,6 +308,13 @@ static long memory_exchange(XEN_GUEST_HA
         goto fail_early;
     }
 
+    if ( !guest_handle_okay(exch.in.extent_start, exch.in.nr_extents) ||
+         !guest_handle_okay(exch.out.extent_start, exch.out.nr_extents) )
+    {
+        rc = -EFAULT;
+        goto fail_early;
+    }
+
     /* Only privileged guests can allocate multi-page contiguous extents. */
     if ( !multipage_allocation_permitted(current->domain,
                                          exch.in.extent_order) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDoq-0004TA-Cr; Wed, 05 Dec 2012 12:11:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDop-0004Sb-2f
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:15 +0000
Received: from [85.158.138.51:6227] by server-4.bemta-3.messagelabs.com id
	24/90-30023-2E93FB05; Wed, 05 Dec 2012 12:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1354709472!8888333!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12570 invoked from network); 5 Dec 2012 12:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDol-00044Y-Rv
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDol-0007Oc-NS
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:11 +0000
Message-Id: <E1TgDol-0007Oc-NS@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] gnttab: fix releasing of memory upon
	switches between versions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646280 0
# Node ID 90a697f3e78c7e44129dde455df6fc457275b7e8
# Parent  eb2394c97d57939da0e810f3f86a948ea56580e2
gnttab: fix releasing of memory upon switches between versions

gnttab_unpopulate_status_frames() incompletely freed the pages
previously used as status frame in that they did not get removed from
the domain's xenpage_list, thus causing subsequent list corruption
when those pages did get allocated again for the same or another purpose.

Similarly, grant_table_create() and gnttab_grow_table() both improperly
clean up in the event of an error - pages already shared with the guest
can't be freed by just passing them to free_xenheap_page(). Fix this by
sharing the pages only after all allocations succeeded.

This is CVE-2012-5510 / XSA-26.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r eb2394c97d57 -r 90a697f3e78c xen/common/grant_table.c
--- a/xen/common/grant_table.c	Tue Dec 04 15:50:20 2012 +0000
+++ b/xen/common/grant_table.c	Tue Dec 04 18:38:00 2012 +0000
@@ -1208,12 +1208,13 @@ fault:
 }
 
 static int
-gnttab_populate_status_frames(struct domain *d, struct grant_table *gt)
+gnttab_populate_status_frames(struct domain *d, struct grant_table *gt,
+                              unsigned int req_nr_frames)
 {
     unsigned i;
     unsigned req_status_frames;
 
-    req_status_frames = grant_to_status_frames(gt->nr_grant_frames);
+    req_status_frames = grant_to_status_frames(req_nr_frames);
     for ( i = nr_status_frames(gt); i < req_status_frames; i++ )
     {
         if ( (gt->status[i] = alloc_xenheap_page()) == NULL )
@@ -1244,7 +1245,12 @@ gnttab_unpopulate_status_frames(struct d
 
     for ( i = 0; i < nr_status_frames(gt); i++ )
     {
-        page_set_owner(virt_to_page(gt->status[i]), dom_xen);
+        struct page_info *pg = virt_to_page(gt->status[i]);
+
+        BUG_ON(page_get_owner(pg) != d);
+        if ( test_and_clear_bit(_PGC_allocated, &pg->count_info) )
+            put_page(pg);
+        BUG_ON(pg->count_info & ~PGC_xen_heap);
         free_xenheap_page(gt->status[i]);
         gt->status[i] = NULL;
     }
@@ -1282,19 +1288,18 @@ gnttab_grow_table(struct domain *d, unsi
         clear_page(gt->shared_raw[i]);
     }
 
+    /* Status pages - version 2 */
+    if (gt->gt_version > 1)
+    {
+        if ( gnttab_populate_status_frames(d, gt, req_nr_frames) )
+            goto shared_alloc_failed;
+    }
+
     /* Share the new shared frames with the recipient domain */
     for ( i = nr_grant_frames(gt); i < req_nr_frames; i++ )
         gnttab_create_shared_page(d, gt, i);
-
     gt->nr_grant_frames = req_nr_frames;
 
-    /* Status pages - version 2 */
-    if (gt->gt_version > 1)
-    {
-        if ( gnttab_populate_status_frames(d, gt) )
-            goto shared_alloc_failed;
-    }
-
     return 1;
 
 shared_alloc_failed:
@@ -2192,7 +2197,7 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARA
 
     if ( op.version == 2 && gt->gt_version < 2 )
     {
-        res = gnttab_populate_status_frames(d, gt);
+        res = gnttab_populate_status_frames(d, gt, nr_grant_frames(gt));
         if ( res < 0)
             goto out_unlock;
     }
@@ -2628,14 +2633,15 @@ grant_table_create(
         clear_page(t->shared_raw[i]);
     }
     
-    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
-        gnttab_create_shared_page(d, t, i);
-
     /* Status pages for grant table - for version 2 */
     t->status = xzalloc_array(grant_status_t *,
                               grant_to_status_frames(max_nr_grant_frames));
     if ( t->status == NULL )
         goto no_mem_4;
+
+    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
+        gnttab_create_shared_page(d, t, i);
+
     t->nr_status_frames = 0;
 
     /* Okay, install the structure. */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDoq-0004TH-Ft; Wed, 05 Dec 2012 12:11:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDop-0004Sc-Dn
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:15 +0000
Received: from [85.158.138.51:6259] by server-7.bemta-3.messagelabs.com id
	AE/6C-01713-2E93FB05; Wed, 05 Dec 2012 12:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354709472!25788997!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7829 invoked from network); 5 Dec 2012 12:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDom-00044b-E6
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDom-0007Or-8z
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:12 +0000
Message-Id: <E1TgDom-0007Or-8z@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm: Limit the size of large HVM op
	batches
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1354646285 0
# Node ID 96fed5bcd0971c74e8751489278011407f9f91f3
# Parent  90a697f3e78c7e44129dde455df6fc457275b7e8
hvm: Limit the size of large HVM op batches

Doing large p2m updates for HVMOP_track_dirty_vram without preemption
ties up the physical processor. Integrating preemption into the p2m
updates is hard so simply limit to 1GB which is sufficient for a 15000
* 15000 * 32bpp framebuffer.

For HVMOP_modified_memory and HVMOP_set_mem_type preemptible add the
necessary machinery to handle preemption.

This is CVE-2012-5511 / XSA-27.

Signed-off-by: Tim Deegan <tim@xen.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 90a697f3e78c -r 96fed5bcd097 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:38:00 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:38:05 2012 +0000
@@ -3984,6 +3984,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
+        if ( a.nr > GB(1) >> PAGE_SHIFT )
+            goto param_fail2;
+
         rc = xsm_hvm_param(d, op);
         if ( rc )
             goto param_fail2;
@@ -4010,7 +4013,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
     {
         struct xen_hvm_modified_memory a;
         struct domain *d;
-        unsigned long pfn;
 
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
@@ -4037,9 +4039,11 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( !paging_mode_log_dirty(d) )
             goto param_fail3;
 
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr > 0 )
         {
+            unsigned long pfn = a.first_pfn;
             struct page_info *page;
+
             page = get_page_from_gfn(d, pfn, NULL, P2M_UNSHARE);
             if ( page )
             {
@@ -4049,6 +4053,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 sh_remove_shadows(d->vcpu[0], _mfn(page_to_mfn(page)), 1, 0);
                 put_page(page);
             }
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                break;
+            }
         }
 
     param_fail3:
@@ -4104,7 +4121,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
     {
         struct xen_hvm_set_mem_type a;
         struct domain *d;
-        unsigned long pfn;
         
         /* Interface types to internal p2m types */
         p2m_type_t memtype[] = {
@@ -4137,8 +4153,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( a.hvmmem_type >= ARRAY_SIZE(memtype) )
             goto param_fail4;
 
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr )
         {
+            unsigned long pfn = a.first_pfn;
             p2m_type_t t;
             p2m_type_t nt;
             mfn_t mfn;
@@ -4178,6 +4195,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 }
             }
             put_gfn(d, pfn);
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                goto param_fail4;
+            }
         }
 
         rc = 0;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDoq-0004TA-Cr; Wed, 05 Dec 2012 12:11:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDop-0004Sb-2f
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:15 +0000
Received: from [85.158.138.51:6227] by server-4.bemta-3.messagelabs.com id
	24/90-30023-2E93FB05; Wed, 05 Dec 2012 12:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1354709472!8888333!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12570 invoked from network); 5 Dec 2012 12:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDol-00044Y-Rv
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDol-0007Oc-NS
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:11 +0000
Message-Id: <E1TgDol-0007Oc-NS@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] gnttab: fix releasing of memory upon
	switches between versions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646280 0
# Node ID 90a697f3e78c7e44129dde455df6fc457275b7e8
# Parent  eb2394c97d57939da0e810f3f86a948ea56580e2
gnttab: fix releasing of memory upon switches between versions

gnttab_unpopulate_status_frames() incompletely freed the pages
previously used as status frame in that they did not get removed from
the domain's xenpage_list, thus causing subsequent list corruption
when those pages did get allocated again for the same or another purpose.

Similarly, grant_table_create() and gnttab_grow_table() both improperly
clean up in the event of an error - pages already shared with the guest
can't be freed by just passing them to free_xenheap_page(). Fix this by
sharing the pages only after all allocations succeeded.

This is CVE-2012-5510 / XSA-26.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r eb2394c97d57 -r 90a697f3e78c xen/common/grant_table.c
--- a/xen/common/grant_table.c	Tue Dec 04 15:50:20 2012 +0000
+++ b/xen/common/grant_table.c	Tue Dec 04 18:38:00 2012 +0000
@@ -1208,12 +1208,13 @@ fault:
 }
 
 static int
-gnttab_populate_status_frames(struct domain *d, struct grant_table *gt)
+gnttab_populate_status_frames(struct domain *d, struct grant_table *gt,
+                              unsigned int req_nr_frames)
 {
     unsigned i;
     unsigned req_status_frames;
 
-    req_status_frames = grant_to_status_frames(gt->nr_grant_frames);
+    req_status_frames = grant_to_status_frames(req_nr_frames);
     for ( i = nr_status_frames(gt); i < req_status_frames; i++ )
     {
         if ( (gt->status[i] = alloc_xenheap_page()) == NULL )
@@ -1244,7 +1245,12 @@ gnttab_unpopulate_status_frames(struct d
 
     for ( i = 0; i < nr_status_frames(gt); i++ )
     {
-        page_set_owner(virt_to_page(gt->status[i]), dom_xen);
+        struct page_info *pg = virt_to_page(gt->status[i]);
+
+        BUG_ON(page_get_owner(pg) != d);
+        if ( test_and_clear_bit(_PGC_allocated, &pg->count_info) )
+            put_page(pg);
+        BUG_ON(pg->count_info & ~PGC_xen_heap);
         free_xenheap_page(gt->status[i]);
         gt->status[i] = NULL;
     }
@@ -1282,19 +1288,18 @@ gnttab_grow_table(struct domain *d, unsi
         clear_page(gt->shared_raw[i]);
     }
 
+    /* Status pages - version 2 */
+    if (gt->gt_version > 1)
+    {
+        if ( gnttab_populate_status_frames(d, gt, req_nr_frames) )
+            goto shared_alloc_failed;
+    }
+
     /* Share the new shared frames with the recipient domain */
     for ( i = nr_grant_frames(gt); i < req_nr_frames; i++ )
         gnttab_create_shared_page(d, gt, i);
-
     gt->nr_grant_frames = req_nr_frames;
 
-    /* Status pages - version 2 */
-    if (gt->gt_version > 1)
-    {
-        if ( gnttab_populate_status_frames(d, gt) )
-            goto shared_alloc_failed;
-    }
-
     return 1;
 
 shared_alloc_failed:
@@ -2192,7 +2197,7 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARA
 
     if ( op.version == 2 && gt->gt_version < 2 )
     {
-        res = gnttab_populate_status_frames(d, gt);
+        res = gnttab_populate_status_frames(d, gt, nr_grant_frames(gt));
         if ( res < 0)
             goto out_unlock;
     }
@@ -2628,14 +2633,15 @@ grant_table_create(
         clear_page(t->shared_raw[i]);
     }
     
-    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
-        gnttab_create_shared_page(d, t, i);
-
     /* Status pages for grant table - for version 2 */
     t->status = xzalloc_array(grant_status_t *,
                               grant_to_status_frames(max_nr_grant_frames));
     if ( t->status == NULL )
         goto no_mem_4;
+
+    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
+        gnttab_create_shared_page(d, t, i);
+
     t->nr_status_frames = 0;
 
     /* Okay, install the structure. */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDoq-0004TH-Ft; Wed, 05 Dec 2012 12:11:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDop-0004Sc-Dn
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:15 +0000
Received: from [85.158.138.51:6259] by server-7.bemta-3.messagelabs.com id
	AE/6C-01713-2E93FB05; Wed, 05 Dec 2012 12:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1354709472!25788997!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7829 invoked from network); 5 Dec 2012 12:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDom-00044b-E6
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDom-0007Or-8z
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:12 +0000
Message-Id: <E1TgDom-0007Or-8z@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm: Limit the size of large HVM op
	batches
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1354646285 0
# Node ID 96fed5bcd0971c74e8751489278011407f9f91f3
# Parent  90a697f3e78c7e44129dde455df6fc457275b7e8
hvm: Limit the size of large HVM op batches

Doing large p2m updates for HVMOP_track_dirty_vram without preemption
ties up the physical processor. Integrating preemption into the p2m
updates is hard so simply limit to 1GB which is sufficient for a 15000
* 15000 * 32bpp framebuffer.

For HVMOP_modified_memory and HVMOP_set_mem_type preemptible add the
necessary machinery to handle preemption.

This is CVE-2012-5511 / XSA-27.

Signed-off-by: Tim Deegan <tim@xen.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 90a697f3e78c -r 96fed5bcd097 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:38:00 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:38:05 2012 +0000
@@ -3984,6 +3984,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
+        if ( a.nr > GB(1) >> PAGE_SHIFT )
+            goto param_fail2;
+
         rc = xsm_hvm_param(d, op);
         if ( rc )
             goto param_fail2;
@@ -4010,7 +4013,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
     {
         struct xen_hvm_modified_memory a;
         struct domain *d;
-        unsigned long pfn;
 
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
@@ -4037,9 +4039,11 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( !paging_mode_log_dirty(d) )
             goto param_fail3;
 
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr > 0 )
         {
+            unsigned long pfn = a.first_pfn;
             struct page_info *page;
+
             page = get_page_from_gfn(d, pfn, NULL, P2M_UNSHARE);
             if ( page )
             {
@@ -4049,6 +4053,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 sh_remove_shadows(d->vcpu[0], _mfn(page_to_mfn(page)), 1, 0);
                 put_page(page);
             }
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                break;
+            }
         }
 
     param_fail3:
@@ -4104,7 +4121,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
     {
         struct xen_hvm_set_mem_type a;
         struct domain *d;
-        unsigned long pfn;
         
         /* Interface types to internal p2m types */
         p2m_type_t memtype[] = {
@@ -4137,8 +4153,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( a.hvmmem_type >= ARRAY_SIZE(memtype) )
             goto param_fail4;
 
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr )
         {
+            unsigned long pfn = a.first_pfn;
             p2m_type_t t;
             p2m_type_t nt;
             mfn_t mfn;
@@ -4178,6 +4195,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 }
             }
             put_gfn(d, pfn);
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                goto param_fail4;
+            }
         }
 
         rc = 0;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDor-0004Tf-Kp; Wed, 05 Dec 2012 12:11:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoq-0004Sz-Oi
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:16 +0000
Received: from [85.158.137.99:44336] by server-6.bemta-3.messagelabs.com id
	85/5F-28265-3E93FB05; Wed, 05 Dec 2012 12:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354709473!18034999!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18252 invoked from network); 5 Dec 2012 12:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDon-00044h-Dg
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDon-0007PL-BG
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:13 +0000
Message-Id: <E1TgDon-0007PL-BG@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: fix error handling of
	guest_physmap_mark_populate_on_demand()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646300 0
# Node ID ddf4ead1afda24f7bf3f4ebcc1f7c78061ad1055
# Parent  b406e395995fcf174475e4ca3db21a2d55e627cd
xen: fix error handling of guest_physmap_mark_populate_on_demand()

The only user of the "out" label bypasses a necessary unlock, thus
enabling the caller to lock up Xen.

Also, the function was never meant to be called by a guest for itself,
so rather than inspecting the code paths in depth for potential other
problems this might cause, and adjusting e.g. the non-guest printk()
in the above error path, just disallow the guest access to it.

Finally, the printk() (considering its potential of spamming the log,
the more that it's not using XENLOG_GUEST), is being converted to
P2M_DEBUG(), as debugging is what it apparently was added for in the
first place.

This is XSA-30 / CVE-2012-5514.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r b406e395995f -r ddf4ead1afda xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Tue Dec 04 18:38:14 2012 +0000
+++ b/xen/arch/x86/mm/p2m-pod.c	Tue Dec 04 18:38:20 2012 +0000
@@ -1117,6 +1117,9 @@ guest_physmap_mark_populate_on_demand(st
     mfn_t omfn;
     int rc = 0;
 
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+
     if ( !paging_mode_translate(d) )
         return -EINVAL;
 
@@ -1131,8 +1134,7 @@ guest_physmap_mark_populate_on_demand(st
         omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
         if ( p2m_is_ram(ot) )
         {
-            printk("%s: gfn_to_mfn returned type %d!\n",
-                   __func__, ot);
+            P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
             rc = -EBUSY;
             goto out;
         }
@@ -1156,9 +1158,9 @@ guest_physmap_mark_populate_on_demand(st
         pod_unlock(p2m);
     }
 
+out:
     gfn_unlock(p2m, gfn, order);
 
-out:
     return rc;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDor-0004Tf-Kp; Wed, 05 Dec 2012 12:11:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoq-0004Sz-Oi
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:16 +0000
Received: from [85.158.137.99:44336] by server-6.bemta-3.messagelabs.com id
	85/5F-28265-3E93FB05; Wed, 05 Dec 2012 12:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-217.messagelabs.com!1354709473!18034999!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18252 invoked from network); 5 Dec 2012 12:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDon-00044h-Dg
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDon-0007PL-BG
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:13 +0000
Message-Id: <E1TgDon-0007PL-BG@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: fix error handling of
	guest_physmap_mark_populate_on_demand()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646300 0
# Node ID ddf4ead1afda24f7bf3f4ebcc1f7c78061ad1055
# Parent  b406e395995fcf174475e4ca3db21a2d55e627cd
xen: fix error handling of guest_physmap_mark_populate_on_demand()

The only user of the "out" label bypasses a necessary unlock, thus
enabling the caller to lock up Xen.

Also, the function was never meant to be called by a guest for itself,
so rather than inspecting the code paths in depth for potential other
problems this might cause, and adjusting e.g. the non-guest printk()
in the above error path, just disallow the guest access to it.

Finally, the printk() (considering its potential of spamming the log,
the more that it's not using XENLOG_GUEST), is being converted to
P2M_DEBUG(), as debugging is what it apparently was added for in the
first place.

This is XSA-30 / CVE-2012-5514.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r b406e395995f -r ddf4ead1afda xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Tue Dec 04 18:38:14 2012 +0000
+++ b/xen/arch/x86/mm/p2m-pod.c	Tue Dec 04 18:38:20 2012 +0000
@@ -1117,6 +1117,9 @@ guest_physmap_mark_populate_on_demand(st
     mfn_t omfn;
     int rc = 0;
 
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+
     if ( !paging_mode_translate(d) )
         return -EINVAL;
 
@@ -1131,8 +1134,7 @@ guest_physmap_mark_populate_on_demand(st
         omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
         if ( p2m_is_ram(ot) )
         {
-            printk("%s: gfn_to_mfn returned type %d!\n",
-                   __func__, ot);
+            P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
             rc = -EBUSY;
             goto out;
         }
@@ -1156,9 +1158,9 @@ guest_physmap_mark_populate_on_demand(st
         pod_unlock(p2m);
     }
 
+out:
     gfn_unlock(p2m, gfn, order);
 
-out:
     return rc;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDoq-0004T5-9z; Wed, 05 Dec 2012 12:11:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDop-0004Sa-0w
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:15 +0000
Received: from [85.158.138.51:14169] by server-3.bemta-3.messagelabs.com id
	97/DA-31566-2E93FB05; Wed, 05 Dec 2012 12:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354709469!19620712!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12372 invoked from network); 5 Dec 2012 12:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoj-00044M-Nf
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoi-0007Nb-BN
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:09 +0000
Message-Id: <E1TgDoi-0007Nb-BN@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: expand persistent grants
	protocol
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0563946670896213425=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0563946670896213425==
Content-Type: text/plain

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1354636218 0
# Node ID 49692c28f6d98b0bce0d54549f1d1af6c9b2a0c3
# Parent  29247e44df47d46c21beebdfcea6b3fba7480dff
docs: expand persistent grants protocol

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 29247e44df47 -r 49692c28f6d9 xen/include/public/io/blkif.h
--- a/xen/include/public/io/blkif.h	Fri Nov 30 21:51:17 2012 +0000
+++ b/xen/include/public/io/blkif.h	Tue Dec 04 15:50:18 2012 +0000
@@ -137,7 +137,22 @@
  *      can map persistently depends on the implementation, but ideally it
  *      should be RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST. Using this
  *      feature the backend doesn't need to unmap each grant, preventing
- *      costly TLB flushes.
+ *      costly TLB flushes. The backend driver should only map grants
+ *      persistently if the frontend supports it. If a backend driver chooses
+ *      to use the persistent protocol when the frontend doesn't support it,
+ *      it will probably hit the maximum number of persistently mapped grants
+ *      (due to the fact that the frontend won't be reusing the same grants),
+ *      and fall back to non-persistent mode. Backend implementations may
+ *      shrink or expand the number of persistently mapped grants without
+ *      notifying the frontend depending on memory constraints (this might
+ *      cause a performance degradation).
+ *
+ *      If a backend driver wants to limit the maximum number of persistently
+ *      mapped grants to a value less than RING_SIZE *
+ *      BLKIF_MAX_SEGMENTS_PER_REQUEST a LRU strategy should be used to
+ *      discard the grants that are less commonly used. Using a LRU in the
+ *      backend driver paired with a LIFO queue in the frontend will
+ *      allow us to have better performance in this scenario.
  *
  *----------------------- Request Transport Parameters ------------------------
  *
@@ -258,11 +273,23 @@
  * feature-persistent
  *      Values:         0/1 (boolean)
  *      Default Value:  0
- *      Notes: 7, 8
+ *      Notes: 7, 8, 9
  *
  *      A value of "1" indicates that the frontend will reuse the same grants
  *      for all transactions, allowing the backend to map them with write
- *      access (even when it should be read-only).
+ *      access (even when it should be read-only). If the frontend hits the
+ *      maximum number of allowed persistently mapped grants, it can fallback
+ *      to non persistent mode. This will cause a performance degradation,
+ *      since the the backend driver will still try to map those grants
+ *      persistently. Since the persistent grants protocol is compatible with
+ *      the previous protocol, a frontend driver can choose to work in
+ *      persistent mode even when the backend doesn't support it.
+ *
+ *      It is recommended that the frontend driver stores the persistently
+ *      mapped grants in a LIFO queue, so a subset of all persistently mapped
+ *      grants gets used commonly. This is done in case the backend driver
+ *      decides to limit the maximum number of persistently mapped grants
+ *      to a value less than RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST.
  *
  *------------------------- Virtual Device Properties -------------------------
  *
@@ -308,6 +335,10 @@
  * (8) The frontend driver has to allow the backend driver to map all grants
  *     with write access, even when they should be mapped read-only, since
  *     further requests may reuse these grants and require write permissions.
+ * (9) Linux implementation doesn't have a limit on the maximum number of
+ *     grants that can be persistently mapped in the frontend driver, but
+ *     due to the frontent driver implementation it should never be bigger
+ *     than RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST.
  */
 
 /*


--===============0563946670896213425==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0563946670896213425==--

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDoq-0004T5-9z; Wed, 05 Dec 2012 12:11:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDop-0004Sa-0w
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:15 +0000
Received: from [85.158.138.51:14169] by server-3.bemta-3.messagelabs.com id
	97/DA-31566-2E93FB05; Wed, 05 Dec 2012 12:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1354709469!19620712!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12372 invoked from network); 5 Dec 2012 12:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoj-00044M-Nf
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoi-0007Nb-BN
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:09 +0000
Message-Id: <E1TgDoi-0007Nb-BN@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: expand persistent grants
	protocol
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0563946670896213425=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0563946670896213425==
Content-Type: text/plain

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1354636218 0
# Node ID 49692c28f6d98b0bce0d54549f1d1af6c9b2a0c3
# Parent  29247e44df47d46c21beebdfcea6b3fba7480dff
docs: expand persistent grants protocol

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 29247e44df47 -r 49692c28f6d9 xen/include/public/io/blkif.h
--- a/xen/include/public/io/blkif.h	Fri Nov 30 21:51:17 2012 +0000
+++ b/xen/include/public/io/blkif.h	Tue Dec 04 15:50:18 2012 +0000
@@ -137,7 +137,22 @@
  *      can map persistently depends on the implementation, but ideally it
  *      should be RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST. Using this
  *      feature the backend doesn't need to unmap each grant, preventing
- *      costly TLB flushes.
+ *      costly TLB flushes. The backend driver should only map grants
+ *      persistently if the frontend supports it. If a backend driver chooses
+ *      to use the persistent protocol when the frontend doesn't support it,
+ *      it will probably hit the maximum number of persistently mapped grants
+ *      (due to the fact that the frontend won't be reusing the same grants),
+ *      and fall back to non-persistent mode. Backend implementations may
+ *      shrink or expand the number of persistently mapped grants without
+ *      notifying the frontend depending on memory constraints (this might
+ *      cause a performance degradation).
+ *
+ *      If a backend driver wants to limit the maximum number of persistently
+ *      mapped grants to a value less than RING_SIZE *
+ *      BLKIF_MAX_SEGMENTS_PER_REQUEST a LRU strategy should be used to
+ *      discard the grants that are less commonly used. Using a LRU in the
+ *      backend driver paired with a LIFO queue in the frontend will
+ *      allow us to have better performance in this scenario.
  *
  *----------------------- Request Transport Parameters ------------------------
  *
@@ -258,11 +273,23 @@
  * feature-persistent
  *      Values:         0/1 (boolean)
  *      Default Value:  0
- *      Notes: 7, 8
+ *      Notes: 7, 8, 9
  *
  *      A value of "1" indicates that the frontend will reuse the same grants
  *      for all transactions, allowing the backend to map them with write
- *      access (even when it should be read-only).
+ *      access (even when it should be read-only). If the frontend hits the
+ *      maximum number of allowed persistently mapped grants, it can fallback
+ *      to non persistent mode. This will cause a performance degradation,
+ *      since the the backend driver will still try to map those grants
+ *      persistently. Since the persistent grants protocol is compatible with
+ *      the previous protocol, a frontend driver can choose to work in
+ *      persistent mode even when the backend doesn't support it.
+ *
+ *      It is recommended that the frontend driver stores the persistently
+ *      mapped grants in a LIFO queue, so a subset of all persistently mapped
+ *      grants gets used commonly. This is done in case the backend driver
+ *      decides to limit the maximum number of persistently mapped grants
+ *      to a value less than RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST.
  *
  *------------------------- Virtual Device Properties -------------------------
  *
@@ -308,6 +335,10 @@
  * (8) The frontend driver has to allow the backend driver to map all grants
  *     with write access, even when they should be mapped read-only, since
  *     further requests may reuse these grants and require write permissions.
+ * (9) Linux implementation doesn't have a limit on the maximum number of
+ *     grants that can be persistently mapped in the frontend driver, but
+ *     due to the frontent driver implementation it should never be bigger
+ *     than RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST.
  */
 
 /*


--===============0563946670896213425==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0563946670896213425==--

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDos-0004U7-Ne; Wed, 05 Dec 2012 12:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoq-0004T4-QN
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:17 +0000
Received: from [85.158.139.211:59579] by server-16.bemta-5.messagelabs.com id
	5F/43-21311-4E93FB05; Wed, 05 Dec 2012 12:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354709474!14938350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32249 invoked from network); 5 Dec 2012 12:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDon-00044k-Ut
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDon-0007Pa-T0
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:13 +0000
Message-Id: <E1TgDon-0007Pa-T0@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] memop: limit guest specified extent
	order
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646306 0
# Node ID f2c836302c0fc21a58b307a4cd7418734f1f721e
# Parent  ddf4ead1afda24f7bf3f4ebcc1f7c78061ad1055
memop: limit guest specified extent order

Allowing unbounded order values here causes almost unbounded loops
and/or partially incomplete requests, particularly in PoD code.

The added range checks in populate_physmap(), decrease_reservation(),
and the "in" one in memory_exchange() architecturally all could use
PADDR_BITS - PAGE_SHIFT, and are being artificially constrained to
MAX_ORDER.

This is XSA-31 / CVE-2012-5515.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r ddf4ead1afda -r f2c836302c0f xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:38:20 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:38:26 2012 +0000
@@ -115,7 +115,8 @@ static void populate_physmap(struct memo
 
         if ( a->memflags & MEMF_populate_on_demand )
         {
-            if ( guest_physmap_mark_populate_on_demand(d, gpfn,
+            if ( a->extent_order > MAX_ORDER ||
+                 guest_physmap_mark_populate_on_demand(d, gpfn,
                                                        a->extent_order) < 0 )
                 goto out;
         }
@@ -235,7 +236,8 @@ static void decrease_reservation(struct 
     xen_pfn_t gmfn;
 
     if ( !guest_handle_subrange_okay(a->extent_list, a->nr_done,
-                                     a->nr_extents-1) )
+                                     a->nr_extents-1) ||
+         a->extent_order > MAX_ORDER )
         return;
 
     for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -297,6 +299,9 @@ static long memory_exchange(XEN_GUEST_HA
     if ( (exch.nr_exchanged > exch.in.nr_extents) ||
          /* Input and output domain identifiers match? */
          (exch.in.domid != exch.out.domid) ||
+         /* Extent orders are sensible? */
+         (exch.in.extent_order > MAX_ORDER) ||
+         (exch.out.extent_order > MAX_ORDER) ||
          /* Sizes of input and output lists do not overflow a long? */
          ((~0UL >> exch.in.extent_order) < exch.in.nr_extents) ||
          ((~0UL >> exch.out.extent_order) < exch.out.nr_extents) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDos-0004U7-Ne; Wed, 05 Dec 2012 12:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoq-0004T4-QN
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:17 +0000
Received: from [85.158.139.211:59579] by server-16.bemta-5.messagelabs.com id
	5F/43-21311-4E93FB05; Wed, 05 Dec 2012 12:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-206.messagelabs.com!1354709474!14938350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32249 invoked from network); 5 Dec 2012 12:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDon-00044k-Ut
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDon-0007Pa-T0
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:13 +0000
Message-Id: <E1TgDon-0007Pa-T0@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] memop: limit guest specified extent
	order
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646306 0
# Node ID f2c836302c0fc21a58b307a4cd7418734f1f721e
# Parent  ddf4ead1afda24f7bf3f4ebcc1f7c78061ad1055
memop: limit guest specified extent order

Allowing unbounded order values here causes almost unbounded loops
and/or partially incomplete requests, particularly in PoD code.

The added range checks in populate_physmap(), decrease_reservation(),
and the "in" one in memory_exchange() architecturally all could use
PADDR_BITS - PAGE_SHIFT, and are being artificially constrained to
MAX_ORDER.

This is XSA-31 / CVE-2012-5515.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r ddf4ead1afda -r f2c836302c0f xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:38:20 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:38:26 2012 +0000
@@ -115,7 +115,8 @@ static void populate_physmap(struct memo
 
         if ( a->memflags & MEMF_populate_on_demand )
         {
-            if ( guest_physmap_mark_populate_on_demand(d, gpfn,
+            if ( a->extent_order > MAX_ORDER ||
+                 guest_physmap_mark_populate_on_demand(d, gpfn,
                                                        a->extent_order) < 0 )
                 goto out;
         }
@@ -235,7 +236,8 @@ static void decrease_reservation(struct 
     xen_pfn_t gmfn;
 
     if ( !guest_handle_subrange_okay(a->extent_list, a->nr_done,
-                                     a->nr_extents-1) )
+                                     a->nr_extents-1) ||
+         a->extent_order > MAX_ORDER )
         return;
 
     for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -297,6 +299,9 @@ static long memory_exchange(XEN_GUEST_HA
     if ( (exch.nr_exchanged > exch.in.nr_extents) ||
          /* Input and output domain identifiers match? */
          (exch.in.domid != exch.out.domid) ||
+         /* Extent orders are sensible? */
+         (exch.in.extent_order > MAX_ORDER) ||
+         (exch.out.extent_order > MAX_ORDER) ||
          /* Sizes of input and output lists do not overflow a long? */
          ((~0UL >> exch.in.extent_order) < exch.in.nr_extents) ||
          ((~0UL >> exch.out.extent_order) < exch.out.nr_extents) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDos-0004UF-UA; Wed, 05 Dec 2012 12:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDor-0004TR-IY
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:17 +0000
Received: from [85.158.139.83:37858] by server-4.bemta-5.messagelabs.com id
	00/38-15011-4E93FB05; Wed, 05 Dec 2012 12:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1354709474!27953857!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25368 invoked from network); 5 Dec 2012 12:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoo-00044n-Ex
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoo-0007Pp-DU
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:14 +0000
Message-Id: <E1TgDoo-0007Pp-DU@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: get_page_from_gfn() must return
	NULL for invalid GFNs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646311 0
# Node ID bc624b00d6d601f00a53c2f7502a82dcef60f882
# Parent  f2c836302c0fc21a58b307a4cd7418734f1f721e
x86: get_page_from_gfn() must return NULL for invalid GFNs

... also in the non-translated case.

This is XSA-32 / CVE-2012-xxxx.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f2c836302c0f -r bc624b00d6d6 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Tue Dec 04 18:38:26 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Tue Dec 04 18:38:31 2012 +0000
@@ -384,7 +384,7 @@ static inline struct page_info *get_page
     if (t)
         *t = p2m_ram_rw;
     page = __mfn_to_page(gfn);
-    return get_page(page, d) ? page : NULL;
+    return mfn_valid(gfn) && get_page(page, d) ? page : NULL;
 }
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDos-0004UF-UA; Wed, 05 Dec 2012 12:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDor-0004TR-IY
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:17 +0000
Received: from [85.158.139.83:37858] by server-4.bemta-5.messagelabs.com id
	00/38-15011-4E93FB05; Wed, 05 Dec 2012 12:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1354709474!27953857!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25368 invoked from network); 5 Dec 2012 12:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoo-00044n-Ex
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoo-0007Pp-DU
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:14 +0000
Message-Id: <E1TgDoo-0007Pp-DU@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: get_page_from_gfn() must return
	NULL for invalid GFNs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646311 0
# Node ID bc624b00d6d601f00a53c2f7502a82dcef60f882
# Parent  f2c836302c0fc21a58b307a4cd7418734f1f721e
x86: get_page_from_gfn() must return NULL for invalid GFNs

... also in the non-translated case.

This is XSA-32 / CVE-2012-xxxx.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f2c836302c0f -r bc624b00d6d6 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Tue Dec 04 18:38:26 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Tue Dec 04 18:38:31 2012 +0000
@@ -384,7 +384,7 @@ static inline struct page_info *get_page
     if (t)
         *t = p2m_ram_rw;
     page = __mfn_to_page(gfn);
-    return get_page(page, d) ? page : NULL;
+    return mfn_valid(gfn) && get_page(page, d) ? page : NULL;
 }
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDp5-0004Ys-5j; Wed, 05 Dec 2012 12:11:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDp3-0004YL-2g
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:29 +0000
Received: from [85.158.143.99:45314] by server-1.bemta-4.messagelabs.com id
	94/36-27934-0F93FB05; Wed, 05 Dec 2012 12:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1354709471!21117327!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28119 invoked from network); 5 Dec 2012 12:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDol-00044V-7w
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDol-0007OL-5M
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:11 +0000
Message-Id: <E1TgDol-0007OL-5M@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Check for duplicate vncdisplay
	options, and return an error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354636220 0
# Node ID eb2394c97d57939da0e810f3f86a948ea56580e2
# Parent  36d5d8ee5643e49ca205704a2999a5b2df4b8fd6
xl: Check for duplicate vncdisplay options, and return an error

If the user has set a vnc display number both in vnclisten (with
"xxxx:yy"), and with vncdisplay, throw an error.

Update man pages to match.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 36d5d8ee5643 -r eb2394c97d57 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Tue Dec 04 15:50:19 2012 +0000
+++ b/docs/man/xl.cfg.pod.5	Tue Dec 04 15:50:20 2012 +0000
@@ -350,11 +350,17 @@ other VNC-related settings.  The default
 
 Specifies the IP address, and optionally VNC display number, to use.
 
+NB that if you specify the display number here, you should not use
+vncdisplay.
+
 =item C<vncdisplay=DISPLAYNUM>
 
 Specifies the VNC display number to use.  The actual TCP port number
 will be DISPLAYNUM+5900.
 
+NB that you should not use this option if you set the displaynum in the
+vnclisten string.
+
 =item C<vncunused=BOOLEAN>
 
 Requests that the VNC display setup search for a free TCP port to use.
diff -r 36d5d8ee5643 -r eb2394c97d57 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Dec 04 15:50:19 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Dec 04 15:50:20 2012 +0000
@@ -1257,6 +1257,7 @@ skip_nic:
                     vfb->sdl.xauthority = strdup(p2 + 1);
                 }
             } while ((p = strtok(NULL, ",")) != NULL);
+
 skip_vfb:
             free(buf2);
             d_config->num_vfbs++;
@@ -1490,6 +1491,16 @@ skip_vfb:
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);
+
+        if(b_info->u.hvm.vnc.listen
+           && b_info->u.hvm.vnc.display
+           && strchr(b_info->u.hvm.vnc.listen, ':') != NULL) {
+            fprintf(stderr,
+                    "ERROR: Display specified both in vnclisten"
+                    " and vncdisplay!\n");
+            exit (1);
+
+        }
     }
 
     xlu_cfg_destroy(config);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDp5-0004Ys-5j; Wed, 05 Dec 2012 12:11:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDp3-0004YL-2g
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:29 +0000
Received: from [85.158.143.99:45314] by server-1.bemta-4.messagelabs.com id
	94/36-27934-0F93FB05; Wed, 05 Dec 2012 12:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1354709471!21117327!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28119 invoked from network); 5 Dec 2012 12:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDol-00044V-7w
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDol-0007OL-5M
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:11 +0000
Message-Id: <E1TgDol-0007OL-5M@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Check for duplicate vncdisplay
	options, and return an error
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354636220 0
# Node ID eb2394c97d57939da0e810f3f86a948ea56580e2
# Parent  36d5d8ee5643e49ca205704a2999a5b2df4b8fd6
xl: Check for duplicate vncdisplay options, and return an error

If the user has set a vnc display number both in vnclisten (with
"xxxx:yy"), and with vncdisplay, throw an error.

Update man pages to match.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 36d5d8ee5643 -r eb2394c97d57 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Tue Dec 04 15:50:19 2012 +0000
+++ b/docs/man/xl.cfg.pod.5	Tue Dec 04 15:50:20 2012 +0000
@@ -350,11 +350,17 @@ other VNC-related settings.  The default
 
 Specifies the IP address, and optionally VNC display number, to use.
 
+NB that if you specify the display number here, you should not use
+vncdisplay.
+
 =item C<vncdisplay=DISPLAYNUM>
 
 Specifies the VNC display number to use.  The actual TCP port number
 will be DISPLAYNUM+5900.
 
+NB that you should not use this option if you set the displaynum in the
+vnclisten string.
+
 =item C<vncunused=BOOLEAN>
 
 Requests that the VNC display setup search for a free TCP port to use.
diff -r 36d5d8ee5643 -r eb2394c97d57 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Dec 04 15:50:19 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Dec 04 15:50:20 2012 +0000
@@ -1257,6 +1257,7 @@ skip_nic:
                     vfb->sdl.xauthority = strdup(p2 + 1);
                 }
             } while ((p = strtok(NULL, ",")) != NULL);
+
 skip_vfb:
             free(buf2);
             d_config->num_vfbs++;
@@ -1490,6 +1491,16 @@ skip_vfb:
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);
+
+        if(b_info->u.hvm.vnc.listen
+           && b_info->u.hvm.vnc.display
+           && strchr(b_info->u.hvm.vnc.listen, ':') != NULL) {
+            fprintf(stderr,
+                    "ERROR: Display specified both in vnclisten"
+                    " and vncdisplay!\n");
+            exit (1);
+
+        }
     }
 
     xlu_cfg_destroy(config);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:57 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDpT-0004hJ-PC; Wed, 05 Dec 2012 12:11:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDpS-0004gf-C4
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:54 +0000
Received: from [85.158.143.35:18281] by server-3.bemta-4.messagelabs.com id
	2F/E9-06841-90A3FB05; Wed, 05 Dec 2012 12:11:53 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354709470!13183747!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20447 invoked from network); 5 Dec 2012 12:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDok-00044P-CB
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoj-0007Nr-W2
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:10 +0000
Message-Id: <E1TgDoj-0007Nr-W2@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix wrong comment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6323462071216544769=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6323462071216544769==
Content-Type: text/plain

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1354636218 0
# Node ID 2ddd5138eca731853bd72c815511b081831d9fde
# Parent  49692c28f6d98b0bce0d54549f1d1af6c9b2a0c3
libxl: fix wrong comment

The comment in function libxl__try_phy_backend is wrong, 1 is returned
if the backend should be handled as "phy", while 0 is returned if not.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 49692c28f6d9 -r 2ddd5138eca7 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Tue Dec 04 15:50:18 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Tue Dec 04 15:50:18 2012 +0000
@@ -1041,7 +1041,7 @@ static inline void libxl__domaindeathche
  * type of file using the PHY backend
  * st_mode: mode_t of the file, as returned by stat function
  *
- * Returns 0 on success, and < 0 on error.
+ * Returns 1 on success, and 0 if not suitable for phy backend.
  */
 _hidden int libxl__try_phy_backend(mode_t st_mode);
 


--===============6323462071216544769==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============6323462071216544769==--

From xen-changelog-bounces@lists.xen.org Wed Dec 05 12:11:57 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 12:11:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgDpT-0004hJ-PC; Wed, 05 Dec 2012 12:11:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDpS-0004gf-C4
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:54 +0000
Received: from [85.158.143.35:18281] by server-3.bemta-4.messagelabs.com id
	2F/E9-06841-90A3FB05; Wed, 05 Dec 2012 12:11:53 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1354709470!13183747!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20447 invoked from network); 5 Dec 2012 12:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 12:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDok-00044P-CB
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgDoj-0007Nr-W2
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 12:11:10 +0000
Message-Id: <E1TgDoj-0007Nr-W2@xenbits.xen.org>
Date: Wed, 05 Dec 2012 12:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix wrong comment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6323462071216544769=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6323462071216544769==
Content-Type: text/plain

# HG changeset patch
# User Roger Pau Monne <roger.pau@citrix.com>
# Date 1354636218 0
# Node ID 2ddd5138eca731853bd72c815511b081831d9fde
# Parent  49692c28f6d98b0bce0d54549f1d1af6c9b2a0c3
libxl: fix wrong comment

The comment in function libxl__try_phy_backend is wrong, 1 is returned
if the backend should be handled as "phy", while 0 is returned if not.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 49692c28f6d9 -r 2ddd5138eca7 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Tue Dec 04 15:50:18 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Tue Dec 04 15:50:18 2012 +0000
@@ -1041,7 +1041,7 @@ static inline void libxl__domaindeathche
  * type of file using the PHY backend
  * st_mode: mode_t of the file, as returned by stat function
  *
- * Returns 0 on success, and < 0 on error.
+ * Returns 1 on success, and 0 if not suitable for phy backend.
  */
 _hidden int libxl__try_phy_backend(mode_t st_mode);
 


--===============6323462071216544769==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============6323462071216544769==--

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:55:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHJb-0006La-SN; Wed, 05 Dec 2012 15:55:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJa-0006LU-Cv
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:14 +0000
Received: from [85.158.139.211:6440] by server-11.bemta-5.messagelabs.com id
	14/E6-03409-16E6FB05; Wed, 05 Dec 2012 15:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354722911!19209181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25535 invoked from network); 5 Dec 2012 15:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJW-0006Xc-Vs
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJW-00054t-Df
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:10 +0000
Message-Id: <E1TgHJW-00054t-Df@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] gnttab: fix releasing of memory
	upon switches between versions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646982 0
# Node ID 7172203aec98fdb36b1b24aa27f09a3e50356fca
# Parent  d89986111f0c40467072556c1cd1813924ff8dc1
gnttab: fix releasing of memory upon switches between versions

gnttab_unpopulate_status_frames() incompletely freed the pages
previously used as status frame in that they did not get removed from
the domain's xenpage_list, thus causing subsequent list corruption
when those pages did get allocated again for the same or another purpose.

Similarly, grant_table_create() and gnttab_grow_table() both improperly
clean up in the event of an error - pages already shared with the guest
can't be freed by just passing them to free_xenheap_page(). Fix this by
sharing the pages only after all allocations succeeded.

This is CVE-2012-5510 / XSA-26.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r d89986111f0c -r 7172203aec98 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Tue Nov 27 13:28:36 2012 +0100
+++ b/xen/common/grant_table.c	Tue Dec 04 18:49:42 2012 +0000
@@ -1126,12 +1126,13 @@ fault:
 }
 
 static int
-gnttab_populate_status_frames(struct domain *d, struct grant_table *gt)
+gnttab_populate_status_frames(struct domain *d, struct grant_table *gt,
+                              unsigned int req_nr_frames)
 {
     unsigned i;
     unsigned req_status_frames;
 
-    req_status_frames = grant_to_status_frames(gt->nr_grant_frames);
+    req_status_frames = grant_to_status_frames(req_nr_frames);
     for ( i = nr_status_frames(gt); i < req_status_frames; i++ )
     {
         if ( (gt->status[i] = alloc_xenheap_page()) == NULL )
@@ -1162,7 +1163,12 @@ gnttab_unpopulate_status_frames(struct d
 
     for ( i = 0; i < nr_status_frames(gt); i++ )
     {
-        page_set_owner(virt_to_page(gt->status[i]), dom_xen);
+        struct page_info *pg = virt_to_page(gt->status[i]);
+
+        BUG_ON(page_get_owner(pg) != d);
+        if ( test_and_clear_bit(_PGC_allocated, &pg->count_info) )
+            put_page(pg);
+        BUG_ON(pg->count_info & ~PGC_xen_heap);
         free_xenheap_page(gt->status[i]);
         gt->status[i] = NULL;
     }
@@ -1200,19 +1206,18 @@ gnttab_grow_table(struct domain *d, unsi
         clear_page(gt->shared_raw[i]);
     }
 
+    /* Status pages - version 2 */
+    if (gt->gt_version > 1)
+    {
+        if ( gnttab_populate_status_frames(d, gt, req_nr_frames) )
+            goto shared_alloc_failed;
+    }
+
     /* Share the new shared frames with the recipient domain */
     for ( i = nr_grant_frames(gt); i < req_nr_frames; i++ )
         gnttab_create_shared_page(d, gt, i);
-
     gt->nr_grant_frames = req_nr_frames;
 
-    /* Status pages - version 2 */
-    if (gt->gt_version > 1)
-    {
-        if ( gnttab_populate_status_frames(d, gt) )
-            goto shared_alloc_failed;
-    }
-
     return 1;
 
 shared_alloc_failed:
@@ -2134,7 +2139,7 @@ gnttab_set_version(XEN_GUEST_HANDLE(gntt
 
     if ( op.version == 2 && gt->gt_version < 2 )
     {
-        res = gnttab_populate_status_frames(d, gt);
+        res = gnttab_populate_status_frames(d, gt, nr_grant_frames(gt));
         if ( res < 0)
             goto out_unlock;
     }
@@ -2449,9 +2454,6 @@ grant_table_create(
         clear_page(t->shared_raw[i]);
     }
     
-    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
-        gnttab_create_shared_page(d, t, i);
-
     /* Status pages for grant table - for version 2 */
     t->status = xmalloc_array(grant_status_t *,
                               grant_to_status_frames(max_nr_grant_frames));
@@ -2459,6 +2461,10 @@ grant_table_create(
         goto no_mem_4;
     memset(t->status, 0,
            grant_to_status_frames(max_nr_grant_frames) * sizeof(t->status[0]));
+
+    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
+        gnttab_create_shared_page(d, t, i);
+
     t->nr_status_frames = 0;
 
     /* Okay, install the structure. */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:55:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:55:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHJb-0006La-SN; Wed, 05 Dec 2012 15:55:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJa-0006LU-Cv
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:14 +0000
Received: from [85.158.139.211:6440] by server-11.bemta-5.messagelabs.com id
	14/E6-03409-16E6FB05; Wed, 05 Dec 2012 15:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354722911!19209181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25535 invoked from network); 5 Dec 2012 15:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJW-0006Xc-Vs
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJW-00054t-Df
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:10 +0000
Message-Id: <E1TgHJW-00054t-Df@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] gnttab: fix releasing of memory
	upon switches between versions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646982 0
# Node ID 7172203aec98fdb36b1b24aa27f09a3e50356fca
# Parent  d89986111f0c40467072556c1cd1813924ff8dc1
gnttab: fix releasing of memory upon switches between versions

gnttab_unpopulate_status_frames() incompletely freed the pages
previously used as status frame in that they did not get removed from
the domain's xenpage_list, thus causing subsequent list corruption
when those pages did get allocated again for the same or another purpose.

Similarly, grant_table_create() and gnttab_grow_table() both improperly
clean up in the event of an error - pages already shared with the guest
can't be freed by just passing them to free_xenheap_page(). Fix this by
sharing the pages only after all allocations succeeded.

This is CVE-2012-5510 / XSA-26.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r d89986111f0c -r 7172203aec98 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Tue Nov 27 13:28:36 2012 +0100
+++ b/xen/common/grant_table.c	Tue Dec 04 18:49:42 2012 +0000
@@ -1126,12 +1126,13 @@ fault:
 }
 
 static int
-gnttab_populate_status_frames(struct domain *d, struct grant_table *gt)
+gnttab_populate_status_frames(struct domain *d, struct grant_table *gt,
+                              unsigned int req_nr_frames)
 {
     unsigned i;
     unsigned req_status_frames;
 
-    req_status_frames = grant_to_status_frames(gt->nr_grant_frames);
+    req_status_frames = grant_to_status_frames(req_nr_frames);
     for ( i = nr_status_frames(gt); i < req_status_frames; i++ )
     {
         if ( (gt->status[i] = alloc_xenheap_page()) == NULL )
@@ -1162,7 +1163,12 @@ gnttab_unpopulate_status_frames(struct d
 
     for ( i = 0; i < nr_status_frames(gt); i++ )
     {
-        page_set_owner(virt_to_page(gt->status[i]), dom_xen);
+        struct page_info *pg = virt_to_page(gt->status[i]);
+
+        BUG_ON(page_get_owner(pg) != d);
+        if ( test_and_clear_bit(_PGC_allocated, &pg->count_info) )
+            put_page(pg);
+        BUG_ON(pg->count_info & ~PGC_xen_heap);
         free_xenheap_page(gt->status[i]);
         gt->status[i] = NULL;
     }
@@ -1200,19 +1206,18 @@ gnttab_grow_table(struct domain *d, unsi
         clear_page(gt->shared_raw[i]);
     }
 
+    /* Status pages - version 2 */
+    if (gt->gt_version > 1)
+    {
+        if ( gnttab_populate_status_frames(d, gt, req_nr_frames) )
+            goto shared_alloc_failed;
+    }
+
     /* Share the new shared frames with the recipient domain */
     for ( i = nr_grant_frames(gt); i < req_nr_frames; i++ )
         gnttab_create_shared_page(d, gt, i);
-
     gt->nr_grant_frames = req_nr_frames;
 
-    /* Status pages - version 2 */
-    if (gt->gt_version > 1)
-    {
-        if ( gnttab_populate_status_frames(d, gt) )
-            goto shared_alloc_failed;
-    }
-
     return 1;
 
 shared_alloc_failed:
@@ -2134,7 +2139,7 @@ gnttab_set_version(XEN_GUEST_HANDLE(gntt
 
     if ( op.version == 2 && gt->gt_version < 2 )
     {
-        res = gnttab_populate_status_frames(d, gt);
+        res = gnttab_populate_status_frames(d, gt, nr_grant_frames(gt));
         if ( res < 0)
             goto out_unlock;
     }
@@ -2449,9 +2454,6 @@ grant_table_create(
         clear_page(t->shared_raw[i]);
     }
     
-    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
-        gnttab_create_shared_page(d, t, i);
-
     /* Status pages for grant table - for version 2 */
     t->status = xmalloc_array(grant_status_t *,
                               grant_to_status_frames(max_nr_grant_frames));
@@ -2459,6 +2461,10 @@ grant_table_create(
         goto no_mem_4;
     memset(t->status, 0,
            grant_to_status_frames(max_nr_grant_frames) * sizeof(t->status[0]));
+
+    for ( i = 0; i < INITIAL_NR_GRANT_FRAMES; i++ )
+        gnttab_create_shared_page(d, t, i);
+
     t->nr_status_frames = 0;
 
     /* Okay, install the structure. */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHJc-0006Ll-V7; Wed, 05 Dec 2012 15:55:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJb-0006LZ-Gn
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:15 +0000
Received: from [85.158.139.211:6504] by server-5.bemta-5.messagelabs.com id
	90/72-11353-26E6FB05; Wed, 05 Dec 2012 15:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354722911!19209182!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25562 invoked from network); 5 Dec 2012 15:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJX-0006Xf-He
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJX-00055A-5T
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:11 +0000
Message-Id: <E1TgHJX-00055A-5T@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] hvm: Limit the size of large HVM
	op batches
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1354646989 0
# Node ID 53ef1f35a0f8cf91c69717c015549532bc6aebe9
# Parent  7172203aec98fdb36b1b24aa27f09a3e50356fca
hvm: Limit the size of large HVM op batches

Doing large p2m updates for HVMOP_track_dirty_vram without preemption
ties up the physical processor. Integrating preemption into the p2m
updates is hard so simply limit to 1GB which is sufficient for a 15000
* 15000 * 32bpp framebuffer.

For HVMOP_modified_memory and HVMOP_set_mem_type preemptible add the
necessary machinery to handle preemption.

This is CVE-2012-5511 / XSA-27.

Signed-off-by: Tim Deegan <tim@xen.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>

x86/paging: Don't allocate user-controlled amounts of stack memory.

This is XSA-27 / CVE-2012-5511.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
v2: Provide definition of GB to fix x86-32 compile.

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 7172203aec98 -r 53ef1f35a0f8 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:49:42 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:49:49 2012 +0000
@@ -3471,6 +3471,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
+        if ( a.nr > GB(1) >> PAGE_SHIFT )
+            goto param_fail2;
+
         rc = xsm_hvm_param(d, op);
         if ( rc )
             goto param_fail2;
@@ -3498,7 +3501,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
         struct xen_hvm_modified_memory a;
         struct domain *d;
         struct p2m_domain *p2m;
-        unsigned long pfn;
 
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
@@ -3526,8 +3528,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
             goto param_fail3;
 
         p2m = p2m_get_hostp2m(d);
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr > 0 )
         {
+            unsigned long pfn = a.first_pfn;
             p2m_type_t t;
             mfn_t mfn = gfn_to_mfn(p2m, pfn, &t);
             if ( p2m_is_paging(t) )
@@ -3548,6 +3551,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 /* don't take a long time and don't die either */
                 sh_remove_shadows(d->vcpu[0], mfn, 1, 0);
             }
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                break;
+            }
         }
 
     param_fail3:
@@ -3595,7 +3611,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
         struct xen_hvm_set_mem_type a;
         struct domain *d;
         struct p2m_domain *p2m;
-        unsigned long pfn;
         
         /* Interface types to internal p2m types */
         p2m_type_t memtype[] = {
@@ -3625,8 +3640,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
             goto param_fail4;
 
         p2m = p2m_get_hostp2m(d);
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr > 0 )
         {
+            unsigned long pfn = a.first_pfn;
             p2m_type_t t;
             p2m_type_t nt;
             mfn_t mfn;
@@ -3662,6 +3678,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                     goto param_fail4;
                 }
             }
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                goto param_fail4;
+            }
         }
 
         rc = 0;
diff -r 7172203aec98 -r 53ef1f35a0f8 xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Tue Dec 04 18:49:42 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Tue Dec 04 18:49:49 2012 +0000
@@ -529,13 +529,18 @@ int paging_log_dirty_range(struct domain
 
     if ( !d->arch.paging.log_dirty.fault_count &&
          !d->arch.paging.log_dirty.dirty_count ) {
-        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
-        unsigned long zeroes[size];
-        memset(zeroes, 0x00, size * BYTES_PER_LONG);
+        static uint8_t zeroes[PAGE_SIZE];
+        int off, size;
+
+        size = ((nr + BITS_PER_LONG - 1) / BITS_PER_LONG) * sizeof (long);
         rv = 0;
-        if ( copy_to_guest_offset(dirty_bitmap, 0, (uint8_t *) zeroes,
-                                  size * BYTES_PER_LONG) != 0 )
-            rv = -EFAULT;
+        for ( off = 0; !rv && off < size; off += sizeof zeroes )
+        {
+            int todo = min(size - off, (int) PAGE_SIZE);
+            if ( copy_to_guest_offset(dirty_bitmap, off, zeroes, todo) )
+                rv = -EFAULT;
+            off += todo;
+        }
         goto out;
     }
     d->arch.paging.log_dirty.fault_count = 0;
diff -r 7172203aec98 -r 53ef1f35a0f8 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Tue Dec 04 18:49:42 2012 +0000
+++ b/xen/include/asm-x86/config.h	Tue Dec 04 18:49:49 2012 +0000
@@ -108,6 +108,9 @@ extern unsigned int trampoline_xen_phys_
 extern unsigned char trampoline_cpu_started;
 extern char wakeup_start[];
 extern unsigned int video_mode, video_flags;
+
+#define GB(_gb) (_gb ## UL << 30)
+
 #endif
 
 #define asmlinkage
@@ -123,7 +126,6 @@ extern unsigned int video_mode, video_fl
 #define PML4_ADDR(_slot)                             \
     ((((_slot ## UL) >> 8) * 0xffff000000000000UL) | \
      (_slot ## UL << PML4_ENTRY_BITS))
-#define GB(_gb) (_gb ## UL << 30)
 #else
 #define PML4_ENTRY_BYTES (1 << PML4_ENTRY_BITS)
 #define PML4_ADDR(_slot)                             \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHJc-0006Ll-V7; Wed, 05 Dec 2012 15:55:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJb-0006LZ-Gn
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:15 +0000
Received: from [85.158.139.211:6504] by server-5.bemta-5.messagelabs.com id
	90/72-11353-26E6FB05; Wed, 05 Dec 2012 15:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-206.messagelabs.com!1354722911!19209182!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25562 invoked from network); 5 Dec 2012 15:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJX-0006Xf-He
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJX-00055A-5T
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:11 +0000
Message-Id: <E1TgHJX-00055A-5T@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] hvm: Limit the size of large HVM
	op batches
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Tim Deegan <tim@xen.org>
# Date 1354646989 0
# Node ID 53ef1f35a0f8cf91c69717c015549532bc6aebe9
# Parent  7172203aec98fdb36b1b24aa27f09a3e50356fca
hvm: Limit the size of large HVM op batches

Doing large p2m updates for HVMOP_track_dirty_vram without preemption
ties up the physical processor. Integrating preemption into the p2m
updates is hard so simply limit to 1GB which is sufficient for a 15000
* 15000 * 32bpp framebuffer.

For HVMOP_modified_memory and HVMOP_set_mem_type preemptible add the
necessary machinery to handle preemption.

This is CVE-2012-5511 / XSA-27.

Signed-off-by: Tim Deegan <tim@xen.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>

x86/paging: Don't allocate user-controlled amounts of stack memory.

This is XSA-27 / CVE-2012-5511.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
v2: Provide definition of GB to fix x86-32 compile.

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 7172203aec98 -r 53ef1f35a0f8 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:49:42 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:49:49 2012 +0000
@@ -3471,6 +3471,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
         if ( !is_hvm_domain(d) )
             goto param_fail2;
 
+        if ( a.nr > GB(1) >> PAGE_SHIFT )
+            goto param_fail2;
+
         rc = xsm_hvm_param(d, op);
         if ( rc )
             goto param_fail2;
@@ -3498,7 +3501,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
         struct xen_hvm_modified_memory a;
         struct domain *d;
         struct p2m_domain *p2m;
-        unsigned long pfn;
 
         if ( copy_from_guest(&a, arg, 1) )
             return -EFAULT;
@@ -3526,8 +3528,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
             goto param_fail3;
 
         p2m = p2m_get_hostp2m(d);
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr > 0 )
         {
+            unsigned long pfn = a.first_pfn;
             p2m_type_t t;
             mfn_t mfn = gfn_to_mfn(p2m, pfn, &t);
             if ( p2m_is_paging(t) )
@@ -3548,6 +3551,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                 /* don't take a long time and don't die either */
                 sh_remove_shadows(d->vcpu[0], mfn, 1, 0);
             }
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                break;
+            }
         }
 
     param_fail3:
@@ -3595,7 +3611,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
         struct xen_hvm_set_mem_type a;
         struct domain *d;
         struct p2m_domain *p2m;
-        unsigned long pfn;
         
         /* Interface types to internal p2m types */
         p2m_type_t memtype[] = {
@@ -3625,8 +3640,9 @@ long do_hvm_op(unsigned long op, XEN_GUE
             goto param_fail4;
 
         p2m = p2m_get_hostp2m(d);
-        for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
+        while ( a.nr > 0 )
         {
+            unsigned long pfn = a.first_pfn;
             p2m_type_t t;
             p2m_type_t nt;
             mfn_t mfn;
@@ -3662,6 +3678,19 @@ long do_hvm_op(unsigned long op, XEN_GUE
                     goto param_fail4;
                 }
             }
+
+            a.first_pfn++;
+            a.nr--;
+
+            /* Check for continuation if it's not the last interation */
+            if ( a.nr > 0 && hypercall_preempt_check() )
+            {
+                if ( copy_to_guest(arg, &a, 1) )
+                    rc = -EFAULT;
+                else
+                    rc = -EAGAIN;
+                goto param_fail4;
+            }
         }
 
         rc = 0;
diff -r 7172203aec98 -r 53ef1f35a0f8 xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Tue Dec 04 18:49:42 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Tue Dec 04 18:49:49 2012 +0000
@@ -529,13 +529,18 @@ int paging_log_dirty_range(struct domain
 
     if ( !d->arch.paging.log_dirty.fault_count &&
          !d->arch.paging.log_dirty.dirty_count ) {
-        int size = (nr + BITS_PER_LONG - 1) / BITS_PER_LONG;
-        unsigned long zeroes[size];
-        memset(zeroes, 0x00, size * BYTES_PER_LONG);
+        static uint8_t zeroes[PAGE_SIZE];
+        int off, size;
+
+        size = ((nr + BITS_PER_LONG - 1) / BITS_PER_LONG) * sizeof (long);
         rv = 0;
-        if ( copy_to_guest_offset(dirty_bitmap, 0, (uint8_t *) zeroes,
-                                  size * BYTES_PER_LONG) != 0 )
-            rv = -EFAULT;
+        for ( off = 0; !rv && off < size; off += sizeof zeroes )
+        {
+            int todo = min(size - off, (int) PAGE_SIZE);
+            if ( copy_to_guest_offset(dirty_bitmap, off, zeroes, todo) )
+                rv = -EFAULT;
+            off += todo;
+        }
         goto out;
     }
     d->arch.paging.log_dirty.fault_count = 0;
diff -r 7172203aec98 -r 53ef1f35a0f8 xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Tue Dec 04 18:49:42 2012 +0000
+++ b/xen/include/asm-x86/config.h	Tue Dec 04 18:49:49 2012 +0000
@@ -108,6 +108,9 @@ extern unsigned int trampoline_xen_phys_
 extern unsigned char trampoline_cpu_started;
 extern char wakeup_start[];
 extern unsigned int video_mode, video_flags;
+
+#define GB(_gb) (_gb ## UL << 30)
+
 #endif
 
 #define asmlinkage
@@ -123,7 +126,6 @@ extern unsigned int video_mode, video_fl
 #define PML4_ADDR(_slot)                             \
     ((((_slot ## UL) >> 8) * 0xffff000000000000UL) | \
      (_slot ## UL << PML4_ENTRY_BITS))
-#define GB(_gb) (_gb ## UL << 30)
 #else
 #define PML4_ENTRY_BYTES (1 << PML4_ENTRY_BITS)
 #define PML4_ADDR(_slot)                             \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHJf-0006M0-1N; Wed, 05 Dec 2012 15:55:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJd-0006Lq-O0
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:17 +0000
Received: from [85.158.143.35:20351] by server-3.bemta-4.messagelabs.com id
	D2/72-06841-56E6FB05; Wed, 05 Dec 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1354722913!14523163!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29483 invoked from network); 5 Dec 2012 15:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJZ-0006Xl-Jm
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJY-00055e-MV
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:13 +0000
Message-Id: <E1TgHJY-00055e-MV@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: add missing guest address
	range checks to XENMEM_exchange handlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646996 0
# Node ID f81286b3be32cc1292d279013ce61e8636dd8cdb
# Parent  e7c8ffa11596af038713773d984e3ee1759f4083
xen: add missing guest address range checks to XENMEM_exchange handlers

Ever since its existence (3.0.3 iirc) the handler for this has been
using non address range checking guest memory accessors (i.e.
the ones prefixed with two underscores) without first range
checking the accessed space (via guest_handle_okay()), allowing
a guest to access and overwrite hypervisor memory.

This is XSA-29 / CVE-2012-5513.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r e7c8ffa11596 -r f81286b3be32 xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Tue Dec 04 18:49:53 2012 +0000
+++ b/xen/common/compat/memory.c	Tue Dec 04 18:49:56 2012 +0000
@@ -114,6 +114,12 @@ int compat_memory_op(unsigned int cmd, X
                   (cmp.xchg.out.nr_extents << cmp.xchg.out.extent_order)) )
                 return -EINVAL;
 
+            if ( !compat_handle_okay(cmp.xchg.in.extent_start,
+                                     cmp.xchg.in.nr_extents) ||
+                 !compat_handle_okay(cmp.xchg.out.extent_start,
+                                     cmp.xchg.out.nr_extents) )
+                return -EFAULT;
+
             start_extent = cmp.xchg.nr_exchanged;
             end_extent = (COMPAT_ARG_XLAT_SIZE - sizeof(*nat.xchg)) /
                          (((1U << ABS(order_delta)) + 1) *
diff -r e7c8ffa11596 -r f81286b3be32 xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:49:53 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:49:56 2012 +0000
@@ -289,6 +289,13 @@ static long memory_exchange(XEN_GUEST_HA
         goto fail_early;
     }
 
+    if ( !guest_handle_okay(exch.in.extent_start, exch.in.nr_extents) ||
+         !guest_handle_okay(exch.out.extent_start, exch.out.nr_extents) )
+    {
+        rc = -EFAULT;
+        goto fail_early;
+    }
+
     /* Only privileged guests can allocate multi-page contiguous extents. */
     if ( !multipage_allocation_permitted(current->domain,
                                          exch.in.extent_order) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHJf-0006M0-1N; Wed, 05 Dec 2012 15:55:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJd-0006Lq-O0
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:17 +0000
Received: from [85.158.143.35:20351] by server-3.bemta-4.messagelabs.com id
	D2/72-06841-56E6FB05; Wed, 05 Dec 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1354722913!14523163!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29483 invoked from network); 5 Dec 2012 15:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJZ-0006Xl-Jm
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJY-00055e-MV
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:13 +0000
Message-Id: <E1TgHJY-00055e-MV@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: add missing guest address
	range checks to XENMEM_exchange handlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646996 0
# Node ID f81286b3be32cc1292d279013ce61e8636dd8cdb
# Parent  e7c8ffa11596af038713773d984e3ee1759f4083
xen: add missing guest address range checks to XENMEM_exchange handlers

Ever since its existence (3.0.3 iirc) the handler for this has been
using non address range checking guest memory accessors (i.e.
the ones prefixed with two underscores) without first range
checking the accessed space (via guest_handle_okay()), allowing
a guest to access and overwrite hypervisor memory.

This is XSA-29 / CVE-2012-5513.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r e7c8ffa11596 -r f81286b3be32 xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Tue Dec 04 18:49:53 2012 +0000
+++ b/xen/common/compat/memory.c	Tue Dec 04 18:49:56 2012 +0000
@@ -114,6 +114,12 @@ int compat_memory_op(unsigned int cmd, X
                   (cmp.xchg.out.nr_extents << cmp.xchg.out.extent_order)) )
                 return -EINVAL;
 
+            if ( !compat_handle_okay(cmp.xchg.in.extent_start,
+                                     cmp.xchg.in.nr_extents) ||
+                 !compat_handle_okay(cmp.xchg.out.extent_start,
+                                     cmp.xchg.out.nr_extents) )
+                return -EFAULT;
+
             start_extent = cmp.xchg.nr_exchanged;
             end_extent = (COMPAT_ARG_XLAT_SIZE - sizeof(*nat.xchg)) /
                          (((1U << ABS(order_delta)) + 1) *
diff -r e7c8ffa11596 -r f81286b3be32 xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:49:53 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:49:56 2012 +0000
@@ -289,6 +289,13 @@ static long memory_exchange(XEN_GUEST_HA
         goto fail_early;
     }
 
+    if ( !guest_handle_okay(exch.in.extent_start, exch.in.nr_extents) ||
+         !guest_handle_okay(exch.out.extent_start, exch.out.nr_extents) )
+    {
+        rc = -EFAULT;
+        goto fail_early;
+    }
+
     /* Only privileged guests can allocate multi-page contiguous extents. */
     if ( !multipage_allocation_permitted(current->domain,
                                          exch.in.extent_order) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHJg-0006MB-4C; Wed, 05 Dec 2012 15:55:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJe-0006Lx-PK
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:18 +0000
Received: from [85.158.137.99:18737] by server-11.bemta-3.messagelabs.com id
	91/A8-19361-56E6FB05; Wed, 05 Dec 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354722915!12700470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16172 invoked from network); 5 Dec 2012 15:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJa-0006Xr-SZ
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJa-000568-Qx
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:14 +0000
Message-Id: <E1TgHJa-000568-Qx@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] memop: limit guest specified
	extent order
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354647003 0
# Node ID a8a9e1c126eaa93ec0a60f20ca1abe713a2df540
# Parent  cadc212c8ef30a2bd16c064a08a7bc2121bf3c6a
memop: limit guest specified extent order

Allowing unbounded order values here causes almost unbounded loops
and/or partially incomplete requests, particularly in PoD code.

The added range checks in populate_physmap(), decrease_reservation(),
and the "in" one in memory_exchange() architecturally all could use
PADDR_BITS - PAGE_SHIFT, and are being artificially constrained to
MAX_ORDER.

This is XSA-31 / CVE-2012-5515.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r cadc212c8ef3 -r a8a9e1c126ea xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:50:01 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:50:03 2012 +0000
@@ -117,7 +117,8 @@ static void populate_physmap(struct memo
 
         if ( a->memflags & MEMF_populate_on_demand )
         {
-            if ( guest_physmap_mark_populate_on_demand(d, gpfn,
+            if ( a->extent_order > MAX_ORDER ||
+                 guest_physmap_mark_populate_on_demand(d, gpfn,
                                                        a->extent_order) < 0 )
                 goto out;
         }
@@ -216,7 +217,8 @@ static void decrease_reservation(struct 
     xen_pfn_t gmfn;
 
     if ( !guest_handle_subrange_okay(a->extent_list, a->nr_done,
-                                     a->nr_extents-1) )
+                                     a->nr_extents-1) ||
+         a->extent_order > MAX_ORDER )
         return;
 
     for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -278,6 +280,9 @@ static long memory_exchange(XEN_GUEST_HA
     if ( (exch.nr_exchanged > exch.in.nr_extents) ||
          /* Input and output domain identifiers match? */
          (exch.in.domid != exch.out.domid) ||
+         /* Extent orders are sensible? */
+         (exch.in.extent_order > MAX_ORDER) ||
+         (exch.out.extent_order > MAX_ORDER) ||
          /* Sizes of input and output lists do not overflow a long? */
          ((~0UL >> exch.in.extent_order) < exch.in.nr_extents) ||
          ((~0UL >> exch.out.extent_order) < exch.out.nr_extents) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHJg-0006MB-4C; Wed, 05 Dec 2012 15:55:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJe-0006Lx-PK
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:18 +0000
Received: from [85.158.137.99:18737] by server-11.bemta-3.messagelabs.com id
	91/A8-19361-56E6FB05; Wed, 05 Dec 2012 15:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1354722915!12700470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16172 invoked from network); 5 Dec 2012 15:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJa-0006Xr-SZ
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJa-000568-Qx
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:14 +0000
Message-Id: <E1TgHJa-000568-Qx@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] memop: limit guest specified
	extent order
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354647003 0
# Node ID a8a9e1c126eaa93ec0a60f20ca1abe713a2df540
# Parent  cadc212c8ef30a2bd16c064a08a7bc2121bf3c6a
memop: limit guest specified extent order

Allowing unbounded order values here causes almost unbounded loops
and/or partially incomplete requests, particularly in PoD code.

The added range checks in populate_physmap(), decrease_reservation(),
and the "in" one in memory_exchange() architecturally all could use
PADDR_BITS - PAGE_SHIFT, and are being artificially constrained to
MAX_ORDER.

This is XSA-31 / CVE-2012-5515.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r cadc212c8ef3 -r a8a9e1c126ea xen/common/memory.c
--- a/xen/common/memory.c	Tue Dec 04 18:50:01 2012 +0000
+++ b/xen/common/memory.c	Tue Dec 04 18:50:03 2012 +0000
@@ -117,7 +117,8 @@ static void populate_physmap(struct memo
 
         if ( a->memflags & MEMF_populate_on_demand )
         {
-            if ( guest_physmap_mark_populate_on_demand(d, gpfn,
+            if ( a->extent_order > MAX_ORDER ||
+                 guest_physmap_mark_populate_on_demand(d, gpfn,
                                                        a->extent_order) < 0 )
                 goto out;
         }
@@ -216,7 +217,8 @@ static void decrease_reservation(struct 
     xen_pfn_t gmfn;
 
     if ( !guest_handle_subrange_okay(a->extent_list, a->nr_done,
-                                     a->nr_extents-1) )
+                                     a->nr_extents-1) ||
+         a->extent_order > MAX_ORDER )
         return;
 
     for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -278,6 +280,9 @@ static long memory_exchange(XEN_GUEST_HA
     if ( (exch.nr_exchanged > exch.in.nr_extents) ||
          /* Input and output domain identifiers match? */
          (exch.in.domid != exch.out.domid) ||
+         /* Extent orders are sensible? */
+         (exch.in.extent_order > MAX_ORDER) ||
+         (exch.out.extent_order > MAX_ORDER) ||
          /* Sizes of input and output lists do not overflow a long? */
          ((~0UL >> exch.in.extent_order) < exch.in.nr_extents) ||
          ((~0UL >> exch.out.extent_order) < exch.out.nr_extents) ||

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:55:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHJm-0006Nx-90; Wed, 05 Dec 2012 15:55:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJk-0006NZ-5S
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:24 +0000
Received: from [85.158.143.35:60483] by server-3.bemta-4.messagelabs.com id
	E2/B2-06841-B6E6FB05; Wed, 05 Dec 2012 15:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1354722912!16313810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31396 invoked from network); 5 Dec 2012 15:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJY-0006Xi-1M
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJX-00055P-SO
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:11 +0000
Message-Id: <E1TgHJX-00055P-SO@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/HVM: range check
	xen_hvm_set_mem_access.hvmmem_access before use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646993 0
# Node ID e7c8ffa11596af038713773d984e3ee1759f4083
# Parent  53ef1f35a0f8cf91c69717c015549532bc6aebe9
x86/HVM: range check xen_hvm_set_mem_access.hvmmem_access before use

Otherwise an out of bounds array access can happen if changing the
default access is being requested, which - if it doesn't crash Xen -
would subsequently allow reading arbitrary memory through
HVMOP_get_mem_access (again, unless that operation crashes Xen).

This is XSA-28 / CVE-2012-5512.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 53ef1f35a0f8 -r e7c8ffa11596 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:49:49 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:49:53 2012 +0000
@@ -3728,7 +3728,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
             return rc;
 
         rc = -EINVAL;
-        if ( !is_hvm_domain(d) )
+        if ( !is_hvm_domain(d) || a.hvmmem_access >= ARRAY_SIZE(memaccess) )
             goto param_fail5;
 
         p2m = p2m_get_hostp2m(d);
@@ -3748,9 +3748,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
              ((a.first_pfn + a.nr - 1) > domain_get_maximum_gpfn(d)) )
             goto param_fail5;
             
-        if ( a.hvmmem_access >= ARRAY_SIZE(memaccess) )
-            goto param_fail5;
-
         for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
         {
             p2m_type_t t;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:55:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHJm-0006Nx-90; Wed, 05 Dec 2012 15:55:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJk-0006NZ-5S
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:24 +0000
Received: from [85.158.143.35:60483] by server-3.bemta-4.messagelabs.com id
	E2/B2-06841-B6E6FB05; Wed, 05 Dec 2012 15:55:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1354722912!16313810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31396 invoked from network); 5 Dec 2012 15:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJY-0006Xi-1M
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJX-00055P-SO
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:11 +0000
Message-Id: <E1TgHJX-00055P-SO@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/HVM: range check
	xen_hvm_set_mem_access.hvmmem_access before use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354646993 0
# Node ID e7c8ffa11596af038713773d984e3ee1759f4083
# Parent  53ef1f35a0f8cf91c69717c015549532bc6aebe9
x86/HVM: range check xen_hvm_set_mem_access.hvmmem_access before use

Otherwise an out of bounds array access can happen if changing the
default access is being requested, which - if it doesn't crash Xen -
would subsequently allow reading arbitrary memory through
HVMOP_get_mem_access (again, unless that operation crashes Xen).

This is XSA-28 / CVE-2012-5512.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r 53ef1f35a0f8 -r e7c8ffa11596 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:49:49 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Tue Dec 04 18:49:53 2012 +0000
@@ -3728,7 +3728,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
             return rc;
 
         rc = -EINVAL;
-        if ( !is_hvm_domain(d) )
+        if ( !is_hvm_domain(d) || a.hvmmem_access >= ARRAY_SIZE(memaccess) )
             goto param_fail5;
 
         p2m = p2m_get_hostp2m(d);
@@ -3748,9 +3748,6 @@ long do_hvm_op(unsigned long op, XEN_GUE
              ((a.first_pfn + a.nr - 1) > domain_get_maximum_gpfn(d)) )
             goto param_fail5;
             
-        if ( a.hvmmem_access >= ARRAY_SIZE(memaccess) )
-            goto param_fail5;
-
         for ( pfn = a.first_pfn; pfn < a.first_pfn + a.nr; pfn++ )
         {
             p2m_type_t t;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:56:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:56:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHKv-0006Um-F6; Wed, 05 Dec 2012 15:56:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHKu-0006Uh-8A
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:56:36 +0000
Received: from [85.158.143.35:32066] by server-3.bemta-4.messagelabs.com id
	D3/C4-06841-3BE6FB05; Wed, 05 Dec 2012 15:56:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354722914!12717474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17133 invoked from network); 5 Dec 2012 15:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJa-0006Xo-8Y
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJa-00055t-5b
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:14 +0000
Message-Id: <E1TgHJa-00055t-5b@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: fix error handling of
	guest_physmap_mark_populate_on_demand()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354647001 0
# Node ID cadc212c8ef30a2bd16c064a08a7bc2121bf3c6a
# Parent  f81286b3be32cc1292d279013ce61e8636dd8cdb
xen: fix error handling of guest_physmap_mark_populate_on_demand()

The only user of the "out" label bypasses a necessary unlock, thus
enabling the caller to lock up Xen.

Also, the function was never meant to be called by a guest for itself,
so rather than inspecting the code paths in depth for potential other
problems this might cause, and adjusting e.g. the non-guest printk()
in the above error path, just disallow the guest access to it.

Finally, the printk() (considering its potential of spamming the log,
the more that it's not using XENLOG_GUEST), is being converted to
P2M_DEBUG(), as debugging is what it apparently was added for in the
first place.

This is XSA-30 / CVE-2012-5514.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f81286b3be32 -r cadc212c8ef3 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Tue Dec 04 18:49:56 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Tue Dec 04 18:50:01 2012 +0000
@@ -2412,6 +2412,9 @@ guest_physmap_mark_populate_on_demand(st
     mfn_t omfn;
     int rc = 0;
 
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+
     if ( !paging_mode_translate(d) )
         return -EINVAL;
 
@@ -2430,8 +2433,7 @@ guest_physmap_mark_populate_on_demand(st
         omfn = gfn_to_mfn_query(p2m, gfn + i, &ot);
         if ( p2m_is_ram(ot) )
         {
-            printk("%s: gfn_to_mfn returned type %d!\n",
-                   __func__, ot);
+            P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
             rc = -EBUSY;
             goto out;
         }
@@ -2453,10 +2455,10 @@ guest_physmap_mark_populate_on_demand(st
         BUG_ON(p2m->pod.entry_count < 0);
     }
 
+out:
     audit_p2m(p2m, 1);
     p2m_unlock(p2m);
 
-out:
     return rc;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 05 15:56:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 05 Dec 2012 15:56:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TgHKv-0006Um-F6; Wed, 05 Dec 2012 15:56:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHKu-0006Uh-8A
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:56:36 +0000
Received: from [85.158.143.35:32066] by server-3.bemta-4.messagelabs.com id
	D3/C4-06841-3BE6FB05; Wed, 05 Dec 2012 15:56:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1354722914!12717474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17133 invoked from network); 5 Dec 2012 15:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Dec 2012 15:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJa-0006Xo-8Y
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TgHJa-00055t-5b
	for xen-changelog@lists.xensource.com; Wed, 05 Dec 2012 15:55:14 +0000
Message-Id: <E1TgHJa-00055t-5b@xenbits.xen.org>
Date: Wed, 05 Dec 2012 15:55:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: fix error handling of
	guest_physmap_mark_populate_on_demand()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354647001 0
# Node ID cadc212c8ef30a2bd16c064a08a7bc2121bf3c6a
# Parent  f81286b3be32cc1292d279013ce61e8636dd8cdb
xen: fix error handling of guest_physmap_mark_populate_on_demand()

The only user of the "out" label bypasses a necessary unlock, thus
enabling the caller to lock up Xen.

Also, the function was never meant to be called by a guest for itself,
so rather than inspecting the code paths in depth for potential other
problems this might cause, and adjusting e.g. the non-guest printk()
in the above error path, just disallow the guest access to it.

Finally, the printk() (considering its potential of spamming the log,
the more that it's not using XENLOG_GUEST), is being converted to
P2M_DEBUG(), as debugging is what it apparently was added for in the
first place.

This is XSA-30 / CVE-2012-5514.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f81286b3be32 -r cadc212c8ef3 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Tue Dec 04 18:49:56 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Tue Dec 04 18:50:01 2012 +0000
@@ -2412,6 +2412,9 @@ guest_physmap_mark_populate_on_demand(st
     mfn_t omfn;
     int rc = 0;
 
+    if ( !IS_PRIV_FOR(current->domain, d) )
+        return -EPERM;
+
     if ( !paging_mode_translate(d) )
         return -EINVAL;
 
@@ -2430,8 +2433,7 @@ guest_physmap_mark_populate_on_demand(st
         omfn = gfn_to_mfn_query(p2m, gfn + i, &ot);
         if ( p2m_is_ram(ot) )
         {
-            printk("%s: gfn_to_mfn returned type %d!\n",
-                   __func__, ot);
+            P2M_DEBUG("gfn_to_mfn returned type %d!\n", ot);
             rc = -EBUSY;
             goto out;
         }
@@ -2453,10 +2455,10 @@ guest_physmap_mark_populate_on_demand(st
         BUG_ON(p2m->pod.entry_count < 0);
     }
 
+out:
     audit_p2m(p2m, 1);
     p2m_unlock(p2m);
 
-out:
     return rc;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 06 13:00:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Dec 2012 13:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tgb48-0002oX-9T; Thu, 06 Dec 2012 13:00:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Tgb46-0002o9-PP
	for xen-changelog@lists.xensource.com; Thu, 06 Dec 2012 13:00:35 +0000
Received: from [85.158.139.83:35365] by server-2.bemta-5.messagelabs.com id
	C8/F5-04892-1F690C05; Thu, 06 Dec 2012 13:00:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354798810!24381536!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 728 invoked from network); 6 Dec 2012 13:00:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Dec 2012 13:00:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Tgb3i-0003EX-2n
	for xen-changelog@lists.xensource.com; Thu, 06 Dec 2012 13:00:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Tgb3h-00069w-Hf
	for xen-changelog@lists.xensource.com; Thu, 06 Dec 2012 13:00:09 +0000
Date: Thu, 06 Dec 2012 13:00:09 +0000
Message-Id: <E1Tgb3h-00069w-Hf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-stubdom: prevent useless
	medium change
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1084405016857027691=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1084405016857027691==
Content-Type: text/plain

commit 6a0cf3786f1964fdf5a17f88f26cb499f4e89c81
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Thu Dec 6 12:35:58 2012 +0000

    qemu-stubdom: prevent useless medium change
    
    qemu-stubdom was stripping the prefix from the "params" xenstore
    key in xenstore_parse_domain_config, which was then saved stripped in
    a variable. In xenstore_process_event we compare the "param" from
    xenstore (not stripped) with the stripped "param" saved in the
    variable, which leads to a medium change (even if there isn't any),
    since we are comparing something like aio:/path/to/file with
    /path/to/file. This only happens one time, since
    xenstore_parse_domain_config is the only place where we strip the
    prefix. The result of this bug is the following:
    
    xs_read_watch() -> /local/domain/0/backend/qdisk/19/5632/params hdc
    close(7)
    close blk: backend=/local/domain/0/backend/qdisk/19/5632
    node=/local/domain/19/device/vbd/5632
    (XEN) HVM18: HVM Loader
    (XEN) HVM18: Detected Xen v4.3-unstable
    (XEN) HVM18: Xenbus rings @0xfeffc000, event channel 4
    (XEN) HVM18: System requested ROMBIOS
    (XEN) HVM18: CPU speed is 2400 MHz
    (XEN) irq.c:270: Dom18 PCI link 0 changed 0 -> 5
    (XEN) HVM18: PCI-ISA link 0 routed to IRQ5
    (XEN) irq.c:270: Dom18 PCI link 1 changed 0 -> 10
    (XEN) HVM18: PCI-ISA link 1 routed to IRQ10
    (XEN) irq.c:270: Dom18 PCI link 2 changed 0 -> 11
    (XEN) HVM18: PCI-ISA link 2 routed to IRQ11
    (XEN) irq.c:270: Dom18 PCI link 3 changed 0 -> 5
    (XEN) HVM18: PCI-ISA link 3 routed to IRQ5
    (XEN) HVM18: pci dev 01:3 INTA->IRQ10
    (XEN) HVM18: pci dev 03:0 INTA->IRQ5
    (XEN) HVM18: pci dev 04:0 INTA->IRQ5
    (XEN) HVM18: pci dev 02:0 bar 10 size lx: 02000000
    (XEN) HVM18: pci dev 03:0 bar 14 size lx: 01000000
    (XEN) HVM18: pci dev 02:0 bar 14 size lx: 00001000
    (XEN) HVM18: pci dev 03:0 bar 10 size lx: 00000100
    (XEN) HVM18: pci dev 04:0 bar 10 size lx: 00000100
    (XEN) HVM18: pci dev 04:0 bar 14 size lx: 00000100
    (XEN) HVM18: pci dev 01:1 bar 20 size lx: 00000010
    (XEN) HVM18: Multiprocessor initialisation:
    (XEN) HVM18:  - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done.
    (XEN) HVM18:  - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done.
    (XEN) HVM18: Testing HVM environment:
    (XEN) HVM18:  - REP INSB across page boundaries ... passed
    (XEN) HVM18:  - GS base MSRs and SWAPGS ... passed
    (XEN) HVM18: Passed 2 of 2 tests
    (XEN) HVM18: Writing SMBIOS tables ...
    (XEN) HVM18: Loading ROMBIOS ...
    (XEN) HVM18: 9660 bytes of ROMBIOS high-memory extensions:
    (XEN) HVM18:   Relocating to 0xfc001000-0xfc0035bc ... done
    (XEN) HVM18: Creating MP tables ...
    (XEN) HVM18: Loading Cirrus VGABIOS ...
    (XEN) HVM18: Loading PCI Option ROM ...
    (XEN) HVM18:  - Manufacturer: http://ipxe.org
    (XEN) HVM18:  - Product name: iPXE
    (XEN) HVM18: Option ROMs:
    (XEN) HVM18:  c0000-c8fff: VGA BIOS
    (XEN) HVM18:  c9000-d8fff: Etherboot ROM
    (XEN) HVM18: Loading ACPI ...
    (XEN) HVM18: vm86 TSS at fc00f680
    (XEN) HVM18: BIOS map:
    (XEN) HVM18:  f0000-fffff: Main BIOS
    (XEN) HVM18: E820 table:
    (XEN) HVM18:  [00]: 00000000:00000000 - 00000000:0009e000: RAM
    (XEN) HVM18:  [01]: 00000000:0009e000 - 00000000:000a0000: RESERVED
    (XEN) HVM18:  HOLE: 00000000:000a0000 - 00000000:000e0000
    (XEN) HVM18:  [02]: 00000000:000e0000 - 00000000:00100000: RESERVED
    (XEN) HVM18:  [03]: 00000000:00100000 - 00000000:3f800000: RAM
    (XEN) HVM18:  HOLE: 00000000:3f800000 - 00000000:fc000000
    (XEN) HVM18:  [04]: 00000000:fc000000 - 00000001:00000000: RESERVED
    (XEN) HVM18: Invoking ROMBIOS ...
    (XEN) HVM18: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
    (XEN) stdvga.c:147:d18 entering stdvga and caching modes
    (XEN) HVM18: VGABios $Id: vgabios.c,v 1.67 2008/01/27 09:44:12 vruppert Exp $
    (XEN) HVM18: Bochs BIOS - build: 06/23/99
    (XEN) HVM18: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
    (XEN) HVM18: Options: apmbios pcibios eltorito PMM
    (XEN) HVM18:
    (XEN) HVM18: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
    (XEN) HVM18: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (10240 MBytes)
    (XEN) HVM18: IDE time out
    (XEN) HVM18: ata1 master: QEMU DVD-ROM ATAPI-4 CD-Rom/DVD-Rom
    (XEN) HVM18: IDE time out
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18: Press F12 for boot menu.
    (XEN) HVM18:
    (XEN) HVM18: Booting from CD-Rom...
    (XEN) HVM18: ata_is_ready returned 1
    (XEN) HVM18: CDROM boot failure code : 0003
    (XEN) HVM18: Boot from CD-Rom failed: could not read the boot disk
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18: No bootable device.
    (XEN) HVM18: Powering off in 30 seconds.
    ******************* BLKFRONT for /local/domain/19/device/vbd/5632 **********
    
    backend at /local/domain/0/backend/qdisk/19/5632
    Failed to read
    /local/domain/0/backend/qdisk/19/5632/feature-flush-cache.
    284420 sectors of 512 bytes
    **************************
    blk_open(/local/domain/19/device/vbd/5632) -> 7
    
    As seen in this trace, the medium change happens just when the
    guest is booting, which leads to the guest not being able to boot
    because the BIOS is not able to access the device.
    
    This is a regression from Xen 4.1, which is able to boot from "file:/"
    based backends when using stubdomains.
    
    [ By inspection, this patch does not change the flow for the
      non-stubdom case. -iwj]
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xenstore.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xenstore.c b/xenstore.c
index 1857160..d3a4588 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -614,6 +614,12 @@ void xenstore_parse_domain_config(int hvm_domid)
         if (pasprintf(&danger_buf, "%s/device/vbd/%s", danger_path, e_danger[i]) == -1)
             continue;
 	if (bdrv_open2(bs, danger_buf, BDRV_O_CACHE_WB /* snapshot and write-back */, &bdrv_raw) == 0) {
+        if (pasprintf(&buf, "%s/params", bpath) == -1)
+                continue;
+        free(params);
+        params = xs_read(xsh, XBT_NULL, buf, &len);
+        if (params == NULL)
+            continue;
 	    pstrcpy(bs->filename, sizeof(bs->filename), params);
 	}
 #else
@@ -667,11 +673,7 @@ void xenstore_parse_domain_config(int hvm_domid)
 
 	drives_table[nb_drives].bdrv = bs;
 	drives_table[nb_drives].used = 1;
-#ifdef CONFIG_STUBDOM
-    media_filename[nb_drives] = strdup(danger_buf);
-#else
     media_filename[nb_drives] = strdup(bs->filename);
-#endif
 	nb_drives++;
 
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git


--===============1084405016857027691==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============1084405016857027691==--

From xen-changelog-bounces@lists.xen.org Thu Dec 06 13:00:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 06 Dec 2012 13:00:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tgb48-0002oX-9T; Thu, 06 Dec 2012 13:00:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Tgb46-0002o9-PP
	for xen-changelog@lists.xensource.com; Thu, 06 Dec 2012 13:00:35 +0000
Received: from [85.158.139.83:35365] by server-2.bemta-5.messagelabs.com id
	C8/F5-04892-1F690C05; Thu, 06 Dec 2012 13:00:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1354798810!24381536!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 728 invoked from network); 6 Dec 2012 13:00:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Dec 2012 13:00:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Tgb3i-0003EX-2n
	for xen-changelog@lists.xensource.com; Thu, 06 Dec 2012 13:00:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Tgb3h-00069w-Hf
	for xen-changelog@lists.xensource.com; Thu, 06 Dec 2012 13:00:09 +0000
Date: Thu, 06 Dec 2012 13:00:09 +0000
Message-Id: <E1Tgb3h-00069w-Hf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-stubdom: prevent useless
	medium change
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1084405016857027691=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1084405016857027691==
Content-Type: text/plain

commit 6a0cf3786f1964fdf5a17f88f26cb499f4e89c81
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Thu Dec 6 12:35:58 2012 +0000

    qemu-stubdom: prevent useless medium change
    
    qemu-stubdom was stripping the prefix from the "params" xenstore
    key in xenstore_parse_domain_config, which was then saved stripped in
    a variable. In xenstore_process_event we compare the "param" from
    xenstore (not stripped) with the stripped "param" saved in the
    variable, which leads to a medium change (even if there isn't any),
    since we are comparing something like aio:/path/to/file with
    /path/to/file. This only happens one time, since
    xenstore_parse_domain_config is the only place where we strip the
    prefix. The result of this bug is the following:
    
    xs_read_watch() -> /local/domain/0/backend/qdisk/19/5632/params hdc
    close(7)
    close blk: backend=/local/domain/0/backend/qdisk/19/5632
    node=/local/domain/19/device/vbd/5632
    (XEN) HVM18: HVM Loader
    (XEN) HVM18: Detected Xen v4.3-unstable
    (XEN) HVM18: Xenbus rings @0xfeffc000, event channel 4
    (XEN) HVM18: System requested ROMBIOS
    (XEN) HVM18: CPU speed is 2400 MHz
    (XEN) irq.c:270: Dom18 PCI link 0 changed 0 -> 5
    (XEN) HVM18: PCI-ISA link 0 routed to IRQ5
    (XEN) irq.c:270: Dom18 PCI link 1 changed 0 -> 10
    (XEN) HVM18: PCI-ISA link 1 routed to IRQ10
    (XEN) irq.c:270: Dom18 PCI link 2 changed 0 -> 11
    (XEN) HVM18: PCI-ISA link 2 routed to IRQ11
    (XEN) irq.c:270: Dom18 PCI link 3 changed 0 -> 5
    (XEN) HVM18: PCI-ISA link 3 routed to IRQ5
    (XEN) HVM18: pci dev 01:3 INTA->IRQ10
    (XEN) HVM18: pci dev 03:0 INTA->IRQ5
    (XEN) HVM18: pci dev 04:0 INTA->IRQ5
    (XEN) HVM18: pci dev 02:0 bar 10 size lx: 02000000
    (XEN) HVM18: pci dev 03:0 bar 14 size lx: 01000000
    (XEN) HVM18: pci dev 02:0 bar 14 size lx: 00001000
    (XEN) HVM18: pci dev 03:0 bar 10 size lx: 00000100
    (XEN) HVM18: pci dev 04:0 bar 10 size lx: 00000100
    (XEN) HVM18: pci dev 04:0 bar 14 size lx: 00000100
    (XEN) HVM18: pci dev 01:1 bar 20 size lx: 00000010
    (XEN) HVM18: Multiprocessor initialisation:
    (XEN) HVM18:  - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done.
    (XEN) HVM18:  - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done.
    (XEN) HVM18: Testing HVM environment:
    (XEN) HVM18:  - REP INSB across page boundaries ... passed
    (XEN) HVM18:  - GS base MSRs and SWAPGS ... passed
    (XEN) HVM18: Passed 2 of 2 tests
    (XEN) HVM18: Writing SMBIOS tables ...
    (XEN) HVM18: Loading ROMBIOS ...
    (XEN) HVM18: 9660 bytes of ROMBIOS high-memory extensions:
    (XEN) HVM18:   Relocating to 0xfc001000-0xfc0035bc ... done
    (XEN) HVM18: Creating MP tables ...
    (XEN) HVM18: Loading Cirrus VGABIOS ...
    (XEN) HVM18: Loading PCI Option ROM ...
    (XEN) HVM18:  - Manufacturer: http://ipxe.org
    (XEN) HVM18:  - Product name: iPXE
    (XEN) HVM18: Option ROMs:
    (XEN) HVM18:  c0000-c8fff: VGA BIOS
    (XEN) HVM18:  c9000-d8fff: Etherboot ROM
    (XEN) HVM18: Loading ACPI ...
    (XEN) HVM18: vm86 TSS at fc00f680
    (XEN) HVM18: BIOS map:
    (XEN) HVM18:  f0000-fffff: Main BIOS
    (XEN) HVM18: E820 table:
    (XEN) HVM18:  [00]: 00000000:00000000 - 00000000:0009e000: RAM
    (XEN) HVM18:  [01]: 00000000:0009e000 - 00000000:000a0000: RESERVED
    (XEN) HVM18:  HOLE: 00000000:000a0000 - 00000000:000e0000
    (XEN) HVM18:  [02]: 00000000:000e0000 - 00000000:00100000: RESERVED
    (XEN) HVM18:  [03]: 00000000:00100000 - 00000000:3f800000: RAM
    (XEN) HVM18:  HOLE: 00000000:3f800000 - 00000000:fc000000
    (XEN) HVM18:  [04]: 00000000:fc000000 - 00000001:00000000: RESERVED
    (XEN) HVM18: Invoking ROMBIOS ...
    (XEN) HVM18: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
    (XEN) stdvga.c:147:d18 entering stdvga and caching modes
    (XEN) HVM18: VGABios $Id: vgabios.c,v 1.67 2008/01/27 09:44:12 vruppert Exp $
    (XEN) HVM18: Bochs BIOS - build: 06/23/99
    (XEN) HVM18: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
    (XEN) HVM18: Options: apmbios pcibios eltorito PMM
    (XEN) HVM18:
    (XEN) HVM18: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
    (XEN) HVM18: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (10240 MBytes)
    (XEN) HVM18: IDE time out
    (XEN) HVM18: ata1 master: QEMU DVD-ROM ATAPI-4 CD-Rom/DVD-Rom
    (XEN) HVM18: IDE time out
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18: Press F12 for boot menu.
    (XEN) HVM18:
    (XEN) HVM18: Booting from CD-Rom...
    (XEN) HVM18: ata_is_ready returned 1
    (XEN) HVM18: CDROM boot failure code : 0003
    (XEN) HVM18: Boot from CD-Rom failed: could not read the boot disk
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18: No bootable device.
    (XEN) HVM18: Powering off in 30 seconds.
    ******************* BLKFRONT for /local/domain/19/device/vbd/5632 **********
    
    backend at /local/domain/0/backend/qdisk/19/5632
    Failed to read
    /local/domain/0/backend/qdisk/19/5632/feature-flush-cache.
    284420 sectors of 512 bytes
    **************************
    blk_open(/local/domain/19/device/vbd/5632) -> 7
    
    As seen in this trace, the medium change happens just when the
    guest is booting, which leads to the guest not being able to boot
    because the BIOS is not able to access the device.
    
    This is a regression from Xen 4.1, which is able to boot from "file:/"
    based backends when using stubdomains.
    
    [ By inspection, this patch does not change the flow for the
      non-stubdom case. -iwj]
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xenstore.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xenstore.c b/xenstore.c
index 1857160..d3a4588 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -614,6 +614,12 @@ void xenstore_parse_domain_config(int hvm_domid)
         if (pasprintf(&danger_buf, "%s/device/vbd/%s", danger_path, e_danger[i]) == -1)
             continue;
 	if (bdrv_open2(bs, danger_buf, BDRV_O_CACHE_WB /* snapshot and write-back */, &bdrv_raw) == 0) {
+        if (pasprintf(&buf, "%s/params", bpath) == -1)
+                continue;
+        free(params);
+        params = xs_read(xsh, XBT_NULL, buf, &len);
+        if (params == NULL)
+            continue;
 	    pstrcpy(bs->filename, sizeof(bs->filename), params);
 	}
 #else
@@ -667,11 +673,7 @@ void xenstore_parse_domain_config(int hvm_domid)
 
 	drives_table[nb_drives].bdrv = bs;
 	drives_table[nb_drives].used = 1;
-#ifdef CONFIG_STUBDOM
-    media_filename[nb_drives] = strdup(danger_buf);
-#else
     media_filename[nb_drives] = strdup(bs->filename);
-#endif
 	nb_drives++;
 
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git


--===============1084405016857027691==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============1084405016857027691==--

From xen-changelog-bounces@lists.xen.org Mon Dec 10 17:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Dec 2012 17:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Ti7ZX-00021E-Fu; Mon, 10 Dec 2012 17:55:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7ZV-000217-Qr
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:55:18 +0000
Received: from [85.158.143.99:21916] by server-2.bemta-4.messagelabs.com id
	69/4B-30861-50226C05; Mon, 10 Dec 2012 17:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1355162114!27973938!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5770 invoked from network); 10 Dec 2012 17:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2012 17:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7ZR-00064c-U7
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7ZR-0007cB-Bi
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:55:13 +0000
Message-Id: <E1Ti7ZR-0007cB-Bi@xenbits.xen.org>
Date: Mon, 10 Dec 2012 17:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] MAINTAINERS: Reference stable
	maintenance policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354788185 -3600
# Node ID 6c7febc0bbebb6b29432a3009b61f77ac3abc727
# Parent  a8a9e1c126eaa93ec0a60f20ca1abe713a2df540
MAINTAINERS: Reference stable maintenance policy

I also couldn't resist fixing a typo and adding a reference to
http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26238:53805e238cca
xen-unstable date: Thu Dec  6 09:56:53 UTC 2012
---


diff -r a8a9e1c126ea -r 6c7febc0bbeb MAINTAINERS
--- a/MAINTAINERS	Tue Dec 04 18:50:03 2012 +0000
+++ b/MAINTAINERS	Thu Dec 06 11:03:05 2012 +0100
@@ -1,5 +1,6 @@
 
 	List of maintainers and how to submit changes
+	=============================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
@@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
 	'diff -u' to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
-	job the maintainersdo is to keep things looking the same.
+	job the maintainers do is to keep things looking the same.
+
+	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
+	hints on how to submit a patch to xen-unstable in a suitable
+	form.
 
 	PLEASE try to include any credit lines you want added with the
 	patch. It avoids people being missed off by mistake and makes
@@ -34,6 +39,28 @@ 4.	Make sure you have the right to send 
 
 5.	Happy hacking.
 
+
+	Stable Release Maintenance
+	==========================
+
+The policy for inclusion in a Xen stable release is different to that
+for inclusion in xen-unstable.
+
+Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
+information.
+
+Remember to copy the stable branch maintainer. The maintainer for this
+branch is:
+
+	Jan Beulich <jbeulich@suse.com>
+
+Tools backport requests should also be copied to:
+
+	Ian Jackson <Ian.Jackson@eu.citrix.com>
+
+	Unstable Subsystem Maintainers
+	==============================
+
 Descriptions of section entries:
 
 	M: Mail patches to: FullName <address@domain>

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Dec 10 17:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Dec 2012 17:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Ti7ZX-00021E-Fu; Mon, 10 Dec 2012 17:55:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7ZV-000217-Qr
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:55:18 +0000
Received: from [85.158.143.99:21916] by server-2.bemta-4.messagelabs.com id
	69/4B-30861-50226C05; Mon, 10 Dec 2012 17:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1355162114!27973938!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5770 invoked from network); 10 Dec 2012 17:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2012 17:55:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7ZR-00064c-U7
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7ZR-0007cB-Bi
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:55:13 +0000
Message-Id: <E1Ti7ZR-0007cB-Bi@xenbits.xen.org>
Date: Mon, 10 Dec 2012 17:55:11 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] MAINTAINERS: Reference stable
	maintenance policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354788185 -3600
# Node ID 6c7febc0bbebb6b29432a3009b61f77ac3abc727
# Parent  a8a9e1c126eaa93ec0a60f20ca1abe713a2df540
MAINTAINERS: Reference stable maintenance policy

I also couldn't resist fixing a typo and adding a reference to
http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26238:53805e238cca
xen-unstable date: Thu Dec  6 09:56:53 UTC 2012
---


diff -r a8a9e1c126ea -r 6c7febc0bbeb MAINTAINERS
--- a/MAINTAINERS	Tue Dec 04 18:50:03 2012 +0000
+++ b/MAINTAINERS	Thu Dec 06 11:03:05 2012 +0100
@@ -1,5 +1,6 @@
 
 	List of maintainers and how to submit changes
+	=============================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
@@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
 	'diff -u' to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
-	job the maintainersdo is to keep things looking the same.
+	job the maintainers do is to keep things looking the same.
+
+	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
+	hints on how to submit a patch to xen-unstable in a suitable
+	form.
 
 	PLEASE try to include any credit lines you want added with the
 	patch. It avoids people being missed off by mistake and makes
@@ -34,6 +39,28 @@ 4.	Make sure you have the right to send 
 
 5.	Happy hacking.
 
+
+	Stable Release Maintenance
+	==========================
+
+The policy for inclusion in a Xen stable release is different to that
+for inclusion in xen-unstable.
+
+Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
+information.
+
+Remember to copy the stable branch maintainer. The maintainer for this
+branch is:
+
+	Jan Beulich <jbeulich@suse.com>
+
+Tools backport requests should also be copied to:
+
+	Ian Jackson <Ian.Jackson@eu.citrix.com>
+
+	Unstable Subsystem Maintainers
+	==============================
+
 Descriptions of section entries:
 
 	M: Mail patches to: FullName <address@domain>

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Dec 10 17:58:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Dec 2012 17:58:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Ti7cM-00024A-PN; Mon, 10 Dec 2012 17:58:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7cL-000245-As
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:58:13 +0000
Received: from [193.109.254.147:40399] by server-13.bemta-14.messagelabs.com
	id 3C/4C-11239-3B226C05; Mon, 10 Dec 2012 17:58:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1355162114!9589436!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28911 invoked from network); 10 Dec 2012 17:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2012 17:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7ZS-00064f-Nh
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7ZS-0007cQ-EQ
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:55:14 +0000
Message-Id: <E1Ti7ZS-0007cQ-EQ@xenbits.xen.org>
Date: Mon, 10 Dec 2012 17:55:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Kouya Shimura <kouya@jp.fujitsu.com>
# Date 1354788780 -3600
# Node ID 309ff3ad9dcce7e14fd50a958fff0f691ad8aa6d
# Parent  6c7febc0bbebb6b29432a3009b61f77ac3abc727
x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26203:b5cb6cccc32c
xen-unstable date: Thu Nov 29 11:01:00 UTC 2012
---


diff -r 6c7febc0bbeb -r 309ff3ad9dcc xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Dec 06 11:03:05 2012 +0100
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Dec 06 11:13:00 2012 +0100
@@ -686,6 +686,9 @@ void hap_teardown(struct domain *d)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
+    xfree(d->arch.hvm_domain.dirty_vram);
+    d->arch.hvm_domain.dirty_vram = NULL;
+
     hap_unlock(d);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Dec 10 17:58:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 10 Dec 2012 17:58:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Ti7cM-00024A-PN; Mon, 10 Dec 2012 17:58:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7cL-000245-As
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:58:13 +0000
Received: from [193.109.254.147:40399] by server-13.bemta-14.messagelabs.com
	id 3C/4C-11239-3B226C05; Mon, 10 Dec 2012 17:58:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1355162114!9589436!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28911 invoked from network); 10 Dec 2012 17:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Dec 2012 17:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7ZS-00064f-Nh
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Ti7ZS-0007cQ-EQ
	for xen-changelog@lists.xensource.com; Mon, 10 Dec 2012 17:55:14 +0000
Message-Id: <E1Ti7ZS-0007cQ-EQ@xenbits.xen.org>
Date: Mon, 10 Dec 2012 17:55:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Kouya Shimura <kouya@jp.fujitsu.com>
# Date 1354788780 -3600
# Node ID 309ff3ad9dcce7e14fd50a958fff0f691ad8aa6d
# Parent  6c7febc0bbebb6b29432a3009b61f77ac3abc727
x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26203:b5cb6cccc32c
xen-unstable date: Thu Nov 29 11:01:00 UTC 2012
---


diff -r 6c7febc0bbeb -r 309ff3ad9dcc xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Dec 06 11:03:05 2012 +0100
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Dec 06 11:13:00 2012 +0100
@@ -686,6 +686,9 @@ void hap_teardown(struct domain *d)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
+    xfree(d->arch.hvm_domain.dirty_vram);
+    d->arch.hvm_domain.dirty_vram = NULL;
+
     hap_unlock(d);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWu-0007Yu-Qc; Tue, 11 Dec 2012 04:33:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWu-0007Xz-8t
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Received: from [85.158.143.99:51288] by server-3.bemta-4.messagelabs.com id
	4C/39-18211-B87B6C05; Tue, 11 Dec 2012 04:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1355200394!22511083!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10193 invoked from network); 11 Dec 2012 04:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-0003Hq-UL
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-00078z-PA
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Message-Id: <E1TiHWr-00078z-PA@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Make an internal function
	explicitly check existence of expected paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354789148 0
# Node ID 89bd3c43f883620e481f4fa019e30c96044aec55
# Parent  d3c96e02e53270040a4f8ad0ea89796a5bf59cdd
libxl: Make an internal function explicitly check existence of expected paths

libxl__device_disk_from_xs_be() was failing without error for some
missing xenstore nodes in a backend, while assuming (without checking)
that other nodes were valid, causing a crash when another internal
error wrote these nodes in the wrong place.

Make this function consistent by:
* Checking the existence of all nodes before using
* Choosing a default only when the node is not written in device_disk_add()
* Failing with log msg if any node written by device_disk_add() is not present
* Returning an error on failure
* Disposing of the structure before returning using libxl_device_disk_displose()

Also make the callers of the function pay attention to the error and
behave appropriately.  In the case of libxl__append_disk_list_of_type(),
this means only incrementing *ndisks as the disk structures are
successfully initialized.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d3c96e02e532 -r 89bd3c43f883 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Dec 06 10:19:08 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Dec 06 10:19:08 2012 +0000
@@ -2169,9 +2169,9 @@ void libxl__device_disk_add(libxl__egc *
     device_disk_add(egc, domid, disk, aodev, NULL, NULL);
 }
 
-static void libxl__device_disk_from_xs_be(libxl__gc *gc,
-                                          const char *be_path,
-                                          libxl_device_disk *disk)
+static int libxl__device_disk_from_xs_be(libxl__gc *gc,
+                                         const char *be_path,
+                                         libxl_device_disk *disk)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     unsigned int len;
@@ -2179,6 +2179,7 @@ static void libxl__device_disk_from_xs_b
 
     libxl_device_disk_init(disk);
 
+    /* "params" may not be present; but everything else must be. */
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
     if (tmp && strchr(tmp, ':')) {
@@ -2187,21 +2188,36 @@ static void libxl__device_disk_from_xs_b
     } else {
         disk->pdev_path = tmp;
     }
-    libxl_string_to_backend(ctx,
-                        libxl__xs_read(gc, XBT_NULL,
-                                       libxl__sprintf(gc, "%s/type", be_path)),
-                        &(disk->backend));
+
+
+    tmp = libxl__xs_read(gc, XBT_NULL,
+                         libxl__sprintf(gc, "%s/type", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/type", be_path);
+        goto cleanup;
+    }
+    libxl_string_to_backend(ctx, tmp, &(disk->backend));
+
     disk->vdev = xs_read(ctx->xsh, XBT_NULL,
                          libxl__sprintf(gc, "%s/dev", be_path), &len);
+    if (!disk->vdev) {
+        LOG(ERROR, "Missing xenstore node %s/dev", be_path);
+        goto cleanup;
+    }
+
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf
                          (gc, "%s/removable", be_path));
-
-    if (tmp)
-        disk->removable = atoi(tmp);
-    else
-        disk->removable = 0;
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/removable", be_path);
+        goto cleanup;
+    }
+    disk->removable = atoi(tmp);
 
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/mode", be_path);
+        goto cleanup;
+    }
     if (!strcmp(tmp, "w"))
         disk->readwrite = 1;
     else
@@ -2209,9 +2225,18 @@ static void libxl__device_disk_from_xs_b
 
     tmp = libxl__xs_read(gc, XBT_NULL,
                          libxl__sprintf(gc, "%s/device-type", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/device-type", be_path);
+        goto cleanup;
+    }
     disk->is_cdrom = !strcmp(tmp, "cdrom");
 
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
+
+    return 0;
+cleanup:
+    libxl_device_disk_dispose(disk);
+    return ERROR_FAIL;
 }
 
 int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
@@ -2237,9 +2262,7 @@ int libxl_vdev_to_device_disk(libxl_ctx 
     if (!path)
         goto out;
 
-    libxl__device_disk_from_xs_be(gc, path, disk);
-
-    rc = 0;
+    rc = libxl__device_disk_from_xs_be(gc, path, disk);
 out:
     GC_FREE;
     return rc;
@@ -2256,6 +2279,8 @@ static int libxl__append_disk_list_of_ty
     char **dir = NULL;
     unsigned int n = 0;
     libxl_device_disk *pdisk = NULL, *pdisk_end = NULL;
+    int rc=0;
+    int initial_disks = *ndisks;
 
     be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
@@ -2266,17 +2291,19 @@ static int libxl__append_disk_list_of_ty
         if (tmp == NULL)
             return ERROR_NOMEM;
         *disks = tmp;
-        pdisk = *disks + *ndisks;
-        *ndisks += n;
-        pdisk_end = *disks + *ndisks;
+        pdisk = *disks + initial_disks;
+        pdisk_end = *disks + initial_disks + n;
         for (; pdisk < pdisk_end; pdisk++, dir++) {
             const char *p;
             p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
-            libxl__device_disk_from_xs_be(gc, p, pdisk);
+            if ((rc=libxl__device_disk_from_xs_be(gc, p, pdisk)))
+                goto out;
             pdisk->backend_domid = 0;
+            *ndisks += 1;
         }
     }
-    return 0;
+out:
+    return rc;
 }
 
 libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx, uint32_t domid, int *num)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWu-0007Yu-Qc; Tue, 11 Dec 2012 04:33:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWu-0007Xz-8t
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Received: from [85.158.143.99:51288] by server-3.bemta-4.messagelabs.com id
	4C/39-18211-B87B6C05; Tue, 11 Dec 2012 04:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1355200394!22511083!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10193 invoked from network); 11 Dec 2012 04:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-0003Hq-UL
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-00078z-PA
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Message-Id: <E1TiHWr-00078z-PA@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Make an internal function
	explicitly check existence of expected paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User George Dunlap <george.dunlap@eu.citrix.com>
# Date 1354789148 0
# Node ID 89bd3c43f883620e481f4fa019e30c96044aec55
# Parent  d3c96e02e53270040a4f8ad0ea89796a5bf59cdd
libxl: Make an internal function explicitly check existence of expected paths

libxl__device_disk_from_xs_be() was failing without error for some
missing xenstore nodes in a backend, while assuming (without checking)
that other nodes were valid, causing a crash when another internal
error wrote these nodes in the wrong place.

Make this function consistent by:
* Checking the existence of all nodes before using
* Choosing a default only when the node is not written in device_disk_add()
* Failing with log msg if any node written by device_disk_add() is not present
* Returning an error on failure
* Disposing of the structure before returning using libxl_device_disk_displose()

Also make the callers of the function pay attention to the error and
behave appropriately.  In the case of libxl__append_disk_list_of_type(),
this means only incrementing *ndisks as the disk structures are
successfully initialized.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d3c96e02e532 -r 89bd3c43f883 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Dec 06 10:19:08 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Dec 06 10:19:08 2012 +0000
@@ -2169,9 +2169,9 @@ void libxl__device_disk_add(libxl__egc *
     device_disk_add(egc, domid, disk, aodev, NULL, NULL);
 }
 
-static void libxl__device_disk_from_xs_be(libxl__gc *gc,
-                                          const char *be_path,
-                                          libxl_device_disk *disk)
+static int libxl__device_disk_from_xs_be(libxl__gc *gc,
+                                         const char *be_path,
+                                         libxl_device_disk *disk)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     unsigned int len;
@@ -2179,6 +2179,7 @@ static void libxl__device_disk_from_xs_b
 
     libxl_device_disk_init(disk);
 
+    /* "params" may not be present; but everything else must be. */
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
     if (tmp && strchr(tmp, ':')) {
@@ -2187,21 +2188,36 @@ static void libxl__device_disk_from_xs_b
     } else {
         disk->pdev_path = tmp;
     }
-    libxl_string_to_backend(ctx,
-                        libxl__xs_read(gc, XBT_NULL,
-                                       libxl__sprintf(gc, "%s/type", be_path)),
-                        &(disk->backend));
+
+
+    tmp = libxl__xs_read(gc, XBT_NULL,
+                         libxl__sprintf(gc, "%s/type", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/type", be_path);
+        goto cleanup;
+    }
+    libxl_string_to_backend(ctx, tmp, &(disk->backend));
+
     disk->vdev = xs_read(ctx->xsh, XBT_NULL,
                          libxl__sprintf(gc, "%s/dev", be_path), &len);
+    if (!disk->vdev) {
+        LOG(ERROR, "Missing xenstore node %s/dev", be_path);
+        goto cleanup;
+    }
+
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf
                          (gc, "%s/removable", be_path));
-
-    if (tmp)
-        disk->removable = atoi(tmp);
-    else
-        disk->removable = 0;
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/removable", be_path);
+        goto cleanup;
+    }
+    disk->removable = atoi(tmp);
 
     tmp = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/mode", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/mode", be_path);
+        goto cleanup;
+    }
     if (!strcmp(tmp, "w"))
         disk->readwrite = 1;
     else
@@ -2209,9 +2225,18 @@ static void libxl__device_disk_from_xs_b
 
     tmp = libxl__xs_read(gc, XBT_NULL,
                          libxl__sprintf(gc, "%s/device-type", be_path));
+    if (!tmp) {
+        LOG(ERROR, "Missing xenstore node %s/device-type", be_path);
+        goto cleanup;
+    }
     disk->is_cdrom = !strcmp(tmp, "cdrom");
 
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
+
+    return 0;
+cleanup:
+    libxl_device_disk_dispose(disk);
+    return ERROR_FAIL;
 }
 
 int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
@@ -2237,9 +2262,7 @@ int libxl_vdev_to_device_disk(libxl_ctx 
     if (!path)
         goto out;
 
-    libxl__device_disk_from_xs_be(gc, path, disk);
-
-    rc = 0;
+    rc = libxl__device_disk_from_xs_be(gc, path, disk);
 out:
     GC_FREE;
     return rc;
@@ -2256,6 +2279,8 @@ static int libxl__append_disk_list_of_ty
     char **dir = NULL;
     unsigned int n = 0;
     libxl_device_disk *pdisk = NULL, *pdisk_end = NULL;
+    int rc=0;
+    int initial_disks = *ndisks;
 
     be_path = libxl__sprintf(gc, "%s/backend/%s/%d",
                              libxl__xs_get_dompath(gc, 0), type, domid);
@@ -2266,17 +2291,19 @@ static int libxl__append_disk_list_of_ty
         if (tmp == NULL)
             return ERROR_NOMEM;
         *disks = tmp;
-        pdisk = *disks + *ndisks;
-        *ndisks += n;
-        pdisk_end = *disks + *ndisks;
+        pdisk = *disks + initial_disks;
+        pdisk_end = *disks + initial_disks + n;
         for (; pdisk < pdisk_end; pdisk++, dir++) {
             const char *p;
             p = libxl__sprintf(gc, "%s/%s", be_path, *dir);
-            libxl__device_disk_from_xs_be(gc, p, pdisk);
+            if ((rc=libxl__device_disk_from_xs_be(gc, p, pdisk)))
+                goto out;
             pdisk->backend_domid = 0;
+            *ndisks += 1;
         }
     }
-    return 0;
+out:
+    return rc;
 }
 
 libxl_device_disk *libxl_device_disk_list(libxl_ctx *ctx, uint32_t domid, int *num)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWs-0007YK-LR; Tue, 11 Dec 2012 04:33:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-0007Xz-HZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Received: from [85.158.143.99:51221] by server-3.bemta-4.messagelabs.com id
	97/39-18211-987B6C05; Tue, 11 Dec 2012 04:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1355200391!19275525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3004 invoked from network); 11 Dec 2012 04:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWp-0003Hb-D3
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWp-00077m-3w
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:11 +0000
Message-Id: <E1TiHWp-00077m-3w@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] mini-os: drop shutdown variables
	when CONFIG_XENBUS=n
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Samuel Thibault <samuel.thibault@ens-lyon.org>
# Date 1354785751 0
# Node ID 85ea612be837c6e765dce2de44c8aa874af79f3c
# Parent  51767f7f6ccc604297be5a0a47e73b2963eca4d6
mini-os: drop shutdown variables when CONFIG_XENBUS=n

Shutdown variables are meaningless when CONFIG_XENBUS=n since no
shutdown event will ever happen.  Better make sure that no code tries
to use it and never get the hoped shutdown event.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 51767f7f6ccc -r 85ea612be837 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c	Thu Dec 06 09:21:49 2012 +0000
+++ b/extras/mini-os/kernel.c	Thu Dec 06 09:22:31 2012 +0000
@@ -48,9 +48,11 @@
 
 uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
 
+#ifdef CONFIG_XENBUS
 unsigned int do_shutdown = 0;
 unsigned int shutdown_reason;
 DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
+#endif
 
 void setup_xen_features(void)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWs-0007YK-LR; Tue, 11 Dec 2012 04:33:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-0007Xz-HZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Received: from [85.158.143.99:51221] by server-3.bemta-4.messagelabs.com id
	97/39-18211-987B6C05; Tue, 11 Dec 2012 04:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1355200391!19275525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3004 invoked from network); 11 Dec 2012 04:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWp-0003Hb-D3
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWp-00077m-3w
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:11 +0000
Message-Id: <E1TiHWp-00077m-3w@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] mini-os: drop shutdown variables
	when CONFIG_XENBUS=n
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Samuel Thibault <samuel.thibault@ens-lyon.org>
# Date 1354785751 0
# Node ID 85ea612be837c6e765dce2de44c8aa874af79f3c
# Parent  51767f7f6ccc604297be5a0a47e73b2963eca4d6
mini-os: drop shutdown variables when CONFIG_XENBUS=n

Shutdown variables are meaningless when CONFIG_XENBUS=n since no
shutdown event will ever happen.  Better make sure that no code tries
to use it and never get the hoped shutdown event.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 51767f7f6ccc -r 85ea612be837 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c	Thu Dec 06 09:21:49 2012 +0000
+++ b/extras/mini-os/kernel.c	Thu Dec 06 09:22:31 2012 +0000
@@ -48,9 +48,11 @@
 
 uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
 
+#ifdef CONFIG_XENBUS
 unsigned int do_shutdown = 0;
 unsigned int shutdown_reason;
 DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
+#endif
 
 void setup_xen_features(void)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWw-0007ZJ-TH; Tue, 11 Dec 2012 04:33:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0007Xz-90
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Received: from [85.158.143.99:51321] by server-3.bemta-4.messagelabs.com id
	80/49-18211-E87B6C05; Tue, 11 Dec 2012 04:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1355200396!22511085!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10232 invoked from network); 11 Dec 2012 04:33:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWt-0003I2-VO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWt-00079x-T1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:15 +0000
Message-Id: <E1TiHWt-00079x-T1@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] memop: adjust error checking in
	populate_physmap()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354799955 -3600
# Node ID 51d2ae389383de3c6412a6cdc34ddcda1d0d0c8f
# Parent  8f7bb944bcb6f736db8a9562e904628ec4629f67
memop: adjust error checking in populate_physmap()

Checking that multi-page allocations are permitted is unnecessary for
PoD population operations. Instead, the (loop invariant) check added
for addressing XSA-31 can be moved here.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 8f7bb944bcb6 -r 51d2ae389383 xen/common/memory.c
--- a/xen/common/memory.c	Thu Dec 06 14:13:51 2012 +0100
+++ b/xen/common/memory.c	Thu Dec 06 14:19:15 2012 +0100
@@ -99,7 +99,8 @@ static void populate_physmap(struct memo
                                      a->nr_extents-1) )
         return;
 
-    if ( !multipage_allocation_permitted(current->domain, a->extent_order) )
+    if ( a->memflags & MEMF_populate_on_demand ? a->extent_order > MAX_ORDER :
+         !multipage_allocation_permitted(current->domain, a->extent_order) )
         return;
 
     for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -115,8 +116,7 @@ static void populate_physmap(struct memo
 
         if ( a->memflags & MEMF_populate_on_demand )
         {
-            if ( a->extent_order > MAX_ORDER ||
-                 guest_physmap_mark_populate_on_demand(d, gpfn,
+            if ( guest_physmap_mark_populate_on_demand(d, gpfn,
                                                        a->extent_order) < 0 )
                 goto out;
         }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWw-0007ZJ-TH; Tue, 11 Dec 2012 04:33:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0007Xz-90
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Received: from [85.158.143.99:51321] by server-3.bemta-4.messagelabs.com id
	80/49-18211-E87B6C05; Tue, 11 Dec 2012 04:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1355200396!22511085!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10232 invoked from network); 11 Dec 2012 04:33:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWt-0003I2-VO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWt-00079x-T1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:15 +0000
Message-Id: <E1TiHWt-00079x-T1@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] memop: adjust error checking in
	populate_physmap()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354799955 -3600
# Node ID 51d2ae389383de3c6412a6cdc34ddcda1d0d0c8f
# Parent  8f7bb944bcb6f736db8a9562e904628ec4629f67
memop: adjust error checking in populate_physmap()

Checking that multi-page allocations are permitted is unnecessary for
PoD population operations. Instead, the (loop invariant) check added
for addressing XSA-31 can be moved here.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 8f7bb944bcb6 -r 51d2ae389383 xen/common/memory.c
--- a/xen/common/memory.c	Thu Dec 06 14:13:51 2012 +0100
+++ b/xen/common/memory.c	Thu Dec 06 14:19:15 2012 +0100
@@ -99,7 +99,8 @@ static void populate_physmap(struct memo
                                      a->nr_extents-1) )
         return;
 
-    if ( !multipage_allocation_permitted(current->domain, a->extent_order) )
+    if ( a->memflags & MEMF_populate_on_demand ? a->extent_order > MAX_ORDER :
+         !multipage_allocation_permitted(current->domain, a->extent_order) )
         return;
 
     for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -115,8 +116,7 @@ static void populate_physmap(struct memo
 
         if ( a->memflags & MEMF_populate_on_demand )
         {
-            if ( a->extent_order > MAX_ORDER ||
-                 guest_physmap_mark_populate_on_demand(d, gpfn,
+            if ( guest_physmap_mark_populate_on_demand(d, gpfn,
                                                        a->extent_order) < 0 )
                 goto out;
         }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWu-0007Yp-O2; Tue, 11 Dec 2012 04:33:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWt-0007YX-UW
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Received: from [85.158.143.99:12475] by server-1.bemta-4.messagelabs.com id
	D8/C5-28401-B87B6C05; Tue, 11 Dec 2012 04:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1355200393!28889543!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7323 invoked from network); 11 Dec 2012 04:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-0003Hn-IM
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-00078k-7K
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Message-Id: <E1TiHWr-00078k-7K@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: disable interrupts on
	return_to_hypervisor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1354789148 0
# Node ID d3c96e02e53270040a4f8ad0ea89796a5bf59cdd
# Parent  0c96325e2c8fbf279c0c30c8b630b1855c5945bb
xen/arm: disable interrupts on return_to_hypervisor

At the moment it is possible to reach return_to_hypervisor with
interrupts enabled (it happens all the times when we are actually going
back to hypervisor mode, when we don't take the return_to_guest path).

If that happens we risk loosing the content of ELR_hyp: if we receive an
interrupt right after restoring ELR_hyp, once we come back we'll have a
different value in ELR_hyp and the original is lost.

In order to make the return_to_hypervisor path safe, we disable
interrupts before restoring any registers.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 0c96325e2c8f -r d3c96e02e532 xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S	Thu Dec 06 10:19:07 2012 +0000
+++ b/xen/arch/arm/entry.S	Thu Dec 06 10:19:08 2012 +0000
@@ -108,6 +108,7 @@ ENTRY(return_to_guest)
 	RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq);
 	/* Fall thru */
 ENTRY(return_to_hypervisor)
+	cpsid i
 	ldr lr, [sp, #UREGS_lr]
 	ldr r11, [sp, #UREGS_pc]
 	msr ELR_hyp, r11

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWu-0007Yp-O2; Tue, 11 Dec 2012 04:33:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWt-0007YX-UW
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Received: from [85.158.143.99:12475] by server-1.bemta-4.messagelabs.com id
	D8/C5-28401-B87B6C05; Tue, 11 Dec 2012 04:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1355200393!28889543!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7323 invoked from network); 11 Dec 2012 04:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-0003Hn-IM
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-00078k-7K
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Message-Id: <E1TiHWr-00078k-7K@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: disable interrupts on
	return_to_hypervisor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1354789148 0
# Node ID d3c96e02e53270040a4f8ad0ea89796a5bf59cdd
# Parent  0c96325e2c8fbf279c0c30c8b630b1855c5945bb
xen/arm: disable interrupts on return_to_hypervisor

At the moment it is possible to reach return_to_hypervisor with
interrupts enabled (it happens all the times when we are actually going
back to hypervisor mode, when we don't take the return_to_guest path).

If that happens we risk loosing the content of ELR_hyp: if we receive an
interrupt right after restoring ELR_hyp, once we come back we'll have a
different value in ELR_hyp and the original is lost.

In order to make the return_to_hypervisor path safe, we disable
interrupts before restoring any registers.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 0c96325e2c8f -r d3c96e02e532 xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S	Thu Dec 06 10:19:07 2012 +0000
+++ b/xen/arch/arm/entry.S	Thu Dec 06 10:19:08 2012 +0000
@@ -108,6 +108,7 @@ ENTRY(return_to_guest)
 	RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq);
 	/* Fall thru */
 ENTRY(return_to_hypervisor)
+	cpsid i
 	ldr lr, [sp, #UREGS_lr]
 	ldr r11, [sp, #UREGS_pc]
 	msr ELR_hyp, r11

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWy-0007Zq-1r; Tue, 11 Dec 2012 04:33:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0007YX-Pi
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Received: from [85.158.143.99:12547] by server-1.bemta-4.messagelabs.com id
	12/D5-28401-E87B6C05; Tue, 11 Dec 2012 04:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1355200396!22042029!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30897 invoked from network); 11 Dec 2012 04:33:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWu-0003I5-GP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWu-0007AC-Ep
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Message-Id: <E1TiHWu-0007AC-Ep@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tighten guest memory accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354800015 -3600
# Node ID d828f23b72c88795724b8a62c9749144321eec1a
# Parent  51d2ae389383de3c6412a6cdc34ddcda1d0d0c8f
tighten guest memory accesses

Failure should always be detected and handled.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 51d2ae389383 -r d828f23b72c8 xen/common/compat/grant_table.c
--- a/xen/common/compat/grant_table.c	Thu Dec 06 14:19:15 2012 +0100
+++ b/xen/common/compat/grant_table.c	Thu Dec 06 14:20:15 2012 +0100
@@ -173,7 +173,9 @@ int compat_grant_table_op(unsigned int c
                         for ( i = 0; i < (_s_)->nr_frames; ++i ) \
                         { \
                             unsigned int frame = (_s_)->frame_list.p[i]; \
-                            (void)__copy_to_compat_offset((_d_)->frame_list, i, &frame, 1); \
+                            if ( __copy_to_compat_offset((_d_)->frame_list, \
+                                                         i, &frame, 1) ) \
+                                (_s_)->status = GNTST_bad_virt_addr; \
                         } \
                     } \
                 } while (0)
@@ -310,7 +312,9 @@ int compat_grant_table_op(unsigned int c
                         for ( i = 0; i < (_s_)->nr_frames; ++i ) \
                         { \
                             uint64_t frame = (_s_)->frame_list.p[i]; \
-                            (void)__copy_to_compat_offset((_d_)->frame_list, i, &frame, 1); \
+                            if ( __copy_to_compat_offset((_d_)->frame_list, \
+                                                         i, &frame, 1) ) \
+                                (_s_)->status = GNTST_bad_virt_addr; \
                         } \
                     } \
                 } while (0)
diff -r 51d2ae389383 -r d828f23b72c8 xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Thu Dec 06 14:19:15 2012 +0100
+++ b/xen/common/compat/memory.c	Thu Dec 06 14:20:15 2012 +0100
@@ -283,18 +283,25 @@ int compat_memory_op(unsigned int cmd, X
                 compat_pfn_t pfn = nat.xchg->out.extent_start.p[start_extent];
 
                 BUG_ON(pfn != nat.xchg->out.extent_start.p[start_extent]);
-                /* Note that we ignore errors accessing the output extent list. */
-                __copy_to_compat_offset(cmp.xchg.out.extent_start, start_extent, &pfn, 1);
+                if ( __copy_to_compat_offset(cmp.xchg.out.extent_start,
+                                             start_extent, &pfn, 1) )
+                {
+                    rc = -EFAULT;
+                    break;
+                }
             }
 
             cmp.xchg.nr_exchanged = nat.xchg->nr_exchanged;
             if ( copy_field_to_guest(guest_handle_cast(compat, compat_memory_exchange_t),
                                      &cmp.xchg, nr_exchanged) )
+                rc = -EFAULT;
+
+            if ( rc < 0 )
             {
                 if ( split < 0 )
                     /* Cannot cancel the continuation... */
                     domain_crash(current->domain);
-                return -EFAULT;
+                return rc;
             }
             break;
         }
diff -r 51d2ae389383 -r d828f23b72c8 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Dec 06 14:19:15 2012 +0100
+++ b/xen/common/grant_table.c	Thu Dec 06 14:20:15 2012 +0100
@@ -1347,6 +1347,9 @@ gnttab_setup_table(
         goto out1;
     }
 
+    if ( !guest_handle_okay(op.frame_list, op.nr_frames) )
+        return -EFAULT;
+
     d = gt_lock_target_domain_by_id(op.dom);
     if ( IS_ERR(d) )
     {
@@ -1384,7 +1387,8 @@ gnttab_setup_table(
         gmfn = gnttab_shared_gmfn(d, gt, i);
         /* Grant tables cannot be shared */
         BUG_ON(SHARED_M2P(gmfn));
-        (void)copy_to_guest_offset(op.frame_list, i, &gmfn, 1);
+        if ( __copy_to_guest_offset(op.frame_list, i, &gmfn, 1) )
+            op.status = GNTST_bad_virt_addr;
     }
 
  out3:
diff -r 51d2ae389383 -r d828f23b72c8 xen/common/memory.c
--- a/xen/common/memory.c	Thu Dec 06 14:19:15 2012 +0100
+++ b/xen/common/memory.c	Thu Dec 06 14:20:15 2012 +0100
@@ -445,8 +445,7 @@ static long memory_exchange(XEN_GUEST_HA
         }
 
         /* Assign each output page to the domain. */
-        j = 0;
-        while ( (page = page_list_remove_head(&out_chunk_list)) )
+        for ( j = 0; (page = page_list_remove_head(&out_chunk_list)); ++j )
         {
             if ( assign_pages(d, page, exch.out.extent_order,
                               MEMF_no_refcount) )
@@ -477,9 +476,12 @@ static long memory_exchange(XEN_GUEST_HA
                 goto dying;
             }
 
-            /* Note that we ignore errors accessing the output extent list. */
-            (void)__copy_from_guest_offset(
-                &gpfn, exch.out.extent_start, (i<<out_chunk_order)+j, 1);
+            if ( __copy_from_guest_offset(&gpfn, exch.out.extent_start,
+                                          (i << out_chunk_order) + j, 1) )
+            {
+                rc = -EFAULT;
+                continue;
+            }
 
             mfn = page_to_mfn(page);
             guest_physmap_add_page(d, gpfn, mfn, exch.out.extent_order);
@@ -488,10 +490,11 @@ static long memory_exchange(XEN_GUEST_HA
             {
                 for ( k = 0; k < (1UL << exch.out.extent_order); k++ )
                     set_gpfn_from_mfn(mfn + k, gpfn + k);
-                (void)__copy_to_guest_offset(
-                    exch.out.extent_start, (i<<out_chunk_order)+j, &mfn, 1);
+                if ( __copy_to_guest_offset(exch.out.extent_start,
+                                            (i << out_chunk_order) + j,
+                                            &mfn, 1) )
+                    rc = -EFAULT;
             }
-            j++;
         }
         BUG_ON( !(d->is_dying) && (j != (1UL << out_chunk_order)) );
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWy-0007Zq-1r; Tue, 11 Dec 2012 04:33:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0007YX-Pi
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Received: from [85.158.143.99:12547] by server-1.bemta-4.messagelabs.com id
	12/D5-28401-E87B6C05; Tue, 11 Dec 2012 04:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1355200396!22042029!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30897 invoked from network); 11 Dec 2012 04:33:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWu-0003I5-GP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWu-0007AC-Ep
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Message-Id: <E1TiHWu-0007AC-Ep@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tighten guest memory accesses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354800015 -3600
# Node ID d828f23b72c88795724b8a62c9749144321eec1a
# Parent  51d2ae389383de3c6412a6cdc34ddcda1d0d0c8f
tighten guest memory accesses

Failure should always be detected and handled.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 51d2ae389383 -r d828f23b72c8 xen/common/compat/grant_table.c
--- a/xen/common/compat/grant_table.c	Thu Dec 06 14:19:15 2012 +0100
+++ b/xen/common/compat/grant_table.c	Thu Dec 06 14:20:15 2012 +0100
@@ -173,7 +173,9 @@ int compat_grant_table_op(unsigned int c
                         for ( i = 0; i < (_s_)->nr_frames; ++i ) \
                         { \
                             unsigned int frame = (_s_)->frame_list.p[i]; \
-                            (void)__copy_to_compat_offset((_d_)->frame_list, i, &frame, 1); \
+                            if ( __copy_to_compat_offset((_d_)->frame_list, \
+                                                         i, &frame, 1) ) \
+                                (_s_)->status = GNTST_bad_virt_addr; \
                         } \
                     } \
                 } while (0)
@@ -310,7 +312,9 @@ int compat_grant_table_op(unsigned int c
                         for ( i = 0; i < (_s_)->nr_frames; ++i ) \
                         { \
                             uint64_t frame = (_s_)->frame_list.p[i]; \
-                            (void)__copy_to_compat_offset((_d_)->frame_list, i, &frame, 1); \
+                            if ( __copy_to_compat_offset((_d_)->frame_list, \
+                                                         i, &frame, 1) ) \
+                                (_s_)->status = GNTST_bad_virt_addr; \
                         } \
                     } \
                 } while (0)
diff -r 51d2ae389383 -r d828f23b72c8 xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Thu Dec 06 14:19:15 2012 +0100
+++ b/xen/common/compat/memory.c	Thu Dec 06 14:20:15 2012 +0100
@@ -283,18 +283,25 @@ int compat_memory_op(unsigned int cmd, X
                 compat_pfn_t pfn = nat.xchg->out.extent_start.p[start_extent];
 
                 BUG_ON(pfn != nat.xchg->out.extent_start.p[start_extent]);
-                /* Note that we ignore errors accessing the output extent list. */
-                __copy_to_compat_offset(cmp.xchg.out.extent_start, start_extent, &pfn, 1);
+                if ( __copy_to_compat_offset(cmp.xchg.out.extent_start,
+                                             start_extent, &pfn, 1) )
+                {
+                    rc = -EFAULT;
+                    break;
+                }
             }
 
             cmp.xchg.nr_exchanged = nat.xchg->nr_exchanged;
             if ( copy_field_to_guest(guest_handle_cast(compat, compat_memory_exchange_t),
                                      &cmp.xchg, nr_exchanged) )
+                rc = -EFAULT;
+
+            if ( rc < 0 )
             {
                 if ( split < 0 )
                     /* Cannot cancel the continuation... */
                     domain_crash(current->domain);
-                return -EFAULT;
+                return rc;
             }
             break;
         }
diff -r 51d2ae389383 -r d828f23b72c8 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Dec 06 14:19:15 2012 +0100
+++ b/xen/common/grant_table.c	Thu Dec 06 14:20:15 2012 +0100
@@ -1347,6 +1347,9 @@ gnttab_setup_table(
         goto out1;
     }
 
+    if ( !guest_handle_okay(op.frame_list, op.nr_frames) )
+        return -EFAULT;
+
     d = gt_lock_target_domain_by_id(op.dom);
     if ( IS_ERR(d) )
     {
@@ -1384,7 +1387,8 @@ gnttab_setup_table(
         gmfn = gnttab_shared_gmfn(d, gt, i);
         /* Grant tables cannot be shared */
         BUG_ON(SHARED_M2P(gmfn));
-        (void)copy_to_guest_offset(op.frame_list, i, &gmfn, 1);
+        if ( __copy_to_guest_offset(op.frame_list, i, &gmfn, 1) )
+            op.status = GNTST_bad_virt_addr;
     }
 
  out3:
diff -r 51d2ae389383 -r d828f23b72c8 xen/common/memory.c
--- a/xen/common/memory.c	Thu Dec 06 14:19:15 2012 +0100
+++ b/xen/common/memory.c	Thu Dec 06 14:20:15 2012 +0100
@@ -445,8 +445,7 @@ static long memory_exchange(XEN_GUEST_HA
         }
 
         /* Assign each output page to the domain. */
-        j = 0;
-        while ( (page = page_list_remove_head(&out_chunk_list)) )
+        for ( j = 0; (page = page_list_remove_head(&out_chunk_list)); ++j )
         {
             if ( assign_pages(d, page, exch.out.extent_order,
                               MEMF_no_refcount) )
@@ -477,9 +476,12 @@ static long memory_exchange(XEN_GUEST_HA
                 goto dying;
             }
 
-            /* Note that we ignore errors accessing the output extent list. */
-            (void)__copy_from_guest_offset(
-                &gpfn, exch.out.extent_start, (i<<out_chunk_order)+j, 1);
+            if ( __copy_from_guest_offset(&gpfn, exch.out.extent_start,
+                                          (i << out_chunk_order) + j, 1) )
+            {
+                rc = -EFAULT;
+                continue;
+            }
 
             mfn = page_to_mfn(page);
             guest_physmap_add_page(d, gpfn, mfn, exch.out.extent_order);
@@ -488,10 +490,11 @@ static long memory_exchange(XEN_GUEST_HA
             {
                 for ( k = 0; k < (1UL << exch.out.extent_order); k++ )
                     set_gpfn_from_mfn(mfn + k, gpfn + k);
-                (void)__copy_to_guest_offset(
-                    exch.out.extent_start, (i<<out_chunk_order)+j, &mfn, 1);
+                if ( __copy_to_guest_offset(exch.out.extent_start,
+                                            (i << out_chunk_order) + j,
+                                            &mfn, 1) )
+                    rc = -EFAULT;
             }
-            j++;
         }
         BUG_ON( !(d->is_dying) && (j != (1UL << out_chunk_order)) );
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWz-0007aI-4N; Tue, 11 Dec 2012 04:33:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWx-0007Zc-Rf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:19 +0000
Received: from [193.109.254.147:10169] by server-8.bemta-14.messagelabs.com id
	0A/BF-05026-F87B6C05; Tue, 11 Dec 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-27.messagelabs.com!1355200391!9907513!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27759 invoked from network); 11 Dec 2012 04:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWo-0003HY-Ua
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWo-00077X-JD
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:10 +0000
Message-Id: <E1TiHWo-00077X-JD@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MAINTAINERS: Device tree is
	maintained by the ARM maintainers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1354785709 0
# Node ID 51767f7f6ccc604297be5a0a47e73b2963eca4d6
# Parent  670b07e8d7382229639af0d1df30071e6c1ebb19
MAINTAINERS: Device tree is maintained by the ARM maintainers

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 670b07e8d738 -r 51767f7f6ccc MAINTAINERS
--- a/MAINTAINERS	Wed Dec 05 09:52:14 2012 +0100
+++ b/MAINTAINERS	Thu Dec 06 09:21:49 2012 +0000
@@ -113,7 +113,9 @@ S:	Supported
 F:	xen/common/cpupool.c
 
 DEVICE TREE
-M:	David Vrabel <david.vrabel@citrix.com>
+M:	Ian Campbell <ian.campbell@citrix.com>
+M:	Stefano Stabellini <stefano.stabellini@citrix.com>
+M:	Tim Deegan <tim@xen.org>
 S:	Supported
 F:	xen/common/libfdt/
 F:	xen/common/device_tree.c

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWz-0007aI-4N; Tue, 11 Dec 2012 04:33:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWx-0007Zc-Rf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:19 +0000
Received: from [193.109.254.147:10169] by server-8.bemta-14.messagelabs.com id
	0A/BF-05026-F87B6C05; Tue, 11 Dec 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-27.messagelabs.com!1355200391!9907513!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27759 invoked from network); 11 Dec 2012 04:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWo-0003HY-Ua
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWo-00077X-JD
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:10 +0000
Message-Id: <E1TiHWo-00077X-JD@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MAINTAINERS: Device tree is
	maintained by the ARM maintainers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1354785709 0
# Node ID 51767f7f6ccc604297be5a0a47e73b2963eca4d6
# Parent  670b07e8d7382229639af0d1df30071e6c1ebb19
MAINTAINERS: Device tree is maintained by the ARM maintainers

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 670b07e8d738 -r 51767f7f6ccc MAINTAINERS
--- a/MAINTAINERS	Wed Dec 05 09:52:14 2012 +0100
+++ b/MAINTAINERS	Thu Dec 06 09:21:49 2012 +0000
@@ -113,7 +113,9 @@ S:	Supported
 F:	xen/common/cpupool.c
 
 DEVICE TREE
-M:	David Vrabel <david.vrabel@citrix.com>
+M:	Ian Campbell <ian.campbell@citrix.com>
+M:	Stefano Stabellini <stefano.stabellini@citrix.com>
+M:	Tim Deegan <tim@xen.org>
 S:	Supported
 F:	xen/common/libfdt/
 F:	xen/common/device_tree.c

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWz-0007aN-7C; Tue, 11 Dec 2012 04:33:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWy-0007ZX-2n
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:20 +0000
Received: from [85.158.137.99:45822] by server-13.bemta-3.messagelabs.com id
	97/86-24887-A87B6C05; Tue, 11 Dec 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1355200392!15634259!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32715 invoked from network); 11 Dec 2012 04:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWq-0003Hh-6k
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWq-00078G-5P
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:12 +0000
Message-Id: <E1TiHWq-00078G-5P@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] gitignore: ignore xen-foreign/arm.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354789146 0
# Node ID 4b6d74b093bcf0bce39491223c1ca9d38c90c8a3
# Parent  53805e238cca849e0751db9bff575c854992af21
gitignore: ignore xen-foreign/arm.h

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 53805e238cca -r 4b6d74b093bc .gitignore
--- a/.gitignore	Thu Dec 06 10:56:53 2012 +0100
+++ b/.gitignore	Thu Dec 06 10:19:06 2012 +0000
@@ -339,6 +339,7 @@ tools/include/xen-foreign/checker.c
 tools/include/xen-foreign/structs.pyc
 tools/include/xen-foreign/x86_32.h
 tools/include/xen-foreign/x86_64.h
+tools/include/xen-foreign/arm.h
 
 .git
 tools/misc/xen-hptool

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWz-0007aN-7C; Tue, 11 Dec 2012 04:33:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWy-0007ZX-2n
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:20 +0000
Received: from [85.158.137.99:45822] by server-13.bemta-3.messagelabs.com id
	97/86-24887-A87B6C05; Tue, 11 Dec 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1355200392!15634259!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32715 invoked from network); 11 Dec 2012 04:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWq-0003Hh-6k
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWq-00078G-5P
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:12 +0000
Message-Id: <E1TiHWq-00078G-5P@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] gitignore: ignore xen-foreign/arm.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354789146 0
# Node ID 4b6d74b093bcf0bce39491223c1ca9d38c90c8a3
# Parent  53805e238cca849e0751db9bff575c854992af21
gitignore: ignore xen-foreign/arm.h

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 53805e238cca -r 4b6d74b093bc .gitignore
--- a/.gitignore	Thu Dec 06 10:56:53 2012 +0100
+++ b/.gitignore	Thu Dec 06 10:19:06 2012 +0000
@@ -339,6 +339,7 @@ tools/include/xen-foreign/checker.c
 tools/include/xen-foreign/structs.pyc
 tools/include/xen-foreign/x86_32.h
 tools/include/xen-foreign/x86_64.h
+tools/include/xen-foreign/arm.h
 
 .git
 tools/misc/xen-hptool

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWs-0007YF-J7; Tue, 11 Dec 2012 04:33:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-0007Xz-2l
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Received: from [85.158.143.99:12399] by server-3.bemta-4.messagelabs.com id
	36/39-18211-887B6C05; Tue, 11 Dec 2012 04:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1355200390!25545435!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26376 invoked from network); 11 Dec 2012 04:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWo-0003HV-EC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWo-00077I-1E
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:10 +0000
Message-Id: <E1TiHWo-00077I-1E@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] IOMMU/ATS: fix maximum queue depth
	calculation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354697534 -3600
# Node ID 670b07e8d7382229639af0d1df30071e6c1ebb19
# Parent  bc624b00d6d601f00a53c2f7502a82dcef60f882
IOMMU/ATS: fix maximum queue depth calculation

The capabilities register field is a 5-bit value, and the 5 bits all
being zero actually means 32 entries.

Under the assumption that amd_iommu_flush_iotlb() really just tried
to correct for the miscalculation above when adding 32 to the value,
that adjustment is also being removed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
---


diff -r bc624b00d6d6 -r 670b07e8d738 xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Tue Dec 04 18:38:31 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Wed Dec 05 09:52:14 2012 +0100
@@ -321,7 +321,7 @@ void amd_iommu_flush_iotlb(struct pci_de
 
     req_id = get_dma_requestor_id(iommu->seg, bdf);
     queueid = req_id;
-    maxpend = (ats_pdev->ats_queue_depth + 32) & 0xff;
+    maxpend = ats_pdev->ats_queue_depth & 0xff;
 
     /* send INVALIDATE_IOTLB_PAGES command */
     spin_lock_irqsave(&iommu->lock, flags);
diff -r bc624b00d6d6 -r 670b07e8d738 xen/drivers/passthrough/ats.h
--- a/xen/drivers/passthrough/ats.h	Tue Dec 04 18:38:31 2012 +0000
+++ b/xen/drivers/passthrough/ats.h	Wed Dec 05 09:52:14 2012 +0100
@@ -28,7 +28,7 @@ struct pci_ats_dev {
 
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
-#define ATS_QUEUE_DEPTH_MASK     0xF
+#define ATS_QUEUE_DEPTH_MASK     0x1f
 #define ATS_ENABLE               (1<<15)
 
 extern struct list_head ats_devices;
diff -r bc624b00d6d6 -r 670b07e8d738 xen/drivers/passthrough/x86/ats.c
--- a/xen/drivers/passthrough/x86/ats.c	Tue Dec 04 18:38:31 2012 +0000
+++ b/xen/drivers/passthrough/x86/ats.c	Wed Dec 05 09:52:14 2012 +0100
@@ -93,7 +93,8 @@ int enable_ats_device(int seg, int bus, 
         pdev->devfn = devfn;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
-        pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK;
+        pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
+                                ATS_QUEUE_DEPTH_MASK + 1;
         list_add(&pdev->list, &ats_devices);
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHWs-0007YF-J7; Tue, 11 Dec 2012 04:33:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWr-0007Xz-2l
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:13 +0000
Received: from [85.158.143.99:12399] by server-3.bemta-4.messagelabs.com id
	36/39-18211-887B6C05; Tue, 11 Dec 2012 04:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1355200390!25545435!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26376 invoked from network); 11 Dec 2012 04:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWo-0003HV-EC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWo-00077I-1E
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:10 +0000
Message-Id: <E1TiHWo-00077I-1E@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] IOMMU/ATS: fix maximum queue depth
	calculation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354697534 -3600
# Node ID 670b07e8d7382229639af0d1df30071e6c1ebb19
# Parent  bc624b00d6d601f00a53c2f7502a82dcef60f882
IOMMU/ATS: fix maximum queue depth calculation

The capabilities register field is a 5-bit value, and the 5 bits all
being zero actually means 32 entries.

Under the assumption that amd_iommu_flush_iotlb() really just tried
to correct for the miscalculation above when adding 32 to the value,
that adjustment is also being removed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
---


diff -r bc624b00d6d6 -r 670b07e8d738 xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Tue Dec 04 18:38:31 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Wed Dec 05 09:52:14 2012 +0100
@@ -321,7 +321,7 @@ void amd_iommu_flush_iotlb(struct pci_de
 
     req_id = get_dma_requestor_id(iommu->seg, bdf);
     queueid = req_id;
-    maxpend = (ats_pdev->ats_queue_depth + 32) & 0xff;
+    maxpend = ats_pdev->ats_queue_depth & 0xff;
 
     /* send INVALIDATE_IOTLB_PAGES command */
     spin_lock_irqsave(&iommu->lock, flags);
diff -r bc624b00d6d6 -r 670b07e8d738 xen/drivers/passthrough/ats.h
--- a/xen/drivers/passthrough/ats.h	Tue Dec 04 18:38:31 2012 +0000
+++ b/xen/drivers/passthrough/ats.h	Wed Dec 05 09:52:14 2012 +0100
@@ -28,7 +28,7 @@ struct pci_ats_dev {
 
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
-#define ATS_QUEUE_DEPTH_MASK     0xF
+#define ATS_QUEUE_DEPTH_MASK     0x1f
 #define ATS_ENABLE               (1<<15)
 
 extern struct list_head ats_devices;
diff -r bc624b00d6d6 -r 670b07e8d738 xen/drivers/passthrough/x86/ats.c
--- a/xen/drivers/passthrough/x86/ats.c	Tue Dec 04 18:38:31 2012 +0000
+++ b/xen/drivers/passthrough/x86/ats.c	Wed Dec 05 09:52:14 2012 +0100
@@ -93,7 +93,8 @@ int enable_ats_device(int seg, int bus, 
         pdev->devfn = devfn;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
-        pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK;
+        pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
+                                ATS_QUEUE_DEPTH_MASK + 1;
         list_add(&pdev->list, &ats_devices);
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX0-0007bg-Ae; Tue, 11 Dec 2012 04:33:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0007aD-6C
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Received: from [193.109.254.147:53156] by server-12.bemta-14.messagelabs.com
	id 5A/9E-00510-097B6C05; Tue, 11 Dec 2012 04:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1355200398!2431343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10548 invoked from network); 11 Dec 2012 04:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0003IE-4f
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0007Av-2L
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Message-Id: <E1TiHWw-0007Av-2L@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: use literal name instead
	of hard numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354812810 0
# Node ID 19abfa1a4c1360d06b19774ad20eb8e4a185eb35
# Parent  df3f06b923c3016b8c21d2f7ecf30b231d285634
nested vmx: use literal name instead of hard numbers

For those default 1 settings in VMX MSR, use some literal name
instead of hard numbers in the code.

Besides, fix the default 1 setting for pin based control MSR.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r df3f06b923c3 -r 19abfa1a4c13 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:52:50 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:53:30 2012 +0000
@@ -1299,7 +1299,7 @@ int nvmx_handle_vmwrite(struct cpu_user_
  */
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
-    u64 data = 0, tmp;
+    u64 data = 0, tmp = 0;
     int r = 1;
 
     if ( !nestedhvm_enabled(current->domain) )
@@ -1318,9 +1318,8 @@ int nvmx_msr_read_intercept(unsigned int
         data = PIN_BASED_EXT_INTR_MASK |
                PIN_BASED_NMI_EXITING |
                PIN_BASED_PREEMPT_TIMER;
-        data <<= 32;
-	/* 0-settings */
-        data |= 0;
+        tmp = VMX_PINBASED_CTLS_DEFAULT1;
+        data = ((data | tmp) << 32) | (tmp);
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS:
         /* 1-seetings */
@@ -1342,8 +1341,7 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_VIRTUAL_NMI_PENDING |
                CPU_BASED_ACTIVATE_MSR_BITMAP |
                CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
-        /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
-        tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
+        tmp = VMX_PROCBASED_CTLS_DEFAULT1;
         /* 0-settings */
         data = ((data | tmp) << 32) | (tmp);
         break;
@@ -1356,8 +1354,7 @@ int nvmx_msr_read_intercept(unsigned int
         break;
     case MSR_IA32_VMX_EXIT_CTLS:
         /* 1-seetings */
-        /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
-        tmp = 0x36dff;
+        tmp = VMX_EXIT_CTLS_DEFAULT1;
         data = VM_EXIT_ACK_INTR_ON_EXIT |
                VM_EXIT_IA32E_MODE |
                VM_EXIT_SAVE_PREEMPT_TIMER |
@@ -1370,8 +1367,8 @@ int nvmx_msr_read_intercept(unsigned int
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
-        /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
-        tmp = 0x11ff;
+        /* 1-seetings */
+        tmp = VMX_ENTRY_CTLS_DEFAULT1;
         data = VM_ENTRY_LOAD_GUEST_PAT |
                VM_ENTRY_LOAD_GUEST_EFER |
                VM_ENTRY_LOAD_PERF_GLOBAL_CTRL;
diff -r df3f06b923c3 -r 19abfa1a4c13 xen/include/asm-x86/hvm/vmx/vvmx.h
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h	Thu Dec 06 16:52:50 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h	Thu Dec 06 16:53:30 2012 +0000
@@ -36,6 +36,15 @@ struct nestedvmx {
 
 #define vcpu_2_nvmx(v)	(vcpu_nestedhvm(v).u.nvmx)
 
+/* bit 1, 2, 4 must be 1 */
+#define VMX_PINBASED_CTLS_DEFAULT1	0x16
+/* bit 1, 4-6,8,13-16,26 must be 1 */
+#define VMX_PROCBASED_CTLS_DEFAULT1	0x401e172
+/* bit 0-8, 10,11,13,14,16,17 must be 1 */
+#define VMX_EXIT_CTLS_DEFAULT1		0x36dff
+/* bit 0-8, and 12 must be 1 */
+#define VMX_ENTRY_CTLS_DEFAULT1		0x11ff
+
 /*
  * Encode of VMX instructions base on Table 24-11 & 24-12 of SDM 3B
  */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX0-0007bg-Ae; Tue, 11 Dec 2012 04:33:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0007aD-6C
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Received: from [193.109.254.147:53156] by server-12.bemta-14.messagelabs.com
	id 5A/9E-00510-097B6C05; Tue, 11 Dec 2012 04:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1355200398!2431343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10548 invoked from network); 11 Dec 2012 04:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0003IE-4f
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0007Av-2L
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Message-Id: <E1TiHWw-0007Av-2L@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: use literal name instead
	of hard numbers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354812810 0
# Node ID 19abfa1a4c1360d06b19774ad20eb8e4a185eb35
# Parent  df3f06b923c3016b8c21d2f7ecf30b231d285634
nested vmx: use literal name instead of hard numbers

For those default 1 settings in VMX MSR, use some literal name
instead of hard numbers in the code.

Besides, fix the default 1 setting for pin based control MSR.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r df3f06b923c3 -r 19abfa1a4c13 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:52:50 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:53:30 2012 +0000
@@ -1299,7 +1299,7 @@ int nvmx_handle_vmwrite(struct cpu_user_
  */
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
-    u64 data = 0, tmp;
+    u64 data = 0, tmp = 0;
     int r = 1;
 
     if ( !nestedhvm_enabled(current->domain) )
@@ -1318,9 +1318,8 @@ int nvmx_msr_read_intercept(unsigned int
         data = PIN_BASED_EXT_INTR_MASK |
                PIN_BASED_NMI_EXITING |
                PIN_BASED_PREEMPT_TIMER;
-        data <<= 32;
-	/* 0-settings */
-        data |= 0;
+        tmp = VMX_PINBASED_CTLS_DEFAULT1;
+        data = ((data | tmp) << 32) | (tmp);
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS:
         /* 1-seetings */
@@ -1342,8 +1341,7 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_VIRTUAL_NMI_PENDING |
                CPU_BASED_ACTIVATE_MSR_BITMAP |
                CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
-        /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
-        tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
+        tmp = VMX_PROCBASED_CTLS_DEFAULT1;
         /* 0-settings */
         data = ((data | tmp) << 32) | (tmp);
         break;
@@ -1356,8 +1354,7 @@ int nvmx_msr_read_intercept(unsigned int
         break;
     case MSR_IA32_VMX_EXIT_CTLS:
         /* 1-seetings */
-        /* bit 0-8, 10,11,13,14,16,17 must be 1 (refer G4 of SDM) */
-        tmp = 0x36dff;
+        tmp = VMX_EXIT_CTLS_DEFAULT1;
         data = VM_EXIT_ACK_INTR_ON_EXIT |
                VM_EXIT_IA32E_MODE |
                VM_EXIT_SAVE_PREEMPT_TIMER |
@@ -1370,8 +1367,8 @@ int nvmx_msr_read_intercept(unsigned int
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
-        /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
-        tmp = 0x11ff;
+        /* 1-seetings */
+        tmp = VMX_ENTRY_CTLS_DEFAULT1;
         data = VM_ENTRY_LOAD_GUEST_PAT |
                VM_ENTRY_LOAD_GUEST_EFER |
                VM_ENTRY_LOAD_PERF_GLOBAL_CTRL;
diff -r df3f06b923c3 -r 19abfa1a4c13 xen/include/asm-x86/hvm/vmx/vvmx.h
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h	Thu Dec 06 16:52:50 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h	Thu Dec 06 16:53:30 2012 +0000
@@ -36,6 +36,15 @@ struct nestedvmx {
 
 #define vcpu_2_nvmx(v)	(vcpu_nestedhvm(v).u.nvmx)
 
+/* bit 1, 2, 4 must be 1 */
+#define VMX_PINBASED_CTLS_DEFAULT1	0x16
+/* bit 1, 4-6,8,13-16,26 must be 1 */
+#define VMX_PROCBASED_CTLS_DEFAULT1	0x401e172
+/* bit 0-8, 10,11,13,14,16,17 must be 1 */
+#define VMX_EXIT_CTLS_DEFAULT1		0x36dff
+/* bit 0-8, and 12 must be 1 */
+#define VMX_ENTRY_CTLS_DEFAULT1		0x11ff
+
 /*
  * Encode of VMX instructions base on Table 24-11 & 24-12 of SDM 3B
  */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX1-0007dK-FD; Tue, 11 Dec 2012 04:33:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0007aS-RM
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Received: from [85.158.137.99:11661] by server-14.bemta-3.messagelabs.com id
	55/F9-31424-C87B6C05; Tue, 11 Dec 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1355200395!13433298!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29406 invoked from network); 11 Dec 2012 04:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWs-0003Hw-TB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWs-00079T-Rt
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:14 +0000
Message-Id: <E1TiHWs-00079T-Rt@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] gnttab_usage_print() should be static
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354799590 -3600
# Node ID 42b22e498d0e7e1345966c018bd18a83c067aa4b
# Parent  dc81777ca115fd8cb11023f41df8f969c41ce8cc
gnttab_usage_print() should be static

... as not being used or declared anywhere else.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r dc81777ca115 -r 42b22e498d0e xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Dec 06 10:47:22 2012 +0000
+++ b/xen/common/grant_table.c	Thu Dec 06 14:13:10 2012 +0100
@@ -2802,7 +2802,7 @@ grant_table_destroy(
     d->grant_table = NULL;
 }
 
-void gnttab_usage_print(struct domain *rd)
+static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
     grant_ref_t ref;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX1-0007dK-FD; Tue, 11 Dec 2012 04:33:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0007aS-RM
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Received: from [85.158.137.99:11661] by server-14.bemta-3.messagelabs.com id
	55/F9-31424-C87B6C05; Tue, 11 Dec 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1355200395!13433298!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29406 invoked from network); 11 Dec 2012 04:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWs-0003Hw-TB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWs-00079T-Rt
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:14 +0000
Message-Id: <E1TiHWs-00079T-Rt@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] gnttab_usage_print() should be static
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354799590 -3600
# Node ID 42b22e498d0e7e1345966c018bd18a83c067aa4b
# Parent  dc81777ca115fd8cb11023f41df8f969c41ce8cc
gnttab_usage_print() should be static

... as not being used or declared anywhere else.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r dc81777ca115 -r 42b22e498d0e xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Dec 06 10:47:22 2012 +0000
+++ b/xen/common/grant_table.c	Thu Dec 06 14:13:10 2012 +0100
@@ -2802,7 +2802,7 @@ grant_table_destroy(
     d->grant_table = NULL;
 }
 
-void gnttab_usage_print(struct domain *rd)
+static void gnttab_usage_print(struct domain *rd)
 {
     int first = 1;
     grant_ref_t ref;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX2-0007eY-Mh; Tue, 11 Dec 2012 04:33:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0007bJ-OH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Received: from [85.158.139.211:64786] by server-5.bemta-5.messagelabs.com id
	1B/CC-22648-197B6C05; Tue, 11 Dec 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355200399!19810360!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4113 invoked from network); 11 Dec 2012 04:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0003IH-OL
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0007BA-Jx
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Message-Id: <E1TiHWw-0007BA-Jx@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: expose bit 55 of
	IA32_VMX_BASIC_MSR to guest VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354812837 0
# Node ID bfd8e96fa3f157630f9698401a1f040ca1776c8e
# Parent  19abfa1a4c1360d06b19774ad20eb8e4a185eb35
nested vmx: expose bit 55 of IA32_VMX_BASIC_MSR to guest VMM

Besides, use literal name instead of hard numbers for this bit 55 in
IA32_VMX_BASIC_MSR.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 19abfa1a4c13 -r bfd8e96fa3f1 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Thu Dec 06 16:53:30 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Thu Dec 06 16:53:57 2012 +0000
@@ -237,7 +237,7 @@ static int vmx_init_vmcs_config(void)
          * We check VMX_BASIC_MSR[55] to correctly handle default controls.
          */
         uint32_t must_be_one, must_be_zero, msr = MSR_IA32_VMX_PROCBASED_CTLS;
-        if ( vmx_basic_msr_high & (1u << 23) )
+        if ( vmx_basic_msr_high & (VMX_BASIC_DEFAULT1_ZERO >> 32) )
             msr = MSR_IA32_VMX_TRUE_PROCBASED_CTLS;
         rdmsr(msr, must_be_one, must_be_zero);
         if ( must_be_one & (CPU_BASED_INVLPG_EXITING |
diff -r 19abfa1a4c13 -r bfd8e96fa3f1 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:53:30 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:53:57 2012 +0000
@@ -1311,9 +1311,10 @@ int nvmx_msr_read_intercept(unsigned int
     switch (msr) {
     case MSR_IA32_VMX_BASIC:
         data = VVMCS_REVISION | ((u64)PAGE_SIZE) << 32 | 
-               ((u64)MTRR_TYPE_WRBACK) << 50;
+               ((u64)MTRR_TYPE_WRBACK) << 50 | VMX_BASIC_DEFAULT1_ZERO;
         break;
     case MSR_IA32_VMX_PINBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
         /* 1-seetings */
         data = PIN_BASED_EXT_INTR_MASK |
                PIN_BASED_NMI_EXITING |
@@ -1322,6 +1323,7 @@ int nvmx_msr_read_intercept(unsigned int
         data = ((data | tmp) << 32) | (tmp);
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
         /* 1-seetings */
         data = CPU_BASED_HLT_EXITING |
                CPU_BASED_VIRTUAL_INTR_PENDING |
@@ -1353,6 +1355,7 @@ int nvmx_msr_read_intercept(unsigned int
         data = (data << 32) | tmp;
         break;
     case MSR_IA32_VMX_EXIT_CTLS:
+    case MSR_IA32_VMX_TRUE_EXIT_CTLS:
         /* 1-seetings */
         tmp = VMX_EXIT_CTLS_DEFAULT1;
         data = VM_EXIT_ACK_INTR_ON_EXIT |
@@ -1367,6 +1370,7 @@ int nvmx_msr_read_intercept(unsigned int
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
+    case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
         /* 1-seetings */
         tmp = VMX_ENTRY_CTLS_DEFAULT1;
         data = VM_ENTRY_LOAD_GUEST_PAT |
diff -r 19abfa1a4c13 -r bfd8e96fa3f1 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Thu Dec 06 16:53:30 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Thu Dec 06 16:53:57 2012 +0000
@@ -247,6 +247,12 @@ extern bool_t cpu_has_vmx_ins_outs_instr
 #define VMX_INTR_SHADOW_SMI             0x00000004
 #define VMX_INTR_SHADOW_NMI             0x00000008
 
+/* 
+ * bit 55 of IA32_VMX_BASIC MSR, indicating whether any VMX controls that
+ * default to 1 may be cleared to 0.
+ */
+#define VMX_BASIC_DEFAULT1_ZERO		(1ULL << 55)
+
 /* VMCS field encodings. */
 enum vmcs_field {
     VIRTUAL_PROCESSOR_ID            = 0x00000000,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX2-0007eY-Mh; Tue, 11 Dec 2012 04:33:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0007bJ-OH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Received: from [85.158.139.211:64786] by server-5.bemta-5.messagelabs.com id
	1B/CC-22648-197B6C05; Tue, 11 Dec 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355200399!19810360!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4113 invoked from network); 11 Dec 2012 04:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0003IH-OL
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWw-0007BA-Jx
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:18 +0000
Message-Id: <E1TiHWw-0007BA-Jx@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: expose bit 55 of
	IA32_VMX_BASIC_MSR to guest VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354812837 0
# Node ID bfd8e96fa3f157630f9698401a1f040ca1776c8e
# Parent  19abfa1a4c1360d06b19774ad20eb8e4a185eb35
nested vmx: expose bit 55 of IA32_VMX_BASIC_MSR to guest VMM

Besides, use literal name instead of hard numbers for this bit 55 in
IA32_VMX_BASIC_MSR.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 19abfa1a4c13 -r bfd8e96fa3f1 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Thu Dec 06 16:53:30 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Thu Dec 06 16:53:57 2012 +0000
@@ -237,7 +237,7 @@ static int vmx_init_vmcs_config(void)
          * We check VMX_BASIC_MSR[55] to correctly handle default controls.
          */
         uint32_t must_be_one, must_be_zero, msr = MSR_IA32_VMX_PROCBASED_CTLS;
-        if ( vmx_basic_msr_high & (1u << 23) )
+        if ( vmx_basic_msr_high & (VMX_BASIC_DEFAULT1_ZERO >> 32) )
             msr = MSR_IA32_VMX_TRUE_PROCBASED_CTLS;
         rdmsr(msr, must_be_one, must_be_zero);
         if ( must_be_one & (CPU_BASED_INVLPG_EXITING |
diff -r 19abfa1a4c13 -r bfd8e96fa3f1 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:53:30 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:53:57 2012 +0000
@@ -1311,9 +1311,10 @@ int nvmx_msr_read_intercept(unsigned int
     switch (msr) {
     case MSR_IA32_VMX_BASIC:
         data = VVMCS_REVISION | ((u64)PAGE_SIZE) << 32 | 
-               ((u64)MTRR_TYPE_WRBACK) << 50;
+               ((u64)MTRR_TYPE_WRBACK) << 50 | VMX_BASIC_DEFAULT1_ZERO;
         break;
     case MSR_IA32_VMX_PINBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
         /* 1-seetings */
         data = PIN_BASED_EXT_INTR_MASK |
                PIN_BASED_NMI_EXITING |
@@ -1322,6 +1323,7 @@ int nvmx_msr_read_intercept(unsigned int
         data = ((data | tmp) << 32) | (tmp);
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS:
+    case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
         /* 1-seetings */
         data = CPU_BASED_HLT_EXITING |
                CPU_BASED_VIRTUAL_INTR_PENDING |
@@ -1353,6 +1355,7 @@ int nvmx_msr_read_intercept(unsigned int
         data = (data << 32) | tmp;
         break;
     case MSR_IA32_VMX_EXIT_CTLS:
+    case MSR_IA32_VMX_TRUE_EXIT_CTLS:
         /* 1-seetings */
         tmp = VMX_EXIT_CTLS_DEFAULT1;
         data = VM_EXIT_ACK_INTR_ON_EXIT |
@@ -1367,6 +1370,7 @@ int nvmx_msr_read_intercept(unsigned int
         data = ((data | tmp) << 32) | tmp;
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
+    case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
         /* 1-seetings */
         tmp = VMX_ENTRY_CTLS_DEFAULT1;
         data = VM_ENTRY_LOAD_GUEST_PAT |
diff -r 19abfa1a4c13 -r bfd8e96fa3f1 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Thu Dec 06 16:53:30 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Thu Dec 06 16:53:57 2012 +0000
@@ -247,6 +247,12 @@ extern bool_t cpu_has_vmx_ins_outs_instr
 #define VMX_INTR_SHADOW_SMI             0x00000004
 #define VMX_INTR_SHADOW_NMI             0x00000008
 
+/* 
+ * bit 55 of IA32_VMX_BASIC MSR, indicating whether any VMX controls that
+ * default to 1 may be cleared to 0.
+ */
+#define VMX_BASIC_DEFAULT1_ZERO		(1ULL << 55)
+
 /* VMCS field encodings. */
 enum vmcs_field {
     VIRTUAL_PROCESSOR_ID            = 0x00000000,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX2-0007ex-SV; Tue, 11 Dec 2012 04:33:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0007bz-17
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from [85.158.139.211:64806] by server-4.bemta-5.messagelabs.com id
	39/D8-14693-297B6C05; Tue, 11 Dec 2012 04:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1355200400!19469453!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25678 invoked from network); 11 Dec 2012 04:33:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWy-0003IQ-9a
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWy-0007Bt-57
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:20 +0000
Message-Id: <E1TiHWy-0007Bt-57@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: fix DR access VM exit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813009 0
# Node ID e6eb1e52da7cfcb1a7697b35b4d842f35107d1ed
# Parent  a09150b57ace2fa786dcaefa958f0b197b1b6d4c
nested vmx: fix DR access VM exit

For DR register, we use lazy restore mechanism when access
it. Therefore when receiving such VM exit, L0 should be responsible to
switch to the right DR values, then inject to L1 hypervisor.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r a09150b57ace -r e6eb1e52da7c xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:56:21 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:56:49 2012 +0000
@@ -1641,7 +1641,8 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         break;
     case EXIT_REASON_DR_ACCESS:
         ctrl = __n2_exec_control(v);
-        if ( ctrl & CPU_BASED_MOV_DR_EXITING )
+        if ( (ctrl & CPU_BASED_MOV_DR_EXITING) &&
+            v->arch.hvm_vcpu.flag_dr_dirty )
             nvcpu->nv_vmexit_pending = 1;
         break;
     case EXIT_REASON_INVLPG:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX2-0007ex-SV; Tue, 11 Dec 2012 04:33:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0007bz-17
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from [85.158.139.211:64806] by server-4.bemta-5.messagelabs.com id
	39/D8-14693-297B6C05; Tue, 11 Dec 2012 04:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1355200400!19469453!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25678 invoked from network); 11 Dec 2012 04:33:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWy-0003IQ-9a
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWy-0007Bt-57
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:20 +0000
Message-Id: <E1TiHWy-0007Bt-57@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: fix DR access VM exit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813009 0
# Node ID e6eb1e52da7cfcb1a7697b35b4d842f35107d1ed
# Parent  a09150b57ace2fa786dcaefa958f0b197b1b6d4c
nested vmx: fix DR access VM exit

For DR register, we use lazy restore mechanism when access
it. Therefore when receiving such VM exit, L0 should be responsible to
switch to the right DR values, then inject to L1 hypervisor.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r a09150b57ace -r e6eb1e52da7c xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:56:21 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:56:49 2012 +0000
@@ -1641,7 +1641,8 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         break;
     case EXIT_REASON_DR_ACCESS:
         ctrl = __n2_exec_control(v);
-        if ( ctrl & CPU_BASED_MOV_DR_EXITING )
+        if ( (ctrl & CPU_BASED_MOV_DR_EXITING) &&
+            v->arch.hvm_vcpu.flag_dr_dirty )
             nvcpu->nv_vmexit_pending = 1;
         break;
     case EXIT_REASON_INVLPG:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX2-0007eg-Pi; Tue, 11 Dec 2012 04:33:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0007bQ-R5
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from [85.158.138.51:55879] by server-11.bemta-3.messagelabs.com id
	44/4E-19361-C87B6C05; Tue, 11 Dec 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1355200392!9654400!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27902 invoked from network); 11 Dec 2012 04:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWp-0003He-Tw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWp-000781-Kq
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:11 +0000
Message-Id: <E1TiHWp-000781-Kq@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MAINTAINERS: Reference stable
	maintenance policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354787813 -3600
# Node ID 53805e238cca849e0751db9bff575c854992af21
# Parent  85ea612be837c6e765dce2de44c8aa874af79f3c
MAINTAINERS: Reference stable maintenance policy

I also couldn't resist fixing a typo and adding a reference to
http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 85ea612be837 -r 53805e238cca MAINTAINERS
--- a/MAINTAINERS	Thu Dec 06 09:22:31 2012 +0000
+++ b/MAINTAINERS	Thu Dec 06 10:56:53 2012 +0100
@@ -1,5 +1,6 @@
 
 	List of maintainers and how to submit changes
+	=============================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
@@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
 	'diff -u' to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
-	job the maintainersdo is to keep things looking the same.
+	job the maintainers do is to keep things looking the same.
+
+	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
+	hints on how to submit a patch to xen-unstable in a suitable
+	form.
 
 	PLEASE try to include any credit lines you want added with the
 	patch. It avoids people being missed off by mistake and makes
@@ -34,6 +39,23 @@ 4.	Make sure you have the right to send 
 
 5.	Happy hacking.
 
+
+	Stable Release Maintenance
+	==========================
+
+The policy for inclusion in a Xen stable release is different to that
+for inclusion in xen-unstable.
+
+Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
+information.
+
+Remember to copy the appropriate stable branch maintainer who will be
+listed in this section of the MAINTAINERS file in the appropriate
+branch.
+
+	Unstable Subsystem Maintainers
+	==============================
+
 Descriptions of section entries:
 
 	M: Mail patches to: FullName <address@domain>

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX2-0007eg-Pi; Tue, 11 Dec 2012 04:33:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0007bQ-R5
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from [85.158.138.51:55879] by server-11.bemta-3.messagelabs.com id
	44/4E-19361-C87B6C05; Tue, 11 Dec 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1355200392!9654400!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27902 invoked from network); 11 Dec 2012 04:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWp-0003He-Tw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWp-000781-Kq
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:11 +0000
Message-Id: <E1TiHWp-000781-Kq@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MAINTAINERS: Reference stable
	maintenance policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354787813 -3600
# Node ID 53805e238cca849e0751db9bff575c854992af21
# Parent  85ea612be837c6e765dce2de44c8aa874af79f3c
MAINTAINERS: Reference stable maintenance policy

I also couldn't resist fixing a typo and adding a reference to
http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 85ea612be837 -r 53805e238cca MAINTAINERS
--- a/MAINTAINERS	Thu Dec 06 09:22:31 2012 +0000
+++ b/MAINTAINERS	Thu Dec 06 10:56:53 2012 +0100
@@ -1,5 +1,6 @@
 
 	List of maintainers and how to submit changes
+	=============================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
@@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
 	'diff -u' to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
-	job the maintainersdo is to keep things looking the same.
+	job the maintainers do is to keep things looking the same.
+
+	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
+	hints on how to submit a patch to xen-unstable in a suitable
+	form.
 
 	PLEASE try to include any credit lines you want added with the
 	patch. It avoids people being missed off by mistake and makes
@@ -34,6 +39,23 @@ 4.	Make sure you have the right to send 
 
 5.	Happy hacking.
 
+
+	Stable Release Maintenance
+	==========================
+
+The policy for inclusion in a Xen stable release is different to that
+for inclusion in xen-unstable.
+
+Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
+information.
+
+Remember to copy the appropriate stable branch maintainer who will be
+listed in this section of the MAINTAINERS file in the appropriate
+branch.
+
+	Unstable Subsystem Maintainers
+	==============================
+
 Descriptions of section entries:
 
 	M: Mail patches to: FullName <address@domain>

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX1-0007dT-I6; Tue, 11 Dec 2012 04:33:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0007ad-T3
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Received: from [193.109.254.147:10221] by server-9.bemta-14.messagelabs.com id
	28/98-30773-197B6C05; Tue, 11 Dec 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1355200397!1726035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12854 invoked from network); 11 Dec 2012 04:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWv-0003IB-M9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWv-0007Ag-GR
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:17 +0000
Message-Id: <E1TiHWv-0007Ag-GR@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: emulate MSR bitmaps
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354812770 0
# Node ID df3f06b923c3016b8c21d2f7ecf30b231d285634
# Parent  592a66cf5c1832392b6e7b1aea2ca78b6e9f1a35
nested vmx: emulate MSR bitmaps

In nested vmx virtualization for MSR bitmaps, L0 hypervisor will trap
all the VM exit from L2 guest by disable the MSR_BITMAP feature. When
handling this VM exit, L0 hypervisor judges whether L1 hypervisor uses
MSR_BITMAP feature and the corresponding bit is set to 1. If so, L0
will inject such VM exit into L1 hypervisor; otherwise, L0 will be
responsible for handling this VM exit.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 592a66cf5c18 -r df3f06b923c3 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Thu Dec 06 16:50:48 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Thu Dec 06 16:52:50 2012 +0000
@@ -674,6 +674,34 @@ void vmx_disable_intercept_for_msr(struc
 }
 
 /*
+ * access_type: read == 0, write == 1
+ */
+int vmx_check_msr_bitmap(unsigned long *msr_bitmap, u32 msr, int access_type)
+{
+    int ret = 1;
+    if ( !msr_bitmap )
+        return 1;
+
+    if ( msr <= 0x1fff )
+    {
+        if ( access_type == 0 )
+            ret = test_bit(msr, msr_bitmap + 0x000/BYTES_PER_LONG); /* read-low */
+        else if ( access_type == 1 )
+            ret = test_bit(msr, msr_bitmap + 0x800/BYTES_PER_LONG); /* write-low */
+    }
+    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    {
+        msr &= 0x1fff;
+        if ( access_type == 0 )
+            ret = test_bit(msr, msr_bitmap + 0x400/BYTES_PER_LONG); /* read-high */
+        else if ( access_type == 1 )
+            ret = test_bit(msr, msr_bitmap + 0xc00/BYTES_PER_LONG); /* write-high */
+    }
+    return ret;
+}
+
+
+/*
  * Switch VMCS between layer 1 & 2 guest
  */
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to)
diff -r 592a66cf5c18 -r df3f06b923c3 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:50:48 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:52:50 2012 +0000
@@ -48,6 +48,7 @@ int nvmx_vcpu_initialise(struct vcpu *v)
     nvmx->intr.error_code = 0;
     nvmx->iobitmap[0] = NULL;
     nvmx->iobitmap[1] = NULL;
+    nvmx->msrbitmap = NULL;
     return 0;
 out:
     return -ENOMEM;
@@ -561,6 +562,17 @@ static void __clear_current_vvmcs(struct
         __vmpclear(virt_to_maddr(nvcpu->nv_n2vmcx));
 }
 
+static void __map_msr_bitmap(struct vcpu *v)
+{
+    struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
+    unsigned long gpa;
+
+    if ( nvmx->msrbitmap )
+        hvm_unmap_guest_frame (nvmx->msrbitmap); 
+    gpa = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, MSR_BITMAP);
+    nvmx->msrbitmap = hvm_map_guest_frame_ro(gpa >> PAGE_SHIFT);
+}
+
 static void __map_io_bitmap(struct vcpu *v, u64 vmcs_reg)
 {
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
@@ -597,6 +609,10 @@ static void nvmx_purge_vvmcs(struct vcpu
             nvmx->iobitmap[i] = NULL;
         }
     }
+    if ( nvmx->msrbitmap ) {
+        hvm_unmap_guest_frame(nvmx->msrbitmap);
+        nvmx->msrbitmap = NULL;
+    }
 }
 
 u64 nvmx_get_tsc_offset(struct vcpu *v)
@@ -1153,6 +1169,7 @@ int nvmx_handle_vmptrld(struct cpu_user_
         nvcpu->nv_vvmcx = hvm_map_guest_frame_rw(gpa >> PAGE_SHIFT);
         nvcpu->nv_vvmcxaddr = gpa;
         map_io_bitmap_all (v);
+        __map_msr_bitmap(v);
     }
 
     vmreturn(regs, VMSUCCEED);
@@ -1270,6 +1287,9 @@ int nvmx_handle_vmwrite(struct cpu_user_
               vmcs_encoding == IO_BITMAP_B_HIGH )
         __map_io_bitmap (v, IO_BITMAP_B);
 
+    if ( vmcs_encoding == MSR_BITMAP || vmcs_encoding == MSR_BITMAP_HIGH )
+        __map_msr_bitmap(v);
+
     vmreturn(regs, VMSUCCEED);
     return X86EMUL_OKAY;
 }
@@ -1320,6 +1340,7 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_RDTSC_EXITING |
                CPU_BASED_MONITOR_TRAP_FLAG |
                CPU_BASED_VIRTUAL_NMI_PENDING |
+               CPU_BASED_ACTIVATE_MSR_BITMAP |
                CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
@@ -1497,8 +1518,6 @@ int nvmx_n2_vmexit_handler(struct cpu_us
     case EXIT_REASON_TRIPLE_FAULT:
     case EXIT_REASON_TASK_SWITCH:
     case EXIT_REASON_CPUID:
-    case EXIT_REASON_MSR_READ:
-    case EXIT_REASON_MSR_WRITE:
     case EXIT_REASON_VMCALL:
     case EXIT_REASON_VMCLEAR:
     case EXIT_REASON_VMLAUNCH:
@@ -1514,6 +1533,22 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         /* inject to L1 */
         nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_MSR_READ:
+    case EXIT_REASON_MSR_WRITE:
+    {
+        int status;
+        ctrl = __n2_exec_control(v);
+        if ( ctrl & CPU_BASED_ACTIVATE_MSR_BITMAP )
+        {
+            status = vmx_check_msr_bitmap(nvmx->msrbitmap, regs->ecx,
+                         !!(exit_reason == EXIT_REASON_MSR_WRITE));
+            if ( status )
+                nvcpu->nv_vmexit_pending = 1;
+        }
+        else
+            nvcpu->nv_vmexit_pending = 1;
+        break;
+    }
     case EXIT_REASON_IO_INSTRUCTION:
         ctrl = __n2_exec_control(v);
         if ( ctrl & CPU_BASED_ACTIVATE_IO_BITMAP )
diff -r 592a66cf5c18 -r df3f06b923c3 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Thu Dec 06 16:50:48 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Thu Dec 06 16:52:50 2012 +0000
@@ -427,6 +427,7 @@ int vmx_add_host_load_msr(u32 msr);
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
 void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
+int vmx_check_msr_bitmap(unsigned long *msr_bitmap, u32 msr, int access_type);
 
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
diff -r 592a66cf5c18 -r df3f06b923c3 xen/include/asm-x86/hvm/vmx/vvmx.h
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h	Thu Dec 06 16:50:48 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h	Thu Dec 06 16:52:50 2012 +0000
@@ -26,6 +26,7 @@
 struct nestedvmx {
     paddr_t    vmxon_region_pa;
     void       *iobitmap[2];		/* map (va) of L1 guest I/O bitmap */
+    void       *msrbitmap;		/* map (va) of L1 guest MSR bitmap */
     /* deferred nested interrupt */
     struct {
         unsigned long intr_info;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX1-0007dT-I6; Tue, 11 Dec 2012 04:33:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0007ad-T3
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Received: from [193.109.254.147:10221] by server-9.bemta-14.messagelabs.com id
	28/98-30773-197B6C05; Tue, 11 Dec 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-27.messagelabs.com!1355200397!1726035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12854 invoked from network); 11 Dec 2012 04:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWv-0003IB-M9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWv-0007Ag-GR
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:17 +0000
Message-Id: <E1TiHWv-0007Ag-GR@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: emulate MSR bitmaps
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354812770 0
# Node ID df3f06b923c3016b8c21d2f7ecf30b231d285634
# Parent  592a66cf5c1832392b6e7b1aea2ca78b6e9f1a35
nested vmx: emulate MSR bitmaps

In nested vmx virtualization for MSR bitmaps, L0 hypervisor will trap
all the VM exit from L2 guest by disable the MSR_BITMAP feature. When
handling this VM exit, L0 hypervisor judges whether L1 hypervisor uses
MSR_BITMAP feature and the corresponding bit is set to 1. If so, L0
will inject such VM exit into L1 hypervisor; otherwise, L0 will be
responsible for handling this VM exit.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 592a66cf5c18 -r df3f06b923c3 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Thu Dec 06 16:50:48 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Thu Dec 06 16:52:50 2012 +0000
@@ -674,6 +674,34 @@ void vmx_disable_intercept_for_msr(struc
 }
 
 /*
+ * access_type: read == 0, write == 1
+ */
+int vmx_check_msr_bitmap(unsigned long *msr_bitmap, u32 msr, int access_type)
+{
+    int ret = 1;
+    if ( !msr_bitmap )
+        return 1;
+
+    if ( msr <= 0x1fff )
+    {
+        if ( access_type == 0 )
+            ret = test_bit(msr, msr_bitmap + 0x000/BYTES_PER_LONG); /* read-low */
+        else if ( access_type == 1 )
+            ret = test_bit(msr, msr_bitmap + 0x800/BYTES_PER_LONG); /* write-low */
+    }
+    else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) )
+    {
+        msr &= 0x1fff;
+        if ( access_type == 0 )
+            ret = test_bit(msr, msr_bitmap + 0x400/BYTES_PER_LONG); /* read-high */
+        else if ( access_type == 1 )
+            ret = test_bit(msr, msr_bitmap + 0xc00/BYTES_PER_LONG); /* write-high */
+    }
+    return ret;
+}
+
+
+/*
  * Switch VMCS between layer 1 & 2 guest
  */
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to)
diff -r 592a66cf5c18 -r df3f06b923c3 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:50:48 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:52:50 2012 +0000
@@ -48,6 +48,7 @@ int nvmx_vcpu_initialise(struct vcpu *v)
     nvmx->intr.error_code = 0;
     nvmx->iobitmap[0] = NULL;
     nvmx->iobitmap[1] = NULL;
+    nvmx->msrbitmap = NULL;
     return 0;
 out:
     return -ENOMEM;
@@ -561,6 +562,17 @@ static void __clear_current_vvmcs(struct
         __vmpclear(virt_to_maddr(nvcpu->nv_n2vmcx));
 }
 
+static void __map_msr_bitmap(struct vcpu *v)
+{
+    struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
+    unsigned long gpa;
+
+    if ( nvmx->msrbitmap )
+        hvm_unmap_guest_frame (nvmx->msrbitmap); 
+    gpa = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, MSR_BITMAP);
+    nvmx->msrbitmap = hvm_map_guest_frame_ro(gpa >> PAGE_SHIFT);
+}
+
 static void __map_io_bitmap(struct vcpu *v, u64 vmcs_reg)
 {
     struct nestedvmx *nvmx = &vcpu_2_nvmx(v);
@@ -597,6 +609,10 @@ static void nvmx_purge_vvmcs(struct vcpu
             nvmx->iobitmap[i] = NULL;
         }
     }
+    if ( nvmx->msrbitmap ) {
+        hvm_unmap_guest_frame(nvmx->msrbitmap);
+        nvmx->msrbitmap = NULL;
+    }
 }
 
 u64 nvmx_get_tsc_offset(struct vcpu *v)
@@ -1153,6 +1169,7 @@ int nvmx_handle_vmptrld(struct cpu_user_
         nvcpu->nv_vvmcx = hvm_map_guest_frame_rw(gpa >> PAGE_SHIFT);
         nvcpu->nv_vvmcxaddr = gpa;
         map_io_bitmap_all (v);
+        __map_msr_bitmap(v);
     }
 
     vmreturn(regs, VMSUCCEED);
@@ -1270,6 +1287,9 @@ int nvmx_handle_vmwrite(struct cpu_user_
               vmcs_encoding == IO_BITMAP_B_HIGH )
         __map_io_bitmap (v, IO_BITMAP_B);
 
+    if ( vmcs_encoding == MSR_BITMAP || vmcs_encoding == MSR_BITMAP_HIGH )
+        __map_msr_bitmap(v);
+
     vmreturn(regs, VMSUCCEED);
     return X86EMUL_OKAY;
 }
@@ -1320,6 +1340,7 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_RDTSC_EXITING |
                CPU_BASED_MONITOR_TRAP_FLAG |
                CPU_BASED_VIRTUAL_NMI_PENDING |
+               CPU_BASED_ACTIVATE_MSR_BITMAP |
                CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
         /* bit 1, 4-6,8,13-16,26 must be 1 (refer G4 of SDM) */
         tmp = ( (1<<26) | (0xf << 13) | 0x100 | (0x7 << 4) | 0x2);
@@ -1497,8 +1518,6 @@ int nvmx_n2_vmexit_handler(struct cpu_us
     case EXIT_REASON_TRIPLE_FAULT:
     case EXIT_REASON_TASK_SWITCH:
     case EXIT_REASON_CPUID:
-    case EXIT_REASON_MSR_READ:
-    case EXIT_REASON_MSR_WRITE:
     case EXIT_REASON_VMCALL:
     case EXIT_REASON_VMCLEAR:
     case EXIT_REASON_VMLAUNCH:
@@ -1514,6 +1533,22 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         /* inject to L1 */
         nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_MSR_READ:
+    case EXIT_REASON_MSR_WRITE:
+    {
+        int status;
+        ctrl = __n2_exec_control(v);
+        if ( ctrl & CPU_BASED_ACTIVATE_MSR_BITMAP )
+        {
+            status = vmx_check_msr_bitmap(nvmx->msrbitmap, regs->ecx,
+                         !!(exit_reason == EXIT_REASON_MSR_WRITE));
+            if ( status )
+                nvcpu->nv_vmexit_pending = 1;
+        }
+        else
+            nvcpu->nv_vmexit_pending = 1;
+        break;
+    }
     case EXIT_REASON_IO_INSTRUCTION:
         ctrl = __n2_exec_control(v);
         if ( ctrl & CPU_BASED_ACTIVATE_IO_BITMAP )
diff -r 592a66cf5c18 -r df3f06b923c3 xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h	Thu Dec 06 16:50:48 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h	Thu Dec 06 16:52:50 2012 +0000
@@ -427,6 +427,7 @@ int vmx_add_host_load_msr(u32 msr);
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
 void vmx_set_eoi_exit_bitmap(struct vcpu *v, u8 vector);
 void vmx_clear_eoi_exit_bitmap(struct vcpu *v, u8 vector);
+int vmx_check_msr_bitmap(unsigned long *msr_bitmap, u32 msr, int access_type);
 
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
diff -r 592a66cf5c18 -r df3f06b923c3 xen/include/asm-x86/hvm/vmx/vvmx.h
--- a/xen/include/asm-x86/hvm/vmx/vvmx.h	Thu Dec 06 16:50:48 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vvmx.h	Thu Dec 06 16:52:50 2012 +0000
@@ -26,6 +26,7 @@
 struct nestedvmx {
     paddr_t    vmxon_region_pa;
     void       *iobitmap[2];		/* map (va) of L1 guest I/O bitmap */
+    void       *msrbitmap;		/* map (va) of L1 guest MSR bitmap */
     /* deferred nested interrupt */
     struct {
         unsigned long intr_info;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX3-0007fT-4i; Tue, 11 Dec 2012 04:33:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0007c9-SR
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from [85.158.137.99:4852] by server-9.bemta-3.messagelabs.com id
	FD/67-02388-E87B6C05; Tue, 11 Dec 2012 04:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1355200397!13914963!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25626 invoked from network); 11 Dec 2012 04:33:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWv-0003I8-1F
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWu-0007AR-V6
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Message-Id: <E1TiHWu-0007AR-V6@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/gdbsx: fix build failure with
	glibc-2.17
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1354812648 0
# Node ID 592a66cf5c1832392b6e7b1aea2ca78b6e9f1a35
# Parent  d828f23b72c88795724b8a62c9749144321eec1a
tools/gdbsx: fix build failure with glibc-2.17

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d828f23b72c8 -r 592a66cf5c18 tools/debugger/gdbsx/xg/xg_main.c
--- a/tools/debugger/gdbsx/xg/xg_main.c	Thu Dec 06 14:20:15 2012 +0100
+++ b/tools/debugger/gdbsx/xg/xg_main.c	Thu Dec 06 16:50:48 2012 +0000
@@ -34,6 +34,7 @@
  *  XGTRC(): generic trace utility
  */
 
+#include <sys/types.h>
 #include <stdio.h>
 #include <stddef.h>
 #include <stdarg.h>

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX3-0007fE-0r; Tue, 11 Dec 2012 04:33:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0007c9-6m
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from [85.158.137.99:4800] by server-9.bemta-3.messagelabs.com id
	F9/67-02388-C87B6C05; Tue, 11 Dec 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1355200394!13433295!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29385 invoked from network); 11 Dec 2012 04:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWs-0003Ht-CZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWs-00079E-B9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:14 +0000
Message-Id: <E1TiHWs-00079E-B9@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] X86/vMCE: handle broken page with
	regard to migration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu Jinsong <jinsong.liu@intel.com>
# Date 1354790842 0
# Node ID dc81777ca115fd8cb11023f41df8f969c41ce8cc
# Parent  89bd3c43f883620e481f4fa019e30c96044aec55
X86/vMCE: handle broken page with regard to migration

At the sender
  xc_domain_save has a key point: 'to query the types of all the pages
  with xc_get_pfn_type_batch'
  1) if broken page occur before the key point, migration will be fine
     since proper pfn_type and pfn number will be transferred to the
     target and then take appropriate action;
  2) if broken page occur after the key point, whole system will crash
     and no need care migration any more;

At the target
  Target will populates pages for guest. As for the case of broken page,
  we prefer to keep the type of the page for the sake of seamless migration.
  Target will set p2m as p2m_ram_broken for broken page. If guest access
  the broken page again it will kill itself as expected.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 89bd3c43f883 -r dc81777ca115 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Thu Dec 06 10:19:08 2012 +0000
+++ b/tools/libxc/xc_domain.c	Thu Dec 06 10:47:22 2012 +0000
@@ -283,6 +283,22 @@ int xc_domain_getinfolist(xc_interface *
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 89bd3c43f883 -r dc81777ca115 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Thu Dec 06 10:19:08 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Thu Dec 06 10:47:22 2012 +0000
@@ -1023,9 +1023,15 @@ static int pagebuf_get_one(xc_interface 
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@ static int apply_batch(xc_interface *xch
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r 89bd3c43f883 -r dc81777ca115 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Thu Dec 06 10:19:08 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Thu Dec 06 10:47:22 2012 +0000
@@ -1277,6 +1277,13 @@ int xc_domain_save(xc_interface *xch, in
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1378,12 @@ int xc_domain_save(xc_interface *xch, in
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
diff -r 89bd3c43f883 -r dc81777ca115 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Dec 06 10:19:08 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Dec 06 10:47:22 2012 +0000
@@ -575,6 +575,17 @@ int xc_domain_getinfolist(xc_interface *
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r 89bd3c43f883 -r dc81777ca115 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Dec 06 10:19:08 2012 +0000
+++ b/xen/arch/x86/domctl.c	Thu Dec 06 10:47:22 2012 +0000
@@ -209,12 +209,18 @@ long arch_do_domctl(
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@ long arch_do_domctl(
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@ long arch_do_domctl(
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r 89bd3c43f883 -r dc81777ca115 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Dec 06 10:19:08 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Dec 06 10:47:22 2012 +0000
@@ -136,6 +136,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getme
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -834,6 +835,12 @@ struct xen_domctl_set_access_required {
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -899,6 +906,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -954,6 +962,7 @@ struct xen_domctl {
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX3-0007fd-7e; Tue, 11 Dec 2012 04:33:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0007aD-CW
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Received: from [193.109.254.147:53207] by server-12.bemta-14.messagelabs.com
	id 7F/9E-00510-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1355200399!9526765!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7199 invoked from network); 11 Dec 2012 04:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWx-0003IK-5G
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWx-0007BP-3w
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:19 +0000
Message-Id: <E1TiHWx-0007BP-3w@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: fix rflags status in
	virtual vmexit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354812866 0
# Node ID 312f0713dfc98635fd9ed4b42481581489faa28f
# Parent  bfd8e96fa3f157630f9698401a1f040ca1776c8e
nested vmx: fix rflags status in virtual vmexit

As stated in SDM, all bits (except for those 1-reserved) in rflags
would be set to 0 in VM exit. Therefore we need to follow this logic
in virtual_vmexit.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r bfd8e96fa3f1 -r 312f0713dfc9 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:53:57 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:54:26 2012 +0000
@@ -991,7 +991,8 @@ static void virtual_vmexit(struct cpu_us
 
     regs->eip = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RIP);
     regs->esp = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RSP);
-    regs->eflags = __vmread(GUEST_RFLAGS);
+    /* VM exit clears all bits except bit 1 */
+    regs->eflags = 0x2;
 
     /* updating host cr0 to sync TS bit */
     __vmwrite(HOST_CR0, v->arch.hvm_vmx.host_cr0);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX3-0007fE-0r; Tue, 11 Dec 2012 04:33:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0007c9-6m
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from [85.158.137.99:4800] by server-9.bemta-3.messagelabs.com id
	F9/67-02388-C87B6C05; Tue, 11 Dec 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1355200394!13433295!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29385 invoked from network); 11 Dec 2012 04:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWs-0003Ht-CZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWs-00079E-B9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:14 +0000
Message-Id: <E1TiHWs-00079E-B9@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] X86/vMCE: handle broken page with
	regard to migration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Liu Jinsong <jinsong.liu@intel.com>
# Date 1354790842 0
# Node ID dc81777ca115fd8cb11023f41df8f969c41ce8cc
# Parent  89bd3c43f883620e481f4fa019e30c96044aec55
X86/vMCE: handle broken page with regard to migration

At the sender
  xc_domain_save has a key point: 'to query the types of all the pages
  with xc_get_pfn_type_batch'
  1) if broken page occur before the key point, migration will be fine
     since proper pfn_type and pfn number will be transferred to the
     target and then take appropriate action;
  2) if broken page occur after the key point, whole system will crash
     and no need care migration any more;

At the target
  Target will populates pages for guest. As for the case of broken page,
  we prefer to keep the type of the page for the sake of seamless migration.
  Target will set p2m as p2m_ram_broken for broken page. If guest access
  the broken page again it will kill itself as expected.

Suggested-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 89bd3c43f883 -r dc81777ca115 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Thu Dec 06 10:19:08 2012 +0000
+++ b/tools/libxc/xc_domain.c	Thu Dec 06 10:47:22 2012 +0000
@@ -283,6 +283,22 @@ int xc_domain_getinfolist(xc_interface *
     return ret;
 }
 
+/* set broken page p2m */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn)
+{
+    int ret;
+    DECLARE_DOMCTL;
+
+    domctl.cmd = XEN_DOMCTL_set_broken_page_p2m;
+    domctl.domain = (domid_t)domid;
+    domctl.u.set_broken_page_p2m.pfn = pfn;
+    ret = do_domctl(xch, &domctl);
+
+    return ret ? -1 : 0;
+}
+
 /* get info from hvm guest for save */
 int xc_domain_hvm_getcontext(xc_interface *xch,
                              uint32_t domid,
diff -r 89bd3c43f883 -r dc81777ca115 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Thu Dec 06 10:19:08 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Thu Dec 06 10:47:22 2012 +0000
@@ -1023,9 +1023,15 @@ static int pagebuf_get_one(xc_interface 
 
     countpages = count;
     for (i = oldcount; i < buf->nr_pages; ++i)
-        if ((buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XTAB
-            ||(buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK) == XEN_DOMCTL_PFINFO_XALLOC)
+    {
+        unsigned long pagetype;
+
+        pagetype = buf->pfn_types[i] & XEN_DOMCTL_PFINFO_LTAB_MASK;
+        if ( pagetype == XEN_DOMCTL_PFINFO_XTAB ||
+             pagetype == XEN_DOMCTL_PFINFO_BROKEN ||
+             pagetype == XEN_DOMCTL_PFINFO_XALLOC )
             --countpages;
+    }
 
     if (!countpages)
         return count;
@@ -1267,6 +1273,17 @@ static int apply_batch(xc_interface *xch
             /* a bogus/unmapped/allocate-only page: skip it */
             continue;
 
+        if ( pagetype == XEN_DOMCTL_PFINFO_BROKEN )
+        {
+            if ( xc_set_broken_page_p2m(xch, dom, pfn) )
+            {
+                ERROR("Set p2m for broken page failed, "
+                      "dom=%d, pfn=%lx\n", dom, pfn);
+                goto err_mapped;
+            }
+            continue;
+        }
+
         if (pfn_err[i])
         {
             ERROR("unexpected PFN mapping failure pfn %lx map_mfn %lx p2m_mfn %lx",
diff -r 89bd3c43f883 -r dc81777ca115 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Thu Dec 06 10:19:08 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Thu Dec 06 10:47:22 2012 +0000
@@ -1277,6 +1277,13 @@ int xc_domain_save(xc_interface *xch, in
                 if ( !hvm )
                     gmfn = pfn_to_mfn(gmfn);
 
+                if ( pfn_type[j] == XEN_DOMCTL_PFINFO_BROKEN )
+                {
+                    pfn_type[j] |= pfn_batch[j];
+                    ++run;
+                    continue;
+                }
+
                 if ( pfn_err[j] )
                 {
                     if ( pfn_type[j] == XEN_DOMCTL_PFINFO_XTAB )
@@ -1371,8 +1378,12 @@ int xc_domain_save(xc_interface *xch, in
                     }
                 }
 
-                /* skip pages that aren't present or are alloc-only */
+                /*
+                 * skip pages that aren't present,
+                 * or are broken, or are alloc-only
+                 */
                 if ( pagetype == XEN_DOMCTL_PFINFO_XTAB
+                    || pagetype == XEN_DOMCTL_PFINFO_BROKEN
                     || pagetype == XEN_DOMCTL_PFINFO_XALLOC )
                     continue;
 
diff -r 89bd3c43f883 -r dc81777ca115 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Dec 06 10:19:08 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Dec 06 10:47:22 2012 +0000
@@ -575,6 +575,17 @@ int xc_domain_getinfolist(xc_interface *
                           xc_domaininfo_t *info);
 
 /**
+ * This function set p2m for broken page
+ * &parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id which broken page belong to
+ * @parm pfn the pfn number of the broken page
+ * @return 0 on success, -1 on failure
+ */
+int xc_set_broken_page_p2m(xc_interface *xch,
+                           uint32_t domid,
+                           unsigned long pfn);
+
+/**
  * This function returns information about the context of a hvm domain
  * @parm xch a handle to an open hypervisor interface
  * @parm domid the domain to get information from
diff -r 89bd3c43f883 -r dc81777ca115 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Dec 06 10:19:08 2012 +0000
+++ b/xen/arch/x86/domctl.c	Thu Dec 06 10:47:22 2012 +0000
@@ -209,12 +209,18 @@ long arch_do_domctl(
                 for ( j = 0; j < k; j++ )
                 {
                     unsigned long type = 0;
+                    p2m_type_t t;
 
-                    page = get_page_from_gfn(d, arr[j], NULL, P2M_ALLOC);
+                    page = get_page_from_gfn(d, arr[j], &t, P2M_ALLOC);
 
                     if ( unlikely(!page) ||
                          unlikely(is_xen_heap_page(page)) )
-                        type = XEN_DOMCTL_PFINFO_XTAB;
+                    {
+                        if ( p2m_is_broken(t) )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
+                        else
+                            type = XEN_DOMCTL_PFINFO_XTAB;
+                    }
                     else
                     {
                         switch( page->u.inuse.type_info & PGT_type_mask )
@@ -235,6 +241,9 @@ long arch_do_domctl(
 
                         if ( page->u.inuse.type_info & PGT_pinned )
                             type |= XEN_DOMCTL_PFINFO_LPINTAB;
+
+                        if ( page->count_info & PGC_broken )
+                            type = XEN_DOMCTL_PFINFO_BROKEN;
                     }
 
                     if ( page )
@@ -1568,6 +1577,29 @@ long arch_do_domctl(
     }
     break;
 
+    case XEN_DOMCTL_set_broken_page_p2m:
+    {
+        struct domain *d;
+
+        d = rcu_lock_domain_by_id(domctl->domain);
+        if ( d != NULL )
+        {
+            p2m_type_t pt;
+            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+
+            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+                ret = -EINVAL;
+
+            put_gfn(d, pfn);
+            rcu_unlock_domain(d);
+        }
+        else
+            ret = -ESRCH;
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, u_domctl);
         break;
diff -r 89bd3c43f883 -r dc81777ca115 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Dec 06 10:19:08 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Dec 06 10:47:22 2012 +0000
@@ -136,6 +136,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getme
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -834,6 +835,12 @@ struct xen_domctl_set_access_required {
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -899,6 +906,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -954,6 +962,7 @@ struct xen_domctl {
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX3-0007fT-4i; Tue, 11 Dec 2012 04:33:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0007c9-SR
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from [85.158.137.99:4852] by server-9.bemta-3.messagelabs.com id
	FD/67-02388-E87B6C05; Tue, 11 Dec 2012 04:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1355200397!13914963!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25626 invoked from network); 11 Dec 2012 04:33:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWv-0003I8-1F
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWu-0007AR-V6
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:16 +0000
Message-Id: <E1TiHWu-0007AR-V6@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/gdbsx: fix build failure with
	glibc-2.17
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1354812648 0
# Node ID 592a66cf5c1832392b6e7b1aea2ca78b6e9f1a35
# Parent  d828f23b72c88795724b8a62c9749144321eec1a
tools/gdbsx: fix build failure with glibc-2.17

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d828f23b72c8 -r 592a66cf5c18 tools/debugger/gdbsx/xg/xg_main.c
--- a/tools/debugger/gdbsx/xg/xg_main.c	Thu Dec 06 14:20:15 2012 +0100
+++ b/tools/debugger/gdbsx/xg/xg_main.c	Thu Dec 06 16:50:48 2012 +0000
@@ -34,6 +34,7 @@
  *  XGTRC(): generic trace utility
  */
 
+#include <sys/types.h>
 #include <stdio.h>
 #include <stddef.h>
 #include <stdarg.h>

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX3-0007fd-7e; Tue, 11 Dec 2012 04:33:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0007aD-CW
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Received: from [193.109.254.147:53207] by server-12.bemta-14.messagelabs.com
	id 7F/9E-00510-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1355200399!9526765!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7199 invoked from network); 11 Dec 2012 04:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWx-0003IK-5G
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWx-0007BP-3w
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:19 +0000
Message-Id: <E1TiHWx-0007BP-3w@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: fix rflags status in
	virtual vmexit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354812866 0
# Node ID 312f0713dfc98635fd9ed4b42481581489faa28f
# Parent  bfd8e96fa3f157630f9698401a1f040ca1776c8e
nested vmx: fix rflags status in virtual vmexit

As stated in SDM, all bits (except for those 1-reserved) in rflags
would be set to 0 in VM exit. Therefore we need to follow this logic
in virtual_vmexit.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r bfd8e96fa3f1 -r 312f0713dfc9 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:53:57 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:54:26 2012 +0000
@@ -991,7 +991,8 @@ static void virtual_vmexit(struct cpu_us
 
     regs->eip = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RIP);
     regs->esp = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RSP);
-    regs->eflags = __vmread(GUEST_RFLAGS);
+    /* VM exit clears all bits except bit 1 */
+    regs->eflags = 0x2;
 
     /* updating host cr0 to sync TS bit */
     __vmwrite(HOST_CR0, v->arch.hvm_vmx.host_cr0);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX4-0007iG-GK; Tue, 11 Dec 2012 04:33:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0007eJ-Pj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Received: from [193.109.254.147:16822] by server-5.bemta-14.messagelabs.com id
	8E/6D-10257-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1355200399!1806420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10281 invoked from network); 11 Dec 2012 04:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWx-0003IN-Mb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWx-0007Be-LF
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:19 +0000
Message-Id: <E1TiHWx-0007Be-LF@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: fix handling of RDTSC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354812981 0
# Node ID a09150b57ace2fa786dcaefa958f0b197b1b6d4c
# Parent  312f0713dfc98635fd9ed4b42481581489faa28f
nested vmx: fix handling of RDTSC

If L0 is to handle the TSC access, then we need to update guest EIP by
calling update_guest_eip().

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 312f0713dfc9 -r a09150b57ace xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Dec 06 16:54:26 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Thu Dec 06 16:56:21 2012 +0000
@@ -1555,7 +1555,7 @@ static int get_instruction_length(void)
     return len;
 }
 
-static void update_guest_eip(void)
+void update_guest_eip(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     unsigned long x;
diff -r 312f0713dfc9 -r a09150b57ace xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:54:26 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:56:21 2012 +0000
@@ -1614,6 +1614,7 @@ int nvmx_n2_vmexit_handler(struct cpu_us
             tsc += __get_vvmcs(nvcpu->nv_vvmcx, TSC_OFFSET);
             regs->eax = (uint32_t)tsc;
             regs->edx = (uint32_t)(tsc >> 32);
+            update_guest_eip();
 
             return 1;
         }
diff -r 312f0713dfc9 -r a09150b57ace xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Thu Dec 06 16:54:26 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Thu Dec 06 16:56:21 2012 +0000
@@ -399,6 +399,8 @@ void ept_p2m_init(struct p2m_domain *p2m
 void ept_walk_table(struct domain *d, unsigned long gfn);
 void setup_ept_dump(void);
 
+void update_guest_eip(void);
+
 /* EPT violation qualifications definitions */
 #define _EPT_READ_VIOLATION         0
 #define EPT_READ_VIOLATION          (1UL<<_EPT_READ_VIOLATION)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX4-0007iG-GK; Tue, 11 Dec 2012 04:33:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0007eJ-Pj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Received: from [193.109.254.147:16822] by server-5.bemta-14.messagelabs.com id
	8E/6D-10257-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1355200399!1806420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10281 invoked from network); 11 Dec 2012 04:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWx-0003IN-Mb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWx-0007Be-LF
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:19 +0000
Message-Id: <E1TiHWx-0007Be-LF@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: fix handling of RDTSC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354812981 0
# Node ID a09150b57ace2fa786dcaefa958f0b197b1b6d4c
# Parent  312f0713dfc98635fd9ed4b42481581489faa28f
nested vmx: fix handling of RDTSC

If L0 is to handle the TSC access, then we need to update guest EIP by
calling update_guest_eip().

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 312f0713dfc9 -r a09150b57ace xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Dec 06 16:54:26 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Thu Dec 06 16:56:21 2012 +0000
@@ -1555,7 +1555,7 @@ static int get_instruction_length(void)
     return len;
 }
 
-static void update_guest_eip(void)
+void update_guest_eip(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     unsigned long x;
diff -r 312f0713dfc9 -r a09150b57ace xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:54:26 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:56:21 2012 +0000
@@ -1614,6 +1614,7 @@ int nvmx_n2_vmexit_handler(struct cpu_us
             tsc += __get_vvmcs(nvcpu->nv_vvmcx, TSC_OFFSET);
             regs->eax = (uint32_t)tsc;
             regs->edx = (uint32_t)(tsc >> 32);
+            update_guest_eip();
 
             return 1;
         }
diff -r 312f0713dfc9 -r a09150b57ace xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Thu Dec 06 16:54:26 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Thu Dec 06 16:56:21 2012 +0000
@@ -399,6 +399,8 @@ void ept_p2m_init(struct p2m_domain *p2m
 void ept_walk_table(struct domain *d, unsigned long gfn);
 void setup_ept_dump(void);
 
+void update_guest_eip(void);
+
 /* EPT violation qualifications definitions */
 #define _EPT_READ_VIOLATION         0
 #define EPT_READ_VIOLATION          (1UL<<_EPT_READ_VIOLATION)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX4-0007iU-KE; Tue, 11 Dec 2012 04:33:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007bz-BB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from [85.158.139.211:64871] by server-4.bemta-5.messagelabs.com id
	CF/D8-14693-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1355200403!19469459!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25826 invoked from network); 11 Dec 2012 04:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0003Ii-98
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0007DL-7g
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Message-Id: <E1TiHX1-0007DL-7g@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: properly fail mmuext ops when
	get_page_from_gfn() fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354884046 -3600
# Node ID e80bac7c6598d4b4e1d3c89589ba71b498c7dcc8
# Parent  12d2786dc549b4944d58d1e347ac423842d1259d
x86: properly fail mmuext ops when get_page_from_gfn() fails

I noticed this inconsistency while analyzing the code for XSA-32.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 12d2786dc549 -r e80bac7c6598 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Dec 06 16:59:27 2012 +0000
+++ b/xen/arch/x86/mm.c	Fri Dec 07 13:40:46 2012 +0100
@@ -2776,7 +2776,7 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
-                rc = -EINVAL;
+                okay = 0;
                 break;
             }
 
@@ -2836,6 +2836,7 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
+                okay = 0;
                 MEM_LOG("Mfn %lx bad domain", op.arg1.mfn);
                 break;
             }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX4-0007iU-KE; Tue, 11 Dec 2012 04:33:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007bz-BB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from [85.158.139.211:64871] by server-4.bemta-5.messagelabs.com id
	CF/D8-14693-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1355200403!19469459!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25826 invoked from network); 11 Dec 2012 04:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0003Ii-98
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0007DL-7g
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Message-Id: <E1TiHX1-0007DL-7g@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: properly fail mmuext ops when
	get_page_from_gfn() fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354884046 -3600
# Node ID e80bac7c6598d4b4e1d3c89589ba71b498c7dcc8
# Parent  12d2786dc549b4944d58d1e347ac423842d1259d
x86: properly fail mmuext ops when get_page_from_gfn() fails

I noticed this inconsistency while analyzing the code for XSA-32.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 12d2786dc549 -r e80bac7c6598 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Dec 06 16:59:27 2012 +0000
+++ b/xen/arch/x86/mm.c	Fri Dec 07 13:40:46 2012 +0100
@@ -2776,7 +2776,7 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
-                rc = -EINVAL;
+                okay = 0;
                 break;
             }
 
@@ -2836,6 +2836,7 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
+                okay = 0;
                 MEM_LOG("Mfn %lx bad domain", op.arg1.mfn);
                 break;
             }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX4-0007jC-Sw; Tue, 11 Dec 2012 04:33:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007f3-FF
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from [193.109.254.147:53275] by server-10.bemta-14.messagelabs.com
	id 83/6E-31741-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1355200401!10132138!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5669 invoked from network); 11 Dec 2012 04:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0003IW-7L
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0007CN-5p
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Message-Id: <E1TiHWz-0007CN-5p@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable "Virtualize APIC
	accesses" feature for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813075 0
# Node ID 86e20404a6406232041d206e42ebc73651b97ff9
# Parent  1ed1507fa0407f1da715d04fe1b510e81ca4fb31
nested vmx: enable "Virtualize APIC accesses" feature for L1 VMM

If the "Virtualize APIC accesses" feature is enabled, we need to sync
the APIC-access address from virtual vvmcs into shadow vmcs when doing
virtual_vmentry.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 1ed1507fa040 -r 86e20404a640 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:57:26 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:57:55 2012 +0000
@@ -554,6 +554,24 @@ void nvmx_update_exception_bitmap(struct
     set_shadow_control(v, EXCEPTION_BITMAP, value);
 }
 
+static void nvmx_update_apic_access_address(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    u64 apic_gpfn, apic_mfn;
+    u32 ctrl;
+    void *apic_va;
+
+    ctrl = __n2_secondary_exec_control(v);
+    if ( ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES )
+    {
+        apic_gpfn = __get_vvmcs(nvcpu->nv_vvmcx, APIC_ACCESS_ADDR) >> PAGE_SHIFT;
+        apic_va = hvm_map_guest_frame_ro(apic_gpfn);
+        apic_mfn = virt_to_mfn(apic_va);
+        __vmwrite(APIC_ACCESS_ADDR, (apic_mfn << PAGE_SHIFT));
+        hvm_unmap_guest_frame(apic_va); 
+    }
+}
+
 static void __clear_current_vvmcs(struct vcpu *v)
 {
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
@@ -761,6 +779,7 @@ static void load_shadow_control(struct v
     nvmx_update_exit_control(v, vmx_vmexit_control);
     nvmx_update_entry_control(v);
     vmx_update_exception_bitmap(v);
+    nvmx_update_apic_access_address(v);
 }
 
 static void load_shadow_guest_state(struct vcpu *v)
@@ -1350,7 +1369,8 @@ int nvmx_msr_read_intercept(unsigned int
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS2:
         /* 1-seetings */
-        data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING;
+        data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING |
+               SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
         /* 0-settings */
         tmp = 0;
         data = (data << 32) | tmp;
@@ -1680,6 +1700,11 @@ int nvmx_n2_vmexit_handler(struct cpu_us
 
         break;
     }
+    case EXIT_REASON_APIC_ACCESS:
+        ctrl = __n2_secondary_exec_control(v);
+        if ( ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     default:
         gdprintk(XENLOG_WARNING, "Unknown nested vmexit reason %x.\n",
                  exit_reason);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX4-0007ij-N6; Tue, 11 Dec 2012 04:33:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007es-CC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from [85.158.143.99:12714] by server-2.bemta-4.messagelabs.com id
	B9/E0-30861-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1355200402!28889551!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7573 invoked from network); 11 Dec 2012 04:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0003If-OT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0007D6-N4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Message-Id: <E1TiHX0-0007D6-N4@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: check host ability when
	intercept MSR read
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813167 0
# Node ID 12d2786dc549b4944d58d1e347ac423842d1259d
# Parent  90831c29bfde6aac013b7e5ec98934a4953c31c9
nested vmx: check host ability when intercept MSR read

When guest hypervisor tries to read MSR value, we intercept this
behavior and return certain emulated values. Besides that, we also
need to ensure that those emulated values must compatible with host
ability.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 90831c29bfde -r 12d2786dc549 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:58:59 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:59:27 2012 +0000
@@ -1314,24 +1314,32 @@ int nvmx_handle_vmwrite(struct cpu_user_
     return X86EMUL_OKAY;
 }
 
+#define __emul_value(enable1, default1) \
+    ((enable1 | default1) << 32 | (default1))
+
+#define gen_vmx_msr(enable1, default1, host_value) \
+    (((__emul_value(enable1, default1) & host_value) & (~0ul << 32)) | \
+    ((uint32_t)(__emul_value(enable1, default1) | host_value)))
+
 /*
  * Capability reporting
  */
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
-    u64 data = 0, tmp = 0;
+    u64 data = 0, host_data = 0;
     int r = 1;
 
     if ( !nestedhvm_enabled(current->domain) )
         return 0;
 
+    rdmsrl(msr, host_data);
+
     /*
      * Remove unsupport features from n1 guest capability MSR
      */
     switch (msr) {
     case MSR_IA32_VMX_BASIC:
-        data = VVMCS_REVISION | ((u64)PAGE_SIZE) << 32 | 
-               ((u64)MTRR_TYPE_WRBACK) << 50 | VMX_BASIC_DEFAULT1_ZERO;
+        data = (host_data & (~0ul << 32)) | VVMCS_REVISION;
         break;
     case MSR_IA32_VMX_PINBASED_CTLS:
     case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
@@ -1339,8 +1347,7 @@ int nvmx_msr_read_intercept(unsigned int
         data = PIN_BASED_EXT_INTR_MASK |
                PIN_BASED_NMI_EXITING |
                PIN_BASED_PREEMPT_TIMER;
-        tmp = VMX_PINBASED_CTLS_DEFAULT1;
-        data = ((data | tmp) << 32) | (tmp);
+        data = gen_vmx_msr(data, VMX_PINBASED_CTLS_DEFAULT1, host_data);
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS:
     case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
@@ -1365,22 +1372,17 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_PAUSE_EXITING |
                CPU_BASED_RDPMC_EXITING |
                CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
-        tmp = VMX_PROCBASED_CTLS_DEFAULT1;
-        /* 0-settings */
-        data = ((data | tmp) << 32) | (tmp);
+        data = gen_vmx_msr(data, VMX_PROCBASED_CTLS_DEFAULT1, host_data);
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS2:
         /* 1-seetings */
         data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING |
                SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
-        /* 0-settings */
-        tmp = 0;
-        data = (data << 32) | tmp;
+        data = gen_vmx_msr(data, 0, host_data);
         break;
     case MSR_IA32_VMX_EXIT_CTLS:
     case MSR_IA32_VMX_TRUE_EXIT_CTLS:
         /* 1-seetings */
-        tmp = VMX_EXIT_CTLS_DEFAULT1;
         data = VM_EXIT_ACK_INTR_ON_EXIT |
                VM_EXIT_IA32E_MODE |
                VM_EXIT_SAVE_PREEMPT_TIMER |
@@ -1389,18 +1391,16 @@ int nvmx_msr_read_intercept(unsigned int
                VM_EXIT_SAVE_GUEST_EFER |
                VM_EXIT_LOAD_HOST_EFER |
                VM_EXIT_LOAD_PERF_GLOBAL_CTRL;
-	/* 0-settings */
-        data = ((data | tmp) << 32) | tmp;
+        data = gen_vmx_msr(data, VMX_EXIT_CTLS_DEFAULT1, host_data);
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
     case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
         /* 1-seetings */
-        tmp = VMX_ENTRY_CTLS_DEFAULT1;
         data = VM_ENTRY_LOAD_GUEST_PAT |
                VM_ENTRY_LOAD_GUEST_EFER |
                VM_ENTRY_LOAD_PERF_GLOBAL_CTRL |
                VM_ENTRY_IA32E_MODE;
-        data = ((data | tmp) << 32) | tmp;
+        data = gen_vmx_msr(data, VMX_ENTRY_CTLS_DEFAULT1, host_data);
         break;
 
     case IA32_FEATURE_CONTROL_MSR:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX4-0007jC-Sw; Tue, 11 Dec 2012 04:33:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007f3-FF
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from [193.109.254.147:53275] by server-10.bemta-14.messagelabs.com
	id 83/6E-31741-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1355200401!10132138!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5669 invoked from network); 11 Dec 2012 04:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0003IW-7L
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0007CN-5p
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Message-Id: <E1TiHWz-0007CN-5p@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable "Virtualize APIC
	accesses" feature for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813075 0
# Node ID 86e20404a6406232041d206e42ebc73651b97ff9
# Parent  1ed1507fa0407f1da715d04fe1b510e81ca4fb31
nested vmx: enable "Virtualize APIC accesses" feature for L1 VMM

If the "Virtualize APIC accesses" feature is enabled, we need to sync
the APIC-access address from virtual vvmcs into shadow vmcs when doing
virtual_vmentry.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 1ed1507fa040 -r 86e20404a640 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:57:26 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:57:55 2012 +0000
@@ -554,6 +554,24 @@ void nvmx_update_exception_bitmap(struct
     set_shadow_control(v, EXCEPTION_BITMAP, value);
 }
 
+static void nvmx_update_apic_access_address(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    u64 apic_gpfn, apic_mfn;
+    u32 ctrl;
+    void *apic_va;
+
+    ctrl = __n2_secondary_exec_control(v);
+    if ( ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES )
+    {
+        apic_gpfn = __get_vvmcs(nvcpu->nv_vvmcx, APIC_ACCESS_ADDR) >> PAGE_SHIFT;
+        apic_va = hvm_map_guest_frame_ro(apic_gpfn);
+        apic_mfn = virt_to_mfn(apic_va);
+        __vmwrite(APIC_ACCESS_ADDR, (apic_mfn << PAGE_SHIFT));
+        hvm_unmap_guest_frame(apic_va); 
+    }
+}
+
 static void __clear_current_vvmcs(struct vcpu *v)
 {
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
@@ -761,6 +779,7 @@ static void load_shadow_control(struct v
     nvmx_update_exit_control(v, vmx_vmexit_control);
     nvmx_update_entry_control(v);
     vmx_update_exception_bitmap(v);
+    nvmx_update_apic_access_address(v);
 }
 
 static void load_shadow_guest_state(struct vcpu *v)
@@ -1350,7 +1369,8 @@ int nvmx_msr_read_intercept(unsigned int
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS2:
         /* 1-seetings */
-        data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING;
+        data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING |
+               SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
         /* 0-settings */
         tmp = 0;
         data = (data << 32) | tmp;
@@ -1680,6 +1700,11 @@ int nvmx_n2_vmexit_handler(struct cpu_us
 
         break;
     }
+    case EXIT_REASON_APIC_ACCESS:
+        ctrl = __n2_secondary_exec_control(v);
+        if ( ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     default:
         gdprintk(XENLOG_WARNING, "Unknown nested vmexit reason %x.\n",
                  exit_reason);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX4-0007ij-N6; Tue, 11 Dec 2012 04:33:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007es-CC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from [85.158.143.99:12714] by server-2.bemta-4.messagelabs.com id
	B9/E0-30861-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1355200402!28889551!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7573 invoked from network); 11 Dec 2012 04:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0003If-OT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0007D6-N4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Message-Id: <E1TiHX0-0007D6-N4@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: check host ability when
	intercept MSR read
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813167 0
# Node ID 12d2786dc549b4944d58d1e347ac423842d1259d
# Parent  90831c29bfde6aac013b7e5ec98934a4953c31c9
nested vmx: check host ability when intercept MSR read

When guest hypervisor tries to read MSR value, we intercept this
behavior and return certain emulated values. Besides that, we also
need to ensure that those emulated values must compatible with host
ability.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 90831c29bfde -r 12d2786dc549 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:58:59 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:59:27 2012 +0000
@@ -1314,24 +1314,32 @@ int nvmx_handle_vmwrite(struct cpu_user_
     return X86EMUL_OKAY;
 }
 
+#define __emul_value(enable1, default1) \
+    ((enable1 | default1) << 32 | (default1))
+
+#define gen_vmx_msr(enable1, default1, host_value) \
+    (((__emul_value(enable1, default1) & host_value) & (~0ul << 32)) | \
+    ((uint32_t)(__emul_value(enable1, default1) | host_value)))
+
 /*
  * Capability reporting
  */
 int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
 {
-    u64 data = 0, tmp = 0;
+    u64 data = 0, host_data = 0;
     int r = 1;
 
     if ( !nestedhvm_enabled(current->domain) )
         return 0;
 
+    rdmsrl(msr, host_data);
+
     /*
      * Remove unsupport features from n1 guest capability MSR
      */
     switch (msr) {
     case MSR_IA32_VMX_BASIC:
-        data = VVMCS_REVISION | ((u64)PAGE_SIZE) << 32 | 
-               ((u64)MTRR_TYPE_WRBACK) << 50 | VMX_BASIC_DEFAULT1_ZERO;
+        data = (host_data & (~0ul << 32)) | VVMCS_REVISION;
         break;
     case MSR_IA32_VMX_PINBASED_CTLS:
     case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
@@ -1339,8 +1347,7 @@ int nvmx_msr_read_intercept(unsigned int
         data = PIN_BASED_EXT_INTR_MASK |
                PIN_BASED_NMI_EXITING |
                PIN_BASED_PREEMPT_TIMER;
-        tmp = VMX_PINBASED_CTLS_DEFAULT1;
-        data = ((data | tmp) << 32) | (tmp);
+        data = gen_vmx_msr(data, VMX_PINBASED_CTLS_DEFAULT1, host_data);
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS:
     case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
@@ -1365,22 +1372,17 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_PAUSE_EXITING |
                CPU_BASED_RDPMC_EXITING |
                CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
-        tmp = VMX_PROCBASED_CTLS_DEFAULT1;
-        /* 0-settings */
-        data = ((data | tmp) << 32) | (tmp);
+        data = gen_vmx_msr(data, VMX_PROCBASED_CTLS_DEFAULT1, host_data);
         break;
     case MSR_IA32_VMX_PROCBASED_CTLS2:
         /* 1-seetings */
         data = SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING |
                SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
-        /* 0-settings */
-        tmp = 0;
-        data = (data << 32) | tmp;
+        data = gen_vmx_msr(data, 0, host_data);
         break;
     case MSR_IA32_VMX_EXIT_CTLS:
     case MSR_IA32_VMX_TRUE_EXIT_CTLS:
         /* 1-seetings */
-        tmp = VMX_EXIT_CTLS_DEFAULT1;
         data = VM_EXIT_ACK_INTR_ON_EXIT |
                VM_EXIT_IA32E_MODE |
                VM_EXIT_SAVE_PREEMPT_TIMER |
@@ -1389,18 +1391,16 @@ int nvmx_msr_read_intercept(unsigned int
                VM_EXIT_SAVE_GUEST_EFER |
                VM_EXIT_LOAD_HOST_EFER |
                VM_EXIT_LOAD_PERF_GLOBAL_CTRL;
-	/* 0-settings */
-        data = ((data | tmp) << 32) | tmp;
+        data = gen_vmx_msr(data, VMX_EXIT_CTLS_DEFAULT1, host_data);
         break;
     case MSR_IA32_VMX_ENTRY_CTLS:
     case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
         /* 1-seetings */
-        tmp = VMX_ENTRY_CTLS_DEFAULT1;
         data = VM_ENTRY_LOAD_GUEST_PAT |
                VM_ENTRY_LOAD_GUEST_EFER |
                VM_ENTRY_LOAD_PERF_GLOBAL_CTRL |
                VM_ENTRY_IA32E_MODE;
-        data = ((data | tmp) << 32) | tmp;
+        data = gen_vmx_msr(data, VMX_ENTRY_CTLS_DEFAULT1, host_data);
         break;
 
     case IA32_FEATURE_CONTROL_MSR:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX4-0007is-Pb; Tue, 11 Dec 2012 04:33:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007fD-FV
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from [193.109.254.147:10309] by server-7.bemta-14.messagelabs.com id
	8A/5D-02272-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1355200401!10132139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5670 invoked from network); 11 Dec 2012 04:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0003IZ-Ny
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0007Cc-Md
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Message-Id: <E1TiHWz-0007Cc-Md@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable PAUSE and RDPMC
	exiting for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813103 0
# Node ID 25dd352265ca23750f1a1a983124b36f518c4384
# Parent  86e20404a6406232041d206e42ebc73651b97ff9
nested vmx: enable PAUSE and RDPMC exiting for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 86e20404a640 -r 25dd352265ca xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:57:55 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:58:23 2012 +0000
@@ -1362,6 +1362,8 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_MONITOR_TRAP_FLAG |
                CPU_BASED_VIRTUAL_NMI_PENDING |
                CPU_BASED_ACTIVATE_MSR_BITMAP |
+               CPU_BASED_PAUSE_EXITING |
+               CPU_BASED_RDPMC_EXITING |
                CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
         tmp = VMX_PROCBASED_CTLS_DEFAULT1;
         /* 0-settings */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX4-0007is-Pb; Tue, 11 Dec 2012 04:33:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007fD-FV
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from [193.109.254.147:10309] by server-7.bemta-14.messagelabs.com id
	8A/5D-02272-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-27.messagelabs.com!1355200401!10132139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5670 invoked from network); 11 Dec 2012 04:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0003IZ-Ny
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWz-0007Cc-Md
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:21 +0000
Message-Id: <E1TiHWz-0007Cc-Md@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable PAUSE and RDPMC
	exiting for L1 VMM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813103 0
# Node ID 25dd352265ca23750f1a1a983124b36f518c4384
# Parent  86e20404a6406232041d206e42ebc73651b97ff9
nested vmx: enable PAUSE and RDPMC exiting for L1 VMM

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 86e20404a640 -r 25dd352265ca xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:57:55 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:58:23 2012 +0000
@@ -1362,6 +1362,8 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_MONITOR_TRAP_FLAG |
                CPU_BASED_VIRTUAL_NMI_PENDING |
                CPU_BASED_ACTIVATE_MSR_BITMAP |
+               CPU_BASED_PAUSE_EXITING |
+               CPU_BASED_RDPMC_EXITING |
                CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
         tmp = VMX_PROCBASED_CTLS_DEFAULT1;
         /* 0-settings */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX6-0007la-0w; Tue, 11 Dec 2012 04:33:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX4-0007bQ-7J
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:26 +0000
Received: from [85.158.137.99:17905] by server-11.bemta-3.messagelabs.com id
	ED/5E-19361-597B6C05; Tue, 11 Dec 2012 04:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-217.messagelabs.com!1355200403!12550244!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14468 invoked from network); 11 Dec 2012 04:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0003Im-Pp
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0007Da-OT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Message-Id: <E1TiHX1-0007Da-OT@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/p2m: drop redundant macro
	definitions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354884197 -3600
# Node ID cb542e58da25211843eb79998ea8568ebe9c8056
# Parent  e80bac7c6598d4b4e1d3c89589ba71b498c7dcc8
x86/p2m: drop redundant macro definitions

Also, add log level indicator to P2M_ERROR(), and drop pointless
underscores from all related macros' parameter names.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r e80bac7c6598 -r cb542e58da25 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Fri Dec 07 13:40:46 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Fri Dec 07 13:43:17 2012 +0100
@@ -46,18 +46,6 @@ boolean_param("hap_1gb", opt_hap_1gb);
 bool_t __read_mostly opt_hap_2mb = 1;
 boolean_param("hap_2mb", opt_hap_2mb);
 
-/* Printouts */
-#define P2M_PRINTK(_f, _a...)                                \
-    debugtrace_printk("p2m: %s(): " _f, __func__, ##_a)
-#define P2M_ERROR(_f, _a...)                                 \
-    printk("pg error: %s(): " _f, __func__, ##_a)
-#if P2M_DEBUGGING
-#define P2M_DEBUG(_f, _a...)                                 \
-    debugtrace_printk("p2mdebug: %s(): " _f, __func__, ##_a)
-#else
-#define P2M_DEBUG(_f, _a...) do { (void)(_f); } while(0)
-#endif
-
 
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef mfn_to_page
diff -r e80bac7c6598 -r cb542e58da25 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Fri Dec 07 13:40:46 2012 +0100
+++ b/xen/include/asm-x86/p2m.h	Fri Dec 07 13:43:17 2012 +0100
@@ -607,15 +607,15 @@ extern void audit_p2m(struct domain *d,
 #endif /* P2M_AUDIT */
 
 /* Printouts */
-#define P2M_PRINTK(_f, _a...)                                \
-    debugtrace_printk("p2m: %s(): " _f, __func__, ##_a)
-#define P2M_ERROR(_f, _a...)                                 \
-    printk("pg error: %s(): " _f, __func__, ##_a)
+#define P2M_PRINTK(f, a...)                                \
+    debugtrace_printk("p2m: %s(): " f, __func__, ##a)
+#define P2M_ERROR(f, a...)                                 \
+    printk(XENLOG_G_ERR "pg error: %s(): " f, __func__, ##a)
 #if P2M_DEBUGGING
-#define P2M_DEBUG(_f, _a...)                                 \
-    debugtrace_printk("p2mdebug: %s(): " _f, __func__, ##_a)
+#define P2M_DEBUG(f, a...)                                 \
+    debugtrace_printk("p2mdebug: %s(): " f, __func__, ##a)
 #else
-#define P2M_DEBUG(_f, _a...) do { (void)(_f); } while(0)
+#define P2M_DEBUG(f, a...) do { (void)(f); } while(0)
 #endif
 
 /* Called by p2m code when demand-populating a PoD page */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX6-0007la-0w; Tue, 11 Dec 2012 04:33:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX4-0007bQ-7J
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:26 +0000
Received: from [85.158.137.99:17905] by server-11.bemta-3.messagelabs.com id
	ED/5E-19361-597B6C05; Tue, 11 Dec 2012 04:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-217.messagelabs.com!1355200403!12550244!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14468 invoked from network); 11 Dec 2012 04:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0003Im-Pp
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX1-0007Da-OT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:23 +0000
Message-Id: <E1TiHX1-0007Da-OT@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/p2m: drop redundant macro
	definitions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354884197 -3600
# Node ID cb542e58da25211843eb79998ea8568ebe9c8056
# Parent  e80bac7c6598d4b4e1d3c89589ba71b498c7dcc8
x86/p2m: drop redundant macro definitions

Also, add log level indicator to P2M_ERROR(), and drop pointless
underscores from all related macros' parameter names.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r e80bac7c6598 -r cb542e58da25 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Fri Dec 07 13:40:46 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c	Fri Dec 07 13:43:17 2012 +0100
@@ -46,18 +46,6 @@ boolean_param("hap_1gb", opt_hap_1gb);
 bool_t __read_mostly opt_hap_2mb = 1;
 boolean_param("hap_2mb", opt_hap_2mb);
 
-/* Printouts */
-#define P2M_PRINTK(_f, _a...)                                \
-    debugtrace_printk("p2m: %s(): " _f, __func__, ##_a)
-#define P2M_ERROR(_f, _a...)                                 \
-    printk("pg error: %s(): " _f, __func__, ##_a)
-#if P2M_DEBUGGING
-#define P2M_DEBUG(_f, _a...)                                 \
-    debugtrace_printk("p2mdebug: %s(): " _f, __func__, ##_a)
-#else
-#define P2M_DEBUG(_f, _a...) do { (void)(_f); } while(0)
-#endif
-
 
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef mfn_to_page
diff -r e80bac7c6598 -r cb542e58da25 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Fri Dec 07 13:40:46 2012 +0100
+++ b/xen/include/asm-x86/p2m.h	Fri Dec 07 13:43:17 2012 +0100
@@ -607,15 +607,15 @@ extern void audit_p2m(struct domain *d,
 #endif /* P2M_AUDIT */
 
 /* Printouts */
-#define P2M_PRINTK(_f, _a...)                                \
-    debugtrace_printk("p2m: %s(): " _f, __func__, ##_a)
-#define P2M_ERROR(_f, _a...)                                 \
-    printk("pg error: %s(): " _f, __func__, ##_a)
+#define P2M_PRINTK(f, a...)                                \
+    debugtrace_printk("p2m: %s(): " f, __func__, ##a)
+#define P2M_ERROR(f, a...)                                 \
+    printk(XENLOG_G_ERR "pg error: %s(): " f, __func__, ##a)
 #if P2M_DEBUGGING
-#define P2M_DEBUG(_f, _a...)                                 \
-    debugtrace_printk("p2mdebug: %s(): " _f, __func__, ##_a)
+#define P2M_DEBUG(f, a...)                                 \
+    debugtrace_printk("p2mdebug: %s(): " f, __func__, ##a)
 #else
-#define P2M_DEBUG(_f, _a...) do { (void)(_f); } while(0)
+#define P2M_DEBUG(f, a...) do { (void)(f); } while(0)
 #endif
 
 /* Called by p2m code when demand-populating a PoD page */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX7-0007mm-4B; Tue, 11 Dec 2012 04:33:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0007i1-0d
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from [85.158.139.211:64907] by server-1.bemta-5.messagelabs.com id
	E7/E1-12813-697B6C05; Tue, 11 Dec 2012 04:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355200404!18438118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18835 invoked from network); 11 Dec 2012 04:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0003Ip-AM
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0007Dp-91
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Message-Id: <E1TiHX2-0007Dp-91@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/EFI: add code interfacing with
	the secure boot shim
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354884272 -3600
# Node ID b62bd62b26836fafe19cf41fec194bcf33e2ead6
# Parent  cb542e58da25211843eb79998ea8568ebe9c8056
x86/EFI: add code interfacing with the secure boot shim

... to validate the kernel image (which is required to be in PE
format, as is e.g. the case for the Linux bzImage when built with
CONFIG_EFI_STUB).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r cb542e58da25 -r b62bd62b2683 xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c	Fri Dec 07 13:43:17 2012 +0100
+++ b/xen/arch/x86/efi/boot.c	Fri Dec 07 13:44:32 2012 +0100
@@ -24,6 +24,18 @@
 #include <asm/msr.h>
 #include <asm/processor.h>
 
+#define SHIM_LOCK_PROTOCOL_GUID \
+  { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
+
+typedef EFI_STATUS
+(/* _not_ EFIAPI */ *EFI_SHIM_LOCK_VERIFY) (
+    IN VOID *Buffer,
+    IN UINT32 Size);
+
+typedef struct {
+    EFI_SHIM_LOCK_VERIFY Verify;
+} EFI_SHIM_LOCK_PROTOCOL;
+
 extern char start[];
 extern u32 cpuid_ext_features;
 
@@ -640,12 +652,14 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
     static EFI_GUID __initdata gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
     static EFI_GUID __initdata bio_guid = BLOCK_IO_PROTOCOL;
     static EFI_GUID __initdata devp_guid = DEVICE_PATH_PROTOCOL;
+    static EFI_GUID __initdata shim_lock_guid = SHIM_LOCK_PROTOCOL_GUID;
     EFI_LOADED_IMAGE *loaded_image;
     EFI_STATUS status;
     unsigned int i, argc;
     CHAR16 **argv, *file_name, *cfg_file_name = NULL;
     UINTN cols, rows, depth, size, map_key, info_size, gop_mode = ~0;
     EFI_HANDLE *handles = NULL;
+    EFI_SHIM_LOCK_PROTOCOL *shim_lock;
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
     EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
     EFI_FILE_HANDLE dir_handle;
@@ -835,6 +849,11 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
     read_file(dir_handle, s2w(&name), &kernel);
     efi_bs->FreePool(name.w);
 
+    if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
+                    (void **)&shim_lock)) &&
+         shim_lock->Verify(kernel.ptr, kernel.size) != EFI_SUCCESS )
+        blexit(L"Dom0 kernel image could not be verified\r\n");
+
     name.s = get_value(&cfg, section.s, "ramdisk");
     if ( name.s )
     {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX7-0007mm-4B; Tue, 11 Dec 2012 04:33:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0007i1-0d
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from [85.158.139.211:64907] by server-1.bemta-5.messagelabs.com id
	E7/E1-12813-697B6C05; Tue, 11 Dec 2012 04:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355200404!18438118!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18835 invoked from network); 11 Dec 2012 04:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0003Ip-AM
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0007Dp-91
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Message-Id: <E1TiHX2-0007Dp-91@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/EFI: add code interfacing with
	the secure boot shim
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354884272 -3600
# Node ID b62bd62b26836fafe19cf41fec194bcf33e2ead6
# Parent  cb542e58da25211843eb79998ea8568ebe9c8056
x86/EFI: add code interfacing with the secure boot shim

... to validate the kernel image (which is required to be in PE
format, as is e.g. the case for the Linux bzImage when built with
CONFIG_EFI_STUB).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r cb542e58da25 -r b62bd62b2683 xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c	Fri Dec 07 13:43:17 2012 +0100
+++ b/xen/arch/x86/efi/boot.c	Fri Dec 07 13:44:32 2012 +0100
@@ -24,6 +24,18 @@
 #include <asm/msr.h>
 #include <asm/processor.h>
 
+#define SHIM_LOCK_PROTOCOL_GUID \
+  { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
+
+typedef EFI_STATUS
+(/* _not_ EFIAPI */ *EFI_SHIM_LOCK_VERIFY) (
+    IN VOID *Buffer,
+    IN UINT32 Size);
+
+typedef struct {
+    EFI_SHIM_LOCK_VERIFY Verify;
+} EFI_SHIM_LOCK_PROTOCOL;
+
 extern char start[];
 extern u32 cpuid_ext_features;
 
@@ -640,12 +652,14 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
     static EFI_GUID __initdata gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
     static EFI_GUID __initdata bio_guid = BLOCK_IO_PROTOCOL;
     static EFI_GUID __initdata devp_guid = DEVICE_PATH_PROTOCOL;
+    static EFI_GUID __initdata shim_lock_guid = SHIM_LOCK_PROTOCOL_GUID;
     EFI_LOADED_IMAGE *loaded_image;
     EFI_STATUS status;
     unsigned int i, argc;
     CHAR16 **argv, *file_name, *cfg_file_name = NULL;
     UINTN cols, rows, depth, size, map_key, info_size, gop_mode = ~0;
     EFI_HANDLE *handles = NULL;
+    EFI_SHIM_LOCK_PROTOCOL *shim_lock;
     EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
     EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;
     EFI_FILE_HANDLE dir_handle;
@@ -835,6 +849,11 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
     read_file(dir_handle, s2w(&name), &kernel);
     efi_bs->FreePool(name.w);
 
+    if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
+                    (void **)&shim_lock)) &&
+         shim_lock->Verify(kernel.ptr, kernel.size) != EFI_SUCCESS )
+        blexit(L"Dom0 kernel image could not be verified\r\n");
+
     name.s = get_value(&cfg, section.s, "ramdisk");
     if ( name.s )
     {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX7-0007n4-8c; Tue, 11 Dec 2012 04:33:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0007es-C1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from [85.158.143.35:37699] by server-2.bemta-4.messagelabs.com id
	3C/E0-30861-697B6C05; Tue, 11 Dec 2012 04:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1355200396!5215937!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_23,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22969 invoked from network); 11 Dec 2012 04:33:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWq-0003Hk-Qb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWq-00078V-M4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:12 +0000
Message-Id: <E1TiHWq-00078V-M4@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] README: docs/pdf/user.pdf was
	deleted in 24563:4271634e4c86
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354789147 0
# Node ID 0c96325e2c8fbf279c0c30c8b630b1855c5945bb
# Parent  4b6d74b093bcf0bce39491223c1ca9d38c90c8a3
README: docs/pdf/user.pdf was deleted in 24563:4271634e4c86

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4b6d74b093bc -r 0c96325e2c8f README
--- a/README	Thu Dec 06 10:19:06 2012 +0000
+++ b/README	Thu Dec 06 10:19:07 2012 +0000
@@ -25,11 +25,8 @@ live relocation of VMs. Ports to Linux, 
 are available from the community.
 
 This file contains some quick-start instructions to install Xen on
-your system. For full documentation, see the Xen User Manual. If this
-is a pre-built release then you can find the manual at:
- dist/install/usr/share/doc/xen/pdf/user.pdf
-If you have a source release, then 'make -C docs' will build the
-manual at docs/pdf/user.pdf.
+your system. For more information see http:/www.xen.org/ and
+http://wiki.xen.org/
 
 Quick-Start Guide
 =================

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX7-0007n4-8c; Tue, 11 Dec 2012 04:33:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0007es-C1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from [85.158.143.35:37699] by server-2.bemta-4.messagelabs.com id
	3C/E0-30861-697B6C05; Tue, 11 Dec 2012 04:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1355200396!5215937!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_23,
	spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22969 invoked from network); 11 Dec 2012 04:33:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWq-0003Hk-Qb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWq-00078V-M4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:12 +0000
Message-Id: <E1TiHWq-00078V-M4@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] README: docs/pdf/user.pdf was
	deleted in 24563:4271634e4c86
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354789147 0
# Node ID 0c96325e2c8fbf279c0c30c8b630b1855c5945bb
# Parent  4b6d74b093bcf0bce39491223c1ca9d38c90c8a3
README: docs/pdf/user.pdf was deleted in 24563:4271634e4c86

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4b6d74b093bc -r 0c96325e2c8f README
--- a/README	Thu Dec 06 10:19:06 2012 +0000
+++ b/README	Thu Dec 06 10:19:07 2012 +0000
@@ -25,11 +25,8 @@ live relocation of VMs. Ports to Linux, 
 are available from the community.
 
 This file contains some quick-start instructions to install Xen on
-your system. For full documentation, see the Xen User Manual. If this
-is a pre-built release then you can find the manual at:
- dist/install/usr/share/doc/xen/pdf/user.pdf
-If you have a source release, then 'make -C docs' will build the
-manual at docs/pdf/user.pdf.
+your system. For more information see http:/www.xen.org/ and
+http://wiki.xen.org/
 
 Quick-Start Guide
 =================

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX7-0007nP-C8; Tue, 11 Dec 2012 04:33:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0007bz-IW
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from [85.158.139.211:64926] by server-4.bemta-5.messagelabs.com id
	37/E8-14693-797B6C05; Tue, 11 Dec 2012 04:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355200405!18438120!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18878 invoked from network); 11 Dec 2012 04:33:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0003Ix-F6
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007EJ-Dm
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Message-Id: <E1TiHX3-0007EJ-Dm@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: mark certain items static
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354884468 -3600
# Node ID b881901cca83f40935d77981341ff6f079c5b048
# Parent  18b25321cea6142391921dbad56765eb32cd4f90
x86: mark certain items static

..., and at once constify the data items among them.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Fri Dec 07 13:47:48 2012 +0100
@@ -4117,10 +4117,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
         struct domain *d;
         
         /* Interface types to internal p2m types */
-        p2m_type_t memtype[] = {
-            p2m_ram_rw,        /* HVMMEM_ram_rw  */
-            p2m_ram_ro,        /* HVMMEM_ram_ro  */
-            p2m_mmio_dm        /* HVMMEM_mmio_dm */
+        static const p2m_type_t memtype[] = {
+            [HVMMEM_ram_rw]  = p2m_ram_rw,
+            [HVMMEM_ram_ro]  = p2m_ram_ro,
+            [HVMMEM_mmio_dm] = p2m_mmio_dm
         };
 
         if ( copy_from_guest(&a, arg, 1) )
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/svm/emulate.c
--- a/xen/arch/x86/hvm/svm/emulate.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/svm/emulate.c	Fri Dec 07 13:47:48 2012 +0100
@@ -152,7 +152,7 @@ static int fetch(struct vcpu *v, u8 *buf
 }
 
 int __get_instruction_length_from_list(struct vcpu *v,
-        enum instruction_index *list, unsigned int list_count)
+        const enum instruction_index *list, unsigned int list_count)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     unsigned int i, j, inst_len = 0;
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Dec 07 13:47:48 2012 +0100
@@ -1931,7 +1931,7 @@ static void svm_wbinvd_intercept(void)
 
 static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
 {
-    enum instruction_index list[] = { INSTR_INVD, INSTR_WBINVD };
+    static const enum instruction_index list[] = { INSTR_INVD, INSTR_WBINVD };
     int inst_len;
 
     inst_len = __get_instruction_length_from_list(
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Dec 07 13:47:48 2012 +0100
@@ -2475,9 +2475,11 @@ void vmx_vmexit_handler(struct cpu_user_
         vmx_update_cpu_exec_control(v);
         break;
     case EXIT_REASON_TASK_SWITCH: {
-        const enum hvm_task_switch_reason reasons[] = {
-            TSW_call_or_int, TSW_iret, TSW_jmp, TSW_call_or_int };
+        static const enum hvm_task_switch_reason reasons[] = {
+            TSW_call_or_int, TSW_iret, TSW_jmp, TSW_call_or_int
+        };
         int32_t ecode = -1, source;
+
         exit_qualification = __vmread(EXIT_QUALIFICATION);
         source = (exit_qualification >> 30) & 3;
         /* Vectored event should fill in interrupt information. */
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/mm/guest_walk.c	Fri Dec 07 13:47:48 2012 +0100
@@ -34,7 +34,7 @@
 /* Flags that are needed in a pagetable entry, with the sense of NX inverted */
 static uint32_t mandatory_flags(struct vcpu *v, uint32_t pfec) 
 {
-    static uint32_t flags[] = {
+    static const uint32_t flags[] = {
         /* I/F -  Usr Wr */
         /* 0   0   0   0 */ _PAGE_PRESENT, 
         /* 0   0   0   1 */ _PAGE_PRESENT|_PAGE_RW,
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/smpboot.c	Fri Dec 07 13:47:48 2012 +0100
@@ -179,7 +179,7 @@ static void synchronize_tsc_slave(unsign
     }
 }
 
-void smp_callin(void)
+static void smp_callin(void)
 {
     unsigned int cpu = smp_processor_id();
     int i, rc;
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/time.c	Fri Dec 07 13:47:48 2012 +0100
@@ -1151,7 +1151,7 @@ static void local_time_calibration(void)
  * The Linux original version of this function is
  * Copyright (c) 2006, Red Hat, Inc., Ingo Molnar
  */
-void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
+static void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
 {
 #define rdtsc_barrier() mb()
     static DEFINE_SPINLOCK(sync_lock);
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/x86_64/traps.c	Fri Dec 07 13:47:48 2012 +0100
@@ -45,7 +45,7 @@ static void _show_registers(
     const struct cpu_user_regs *regs, unsigned long crs[8],
     enum context context, const struct vcpu *v)
 {
-    const static char *context_names[] = {
+    static const char *const context_names[] = {
         [CTXT_hypervisor] = "hypervisor",
         [CTXT_pv_guest]   = "pv guest",
         [CTXT_hvm_guest]  = "hvm guest"
diff -r 18b25321cea6 -r b881901cca83 xen/include/asm-x86/hvm/svm/emulate.h
--- a/xen/include/asm-x86/hvm/svm/emulate.h	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/emulate.h	Fri Dec 07 13:47:48 2012 +0100
@@ -45,7 +45,7 @@ enum instruction_index {
 struct vcpu;
 
 int __get_instruction_length_from_list(
-    struct vcpu *v, enum instruction_index *list, unsigned int list_count);
+    struct vcpu *, const enum instruction_index *, unsigned int list_count);
 
 static inline int __get_instruction_length(
     struct vcpu *v, enum instruction_index instr)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX7-0007nP-C8; Tue, 11 Dec 2012 04:33:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0007bz-IW
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from [85.158.139.211:64926] by server-4.bemta-5.messagelabs.com id
	37/E8-14693-797B6C05; Tue, 11 Dec 2012 04:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355200405!18438120!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18878 invoked from network); 11 Dec 2012 04:33:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0003Ix-F6
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007EJ-Dm
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Message-Id: <E1TiHX3-0007EJ-Dm@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: mark certain items static
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354884468 -3600
# Node ID b881901cca83f40935d77981341ff6f079c5b048
# Parent  18b25321cea6142391921dbad56765eb32cd4f90
x86: mark certain items static

..., and at once constify the data items among them.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Fri Dec 07 13:47:48 2012 +0100
@@ -4117,10 +4117,10 @@ long do_hvm_op(unsigned long op, XEN_GUE
         struct domain *d;
         
         /* Interface types to internal p2m types */
-        p2m_type_t memtype[] = {
-            p2m_ram_rw,        /* HVMMEM_ram_rw  */
-            p2m_ram_ro,        /* HVMMEM_ram_ro  */
-            p2m_mmio_dm        /* HVMMEM_mmio_dm */
+        static const p2m_type_t memtype[] = {
+            [HVMMEM_ram_rw]  = p2m_ram_rw,
+            [HVMMEM_ram_ro]  = p2m_ram_ro,
+            [HVMMEM_mmio_dm] = p2m_mmio_dm
         };
 
         if ( copy_from_guest(&a, arg, 1) )
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/svm/emulate.c
--- a/xen/arch/x86/hvm/svm/emulate.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/svm/emulate.c	Fri Dec 07 13:47:48 2012 +0100
@@ -152,7 +152,7 @@ static int fetch(struct vcpu *v, u8 *buf
 }
 
 int __get_instruction_length_from_list(struct vcpu *v,
-        enum instruction_index *list, unsigned int list_count)
+        const enum instruction_index *list, unsigned int list_count)
 {
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     unsigned int i, j, inst_len = 0;
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Dec 07 13:47:48 2012 +0100
@@ -1931,7 +1931,7 @@ static void svm_wbinvd_intercept(void)
 
 static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs)
 {
-    enum instruction_index list[] = { INSTR_INVD, INSTR_WBINVD };
+    static const enum instruction_index list[] = { INSTR_INVD, INSTR_WBINVD };
     int inst_len;
 
     inst_len = __get_instruction_length_from_list(
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Dec 07 13:47:48 2012 +0100
@@ -2475,9 +2475,11 @@ void vmx_vmexit_handler(struct cpu_user_
         vmx_update_cpu_exec_control(v);
         break;
     case EXIT_REASON_TASK_SWITCH: {
-        const enum hvm_task_switch_reason reasons[] = {
-            TSW_call_or_int, TSW_iret, TSW_jmp, TSW_call_or_int };
+        static const enum hvm_task_switch_reason reasons[] = {
+            TSW_call_or_int, TSW_iret, TSW_jmp, TSW_call_or_int
+        };
         int32_t ecode = -1, source;
+
         exit_qualification = __vmread(EXIT_QUALIFICATION);
         source = (exit_qualification >> 30) & 3;
         /* Vectored event should fill in interrupt information. */
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/mm/guest_walk.c	Fri Dec 07 13:47:48 2012 +0100
@@ -34,7 +34,7 @@
 /* Flags that are needed in a pagetable entry, with the sense of NX inverted */
 static uint32_t mandatory_flags(struct vcpu *v, uint32_t pfec) 
 {
-    static uint32_t flags[] = {
+    static const uint32_t flags[] = {
         /* I/F -  Usr Wr */
         /* 0   0   0   0 */ _PAGE_PRESENT, 
         /* 0   0   0   1 */ _PAGE_PRESENT|_PAGE_RW,
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/smpboot.c	Fri Dec 07 13:47:48 2012 +0100
@@ -179,7 +179,7 @@ static void synchronize_tsc_slave(unsign
     }
 }
 
-void smp_callin(void)
+static void smp_callin(void)
 {
     unsigned int cpu = smp_processor_id();
     int i, rc;
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/time.c	Fri Dec 07 13:47:48 2012 +0100
@@ -1151,7 +1151,7 @@ static void local_time_calibration(void)
  * The Linux original version of this function is
  * Copyright (c) 2006, Red Hat, Inc., Ingo Molnar
  */
-void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
+static void check_tsc_warp(unsigned long tsc_khz, unsigned long *max_warp)
 {
 #define rdtsc_barrier() mb()
     static DEFINE_SPINLOCK(sync_lock);
diff -r 18b25321cea6 -r b881901cca83 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/arch/x86/x86_64/traps.c	Fri Dec 07 13:47:48 2012 +0100
@@ -45,7 +45,7 @@ static void _show_registers(
     const struct cpu_user_regs *regs, unsigned long crs[8],
     enum context context, const struct vcpu *v)
 {
-    const static char *context_names[] = {
+    static const char *const context_names[] = {
         [CTXT_hypervisor] = "hypervisor",
         [CTXT_pv_guest]   = "pv guest",
         [CTXT_hvm_guest]  = "hvm guest"
diff -r 18b25321cea6 -r b881901cca83 xen/include/asm-x86/hvm/svm/emulate.h
--- a/xen/include/asm-x86/hvm/svm/emulate.h	Fri Dec 07 13:45:57 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/emulate.h	Fri Dec 07 13:47:48 2012 +0100
@@ -45,7 +45,7 @@ enum instruction_index {
 struct vcpu;
 
 int __get_instruction_length_from_list(
-    struct vcpu *v, enum instruction_index *list, unsigned int list_count);
+    struct vcpu *, const enum instruction_index *, unsigned int list_count);
 
 static inline int __get_instruction_length(
     struct vcpu *v, enum instruction_index instr)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX7-0007ne-Fz; Tue, 11 Dec 2012 04:33:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0007es-OY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from [85.158.143.99:12772] by server-2.bemta-4.messagelabs.com id
	0D/E0-30861-797B6C05; Tue, 11 Dec 2012 04:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1355200405!17707707!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21217 invoked from network); 11 Dec 2012 04:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0003Iu-SU
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0007E4-Pu
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Message-Id: <E1TiHX2-0007E4-Pu@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HVM: add missing assert to
	stdvga's mmio_move()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354884357 -3600
# Node ID 18b25321cea6142391921dbad56765eb32cd4f90
# Parent  b62bd62b26836fafe19cf41fec194bcf33e2ead6
x86/HVM: add missing assert to stdvga's mmio_move()

... to match the IOREQ_READ path.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r b62bd62b2683 -r 18b25321cea6 xen/arch/x86/hvm/stdvga.c
--- a/xen/arch/x86/hvm/stdvga.c	Fri Dec 07 13:44:32 2012 +0100
+++ b/xen/arch/x86/hvm/stdvga.c	Fri Dec 07 13:45:57 2012 +0100
@@ -519,6 +519,7 @@ static int mmio_move(struct hvm_hw_stdvg
                             put_page(dp);
                         return 0;
                     }
+                    ASSERT(!dp);
                     tmp = stdvga_mem_read(data, p->size);
                 }
                 stdvga_mem_write(addr, tmp, p->size);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX7-0007ne-Fz; Tue, 11 Dec 2012 04:33:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0007es-OY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from [85.158.143.99:12772] by server-2.bemta-4.messagelabs.com id
	0D/E0-30861-797B6C05; Tue, 11 Dec 2012 04:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1355200405!17707707!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21217 invoked from network); 11 Dec 2012 04:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0003Iu-SU
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX2-0007E4-Pu
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:24 +0000
Message-Id: <E1TiHX2-0007E4-Pu@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HVM: add missing assert to
	stdvga's mmio_move()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354884357 -3600
# Node ID 18b25321cea6142391921dbad56765eb32cd4f90
# Parent  b62bd62b26836fafe19cf41fec194bcf33e2ead6
x86/HVM: add missing assert to stdvga's mmio_move()

... to match the IOREQ_READ path.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r b62bd62b2683 -r 18b25321cea6 xen/arch/x86/hvm/stdvga.c
--- a/xen/arch/x86/hvm/stdvga.c	Fri Dec 07 13:44:32 2012 +0100
+++ b/xen/arch/x86/hvm/stdvga.c	Fri Dec 07 13:45:57 2012 +0100
@@ -519,6 +519,7 @@ static int mmio_move(struct hvm_hw_stdvg
                             put_page(dp);
                         return 0;
                     }
+                    ASSERT(!dp);
                     tmp = stdvga_mem_read(data, p->size);
                 }
                 stdvga_mem_write(addr, tmp, p->size);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX9-0007qH-0l; Tue, 11 Dec 2012 04:33:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX7-0007mK-03
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:29 +0000
Received: from [85.158.143.99:51573] by server-3.bemta-4.messagelabs.com id
	51/59-18211-897B6C05; Tue, 11 Dec 2012 04:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1355200406!21869588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18587 invoked from network); 11 Dec 2012 04:33:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX4-0003J6-GC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX4-0007En-Ek
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:26 +0000
Message-Id: <E1TiHX4-0007En-Ek@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] scheduler: fix rate limit range
	checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355134467 -3600
# Node ID 8d209624ea83b272e1ebd713a928c38d4782f4f1
# Parent  f96a0cda12160f497981a37f6922a1ed7db9a462
scheduler: fix rate limit range checking

For one, neither of the two checks permitted for the documented value
of zero (disabling the functionality altogether).

Second, the range checking of the command line parameter was done by
the credit scheduler's initialization code, despite it being a generic
scheduler option.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r f96a0cda1216 -r 8d209624ea83 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Fri Dec 07 16:19:11 2012 +0000
+++ b/xen/common/sched_credit.c	Mon Dec 10 11:14:27 2012 +0100
@@ -835,8 +835,9 @@ csched_sys_cntl(const struct scheduler *
     case XEN_SYSCTL_SCHEDOP_putinfo:
         if (params->tslice_ms > XEN_SYSCTL_CSCHED_TSLICE_MAX
             || params->tslice_ms < XEN_SYSCTL_CSCHED_TSLICE_MIN 
-            || params->ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
-            || params->ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN 
+            || (params->ratelimit_us
+                && (params->ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
+                    || params->ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN))
             || MICROSECS(params->ratelimit_us) > MILLISECS(params->tslice_ms) )
                 goto out;
         prv->tslice_ms = params->tslice_ms;
@@ -1593,17 +1594,6 @@ csched_init(struct scheduler *ops)
         sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
     }
 
-    if ( sched_ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
-         || sched_ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN )
-    {
-        printk("WARNING: sched_ratelimit_us outside of valid range [%d,%d].\n"
-               " Resetting to default %u\n",
-               XEN_SYSCTL_SCHED_RATELIMIT_MIN,
-               XEN_SYSCTL_SCHED_RATELIMIT_MAX,
-               SCHED_DEFAULT_RATELIMIT_US);
-        sched_ratelimit_us = SCHED_DEFAULT_RATELIMIT_US;
-    }
-
     prv->tslice_ms = sched_credit_tslice_ms;
     prv->ticks_per_tslice = CSCHED_TICKS_PER_TSLICE;
     if ( prv->tslice_ms < prv->ticks_per_tslice )
diff -r f96a0cda1216 -r 8d209624ea83 xen/common/schedule.c
--- a/xen/common/schedule.c	Fri Dec 07 16:19:11 2012 +0000
+++ b/xen/common/schedule.c	Mon Dec 10 11:14:27 2012 +0100
@@ -1324,6 +1324,18 @@ void __init scheduler_init(void)
     if ( SCHED_OP(&ops, init) )
         panic("scheduler returned error on init\n");
 
+    if ( sched_ratelimit_us &&
+         (sched_ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
+          || sched_ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN) )
+    {
+        printk("WARNING: sched_ratelimit_us outside of valid range [%d,%d].\n"
+               " Resetting to default %u\n",
+               XEN_SYSCTL_SCHED_RATELIMIT_MIN,
+               XEN_SYSCTL_SCHED_RATELIMIT_MAX,
+               SCHED_DEFAULT_RATELIMIT_US);
+        sched_ratelimit_us = SCHED_DEFAULT_RATELIMIT_US;
+    }
+
     idle_domain = domain_create(DOMID_IDLE, 0, 0);
     BUG_ON(IS_ERR(idle_domain));
     idle_domain->vcpu = idle_vcpu;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX8-0007pn-Pr; Tue, 11 Dec 2012 04:33:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX6-0007bQ-6H
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:28 +0000
Received: from [85.158.137.99:46247] by server-11.bemta-3.messagelabs.com id
	D5/6E-19361-797B6C05; Tue, 11 Dec 2012 04:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1355200406!17061269!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14190 invoked from network); 11 Dec 2012 04:33:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0003J1-VY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007EY-U3
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Message-Id: <E1TiHX3-0007EY-U3@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1354897151 0
# Node ID f96a0cda12160f497981a37f6922a1ed7db9a462
# Parent  b881901cca83f40935d77981341ff6f079c5b048
QEMU_TAG update
---


diff -r b881901cca83 -r f96a0cda1216 Config.mk
--- a/Config.mk	Fri Dec 07 13:47:48 2012 +0100
+++ b/Config.mk	Fri Dec 07 16:19:11 2012 +0000
@@ -218,7 +218,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.0-rc4
+QEMU_TAG ?= 6a0cf3786f1964fdf5a17f88f26cb499f4e89c81
+# Thu Dec 6 12:35:58 2012 +0000
+# qemu-stubdom: prevent useless medium change
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX8-0007pn-Pr; Tue, 11 Dec 2012 04:33:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX6-0007bQ-6H
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:28 +0000
Received: from [85.158.137.99:46247] by server-11.bemta-3.messagelabs.com id
	D5/6E-19361-797B6C05; Tue, 11 Dec 2012 04:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1355200406!17061269!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14190 invoked from network); 11 Dec 2012 04:33:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0003J1-VY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX3-0007EY-U3
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:25 +0000
Message-Id: <E1TiHX3-0007EY-U3@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1354897151 0
# Node ID f96a0cda12160f497981a37f6922a1ed7db9a462
# Parent  b881901cca83f40935d77981341ff6f079c5b048
QEMU_TAG update
---


diff -r b881901cca83 -r f96a0cda1216 Config.mk
--- a/Config.mk	Fri Dec 07 13:47:48 2012 +0100
+++ b/Config.mk	Fri Dec 07 16:19:11 2012 +0000
@@ -218,7 +218,9 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.0-rc4
+QEMU_TAG ?= 6a0cf3786f1964fdf5a17f88f26cb499f4e89c81
+# Thu Dec 6 12:35:58 2012 +0000
+# qemu-stubdom: prevent useless medium change
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX9-0007qH-0l; Tue, 11 Dec 2012 04:33:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX7-0007mK-03
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:29 +0000
Received: from [85.158.143.99:51573] by server-3.bemta-4.messagelabs.com id
	51/59-18211-897B6C05; Tue, 11 Dec 2012 04:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1355200406!21869588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18587 invoked from network); 11 Dec 2012 04:33:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX4-0003J6-GC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX4-0007En-Ek
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:26 +0000
Message-Id: <E1TiHX4-0007En-Ek@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] scheduler: fix rate limit range
	checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355134467 -3600
# Node ID 8d209624ea83b272e1ebd713a928c38d4782f4f1
# Parent  f96a0cda12160f497981a37f6922a1ed7db9a462
scheduler: fix rate limit range checking

For one, neither of the two checks permitted for the documented value
of zero (disabling the functionality altogether).

Second, the range checking of the command line parameter was done by
the credit scheduler's initialization code, despite it being a generic
scheduler option.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r f96a0cda1216 -r 8d209624ea83 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Fri Dec 07 16:19:11 2012 +0000
+++ b/xen/common/sched_credit.c	Mon Dec 10 11:14:27 2012 +0100
@@ -835,8 +835,9 @@ csched_sys_cntl(const struct scheduler *
     case XEN_SYSCTL_SCHEDOP_putinfo:
         if (params->tslice_ms > XEN_SYSCTL_CSCHED_TSLICE_MAX
             || params->tslice_ms < XEN_SYSCTL_CSCHED_TSLICE_MIN 
-            || params->ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
-            || params->ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN 
+            || (params->ratelimit_us
+                && (params->ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
+                    || params->ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN))
             || MICROSECS(params->ratelimit_us) > MILLISECS(params->tslice_ms) )
                 goto out;
         prv->tslice_ms = params->tslice_ms;
@@ -1593,17 +1594,6 @@ csched_init(struct scheduler *ops)
         sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
     }
 
-    if ( sched_ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
-         || sched_ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN )
-    {
-        printk("WARNING: sched_ratelimit_us outside of valid range [%d,%d].\n"
-               " Resetting to default %u\n",
-               XEN_SYSCTL_SCHED_RATELIMIT_MIN,
-               XEN_SYSCTL_SCHED_RATELIMIT_MAX,
-               SCHED_DEFAULT_RATELIMIT_US);
-        sched_ratelimit_us = SCHED_DEFAULT_RATELIMIT_US;
-    }
-
     prv->tslice_ms = sched_credit_tslice_ms;
     prv->ticks_per_tslice = CSCHED_TICKS_PER_TSLICE;
     if ( prv->tslice_ms < prv->ticks_per_tslice )
diff -r f96a0cda1216 -r 8d209624ea83 xen/common/schedule.c
--- a/xen/common/schedule.c	Fri Dec 07 16:19:11 2012 +0000
+++ b/xen/common/schedule.c	Mon Dec 10 11:14:27 2012 +0100
@@ -1324,6 +1324,18 @@ void __init scheduler_init(void)
     if ( SCHED_OP(&ops, init) )
         panic("scheduler returned error on init\n");
 
+    if ( sched_ratelimit_us &&
+         (sched_ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX
+          || sched_ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN) )
+    {
+        printk("WARNING: sched_ratelimit_us outside of valid range [%d,%d].\n"
+               " Resetting to default %u\n",
+               XEN_SYSCTL_SCHED_RATELIMIT_MIN,
+               XEN_SYSCTL_SCHED_RATELIMIT_MAX,
+               SCHED_DEFAULT_RATELIMIT_US);
+        sched_ratelimit_us = SCHED_DEFAULT_RATELIMIT_US;
+    }
+
     idle_domain = domain_create(DOMID_IDLE, 0, 0);
     BUG_ON(IS_ERR(idle_domain));
     idle_domain->vcpu = idle_vcpu;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX9-0007qd-Az; Tue, 11 Dec 2012 04:33:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX7-0007mb-CZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:29 +0000
Received: from [85.158.139.211:22291] by server-14.bemta-5.messagelabs.com id
	58/A4-09538-897B6C05; Tue, 11 Dec 2012 04:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1355200407!19469466!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25953 invoked from network); 11 Dec 2012 04:33:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0003J9-0j
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX4-0007F2-VG
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:26 +0000
Message-Id: <E1TiHX4-0007F2-VG@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/oprofile: adjust CPU specific
	initialization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355134597 -3600
# Node ID efc61beab92afe0465c9637f438302e7aaecdea3
# Parent  8d209624ea83b272e1ebd713a928c38d4782f4f1
x86/oprofile: adjust CPU specific initialization

Drop support for 32-bit only CPU models as well as those that can be
dealt with by the arch_perfmon bits. Models 14 and 15 remain as
questionable (I'm not 100% positive that these don't support 64-bit
mode).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 8d209624ea83 -r efc61beab92a xen/arch/x86/oprofile/nmi_int.c
--- a/xen/arch/x86/oprofile/nmi_int.c	Mon Dec 10 11:14:27 2012 +0100
+++ b/xen/arch/x86/oprofile/nmi_int.c	Mon Dec 10 11:16:37 2012 +0100
@@ -342,37 +342,13 @@ static int __init ppro_init(char ** cpu_
 		return 0;
 
 	switch (cpu_model) {
-	case 0 ... 2:
-		*cpu_type = "i386/ppro";
-		break;
-	case 3 ... 5:
-		*cpu_type = "i386/pii";
-		break;
-	case 6 ... 8:
-	case 10 ... 11:
-		*cpu_type = "i386/piii";
-		break;
-	case 9:
-	case 13:
-		*cpu_type = "i386/p6_mobile";
-		break;
 	case 14:
 		*cpu_type = "i386/core";
 		break;
 	case 15:
-	case 23:
-	case 29:
 		*cpu_type = "i386/core_2";
 		ppro_has_global_ctrl = 1;
 		break;
-	case 26:
-		arch_perfmon_setup_counters();
-		*cpu_type = "i386/core_i7";
-		ppro_has_global_ctrl = 1;
-		break;
-	case 28:
-		*cpu_type = "i386/atom";
-		break;
 	default:
 		/* Unknown */
 		return 0;
@@ -389,6 +365,7 @@ static int __init arch_perfmon_init(char
 	*cpu_type = "i386/arch_perfmon";
 	model = &op_arch_perfmon_spec;
 	arch_perfmon_setup_counters();
+	ppro_has_global_ctrl = 1;
 	return 1;
 }
 
@@ -413,14 +390,8 @@ static int __init nmi_init(void)
 				       "AMD processor family %d is not "
 				       "supported\n", family);
 				return -ENODEV;
-			case 6:
-				model = &op_athlon_spec;
-				cpu_type = "i386/athlon";
-				break;
 			case 0xf:
 				model = &op_athlon_spec;
-				/* Actually it could be i386/hammer too, but
-				   give user space an consistent name. */
 				cpu_type = "x86-64/hammer";
 				break;
 			case 0x10:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHX9-0007qd-Az; Tue, 11 Dec 2012 04:33:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX7-0007mb-CZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:29 +0000
Received: from [85.158.139.211:22291] by server-14.bemta-5.messagelabs.com id
	58/A4-09538-897B6C05; Tue, 11 Dec 2012 04:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1355200407!19469466!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25953 invoked from network); 11 Dec 2012 04:33:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0003J9-0j
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX4-0007F2-VG
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:26 +0000
Message-Id: <E1TiHX4-0007F2-VG@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/oprofile: adjust CPU specific
	initialization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355134597 -3600
# Node ID efc61beab92afe0465c9637f438302e7aaecdea3
# Parent  8d209624ea83b272e1ebd713a928c38d4782f4f1
x86/oprofile: adjust CPU specific initialization

Drop support for 32-bit only CPU models as well as those that can be
dealt with by the arch_perfmon bits. Models 14 and 15 remain as
questionable (I'm not 100% positive that these don't support 64-bit
mode).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 8d209624ea83 -r efc61beab92a xen/arch/x86/oprofile/nmi_int.c
--- a/xen/arch/x86/oprofile/nmi_int.c	Mon Dec 10 11:14:27 2012 +0100
+++ b/xen/arch/x86/oprofile/nmi_int.c	Mon Dec 10 11:16:37 2012 +0100
@@ -342,37 +342,13 @@ static int __init ppro_init(char ** cpu_
 		return 0;
 
 	switch (cpu_model) {
-	case 0 ... 2:
-		*cpu_type = "i386/ppro";
-		break;
-	case 3 ... 5:
-		*cpu_type = "i386/pii";
-		break;
-	case 6 ... 8:
-	case 10 ... 11:
-		*cpu_type = "i386/piii";
-		break;
-	case 9:
-	case 13:
-		*cpu_type = "i386/p6_mobile";
-		break;
 	case 14:
 		*cpu_type = "i386/core";
 		break;
 	case 15:
-	case 23:
-	case 29:
 		*cpu_type = "i386/core_2";
 		ppro_has_global_ctrl = 1;
 		break;
-	case 26:
-		arch_perfmon_setup_counters();
-		*cpu_type = "i386/core_i7";
-		ppro_has_global_ctrl = 1;
-		break;
-	case 28:
-		*cpu_type = "i386/atom";
-		break;
 	default:
 		/* Unknown */
 		return 0;
@@ -389,6 +365,7 @@ static int __init arch_perfmon_init(char
 	*cpu_type = "i386/arch_perfmon";
 	model = &op_arch_perfmon_spec;
 	arch_perfmon_setup_counters();
+	ppro_has_global_ctrl = 1;
 	return 1;
 }
 
@@ -413,14 +390,8 @@ static int __init nmi_init(void)
 				       "AMD processor family %d is not "
 				       "supported\n", family);
 				return -ENODEV;
-			case 6:
-				model = &op_athlon_spec;
-				cpu_type = "i386/athlon";
-				break;
 			case 0xf:
 				model = &op_athlon_spec;
-				/* Actually it could be i386/hammer too, but
-				   give user space an consistent name. */
 				cpu_type = "x86-64/hammer";
 				break;
 			case 0x10:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHXA-0007t8-Jx; Tue, 11 Dec 2012 04:33:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX7-0007nQ-Sl
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:30 +0000
Received: from [85.158.137.99:5024] by server-16.bemta-3.messagelabs.com id
	D6/1C-07461-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1355200402!18753129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5982 invoked from network); 11 Dec 2012 04:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0003Ic-7x
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0007Cr-6b
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Message-Id: <E1TiHX0-0007Cr-6b@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: fix interrupt delivery
	to L2 guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813139 0
# Node ID 90831c29bfde6aac013b7e5ec98934a4953c31c9
# Parent  25dd352265ca23750f1a1a983124b36f518c4384
nested vmx: fix interrupt delivery to L2 guest

While delivering interrupt into L2 guest, L0 hypervisor need to check
whether L1 hypervisor wants to own the interrupt, if not, directly
inject the interrupt into L2 guest.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 25dd352265ca -r 90831c29bfde xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Thu Dec 06 16:58:23 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/intr.c	Thu Dec 06 16:58:59 2012 +0000
@@ -163,7 +163,7 @@ enum hvm_intblk nvmx_intr_blocked(struct
 
 static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
 {
-    u32 exit_ctrl;
+    u32 ctrl;
 
     if ( nvmx_intr_blocked(v) != hvm_intblk_none )
     {
@@ -176,11 +176,14 @@ static int nvmx_intr_intercept(struct vc
         if ( intack.source == hvm_intsrc_pic ||
                  intack.source == hvm_intsrc_lapic )
         {
+            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+            if ( !(ctrl & PIN_BASED_EXT_INTR_MASK) )
+                return 0;
+
             vmx_inject_extint(intack.vector);
 
-            exit_ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx,
-                            VM_EXIT_CONTROLS);
-            if ( exit_ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
+            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, VM_EXIT_CONTROLS);
+            if ( ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
             {
                 /* for now, duplicate the ack path in vmx_intr_assist */
                 hvm_vcpu_ack_pending_irq(v, intack);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHXA-0007t8-Jx; Tue, 11 Dec 2012 04:33:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX7-0007nQ-Sl
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:30 +0000
Received: from [85.158.137.99:5024] by server-16.bemta-3.messagelabs.com id
	D6/1C-07461-497B6C05; Tue, 11 Dec 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1355200402!18753129!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5982 invoked from network); 11 Dec 2012 04:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0003Ic-7x
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX0-0007Cr-6b
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:22 +0000
Message-Id: <E1TiHX0-0007Cr-6b@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: fix interrupt delivery
	to L2 guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813139 0
# Node ID 90831c29bfde6aac013b7e5ec98934a4953c31c9
# Parent  25dd352265ca23750f1a1a983124b36f518c4384
nested vmx: fix interrupt delivery to L2 guest

While delivering interrupt into L2 guest, L0 hypervisor need to check
whether L1 hypervisor wants to own the interrupt, if not, directly
inject the interrupt into L2 guest.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 25dd352265ca -r 90831c29bfde xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Thu Dec 06 16:58:23 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/intr.c	Thu Dec 06 16:58:59 2012 +0000
@@ -163,7 +163,7 @@ enum hvm_intblk nvmx_intr_blocked(struct
 
 static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
 {
-    u32 exit_ctrl;
+    u32 ctrl;
 
     if ( nvmx_intr_blocked(v) != hvm_intblk_none )
     {
@@ -176,11 +176,14 @@ static int nvmx_intr_intercept(struct vc
         if ( intack.source == hvm_intsrc_pic ||
                  intack.source == hvm_intsrc_lapic )
         {
+            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+            if ( !(ctrl & PIN_BASED_EXT_INTR_MASK) )
+                return 0;
+
             vmx_inject_extint(intack.vector);
 
-            exit_ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx,
-                            VM_EXIT_CONTROLS);
-            if ( exit_ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
+            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, VM_EXIT_CONTROLS);
+            if ( ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
             {
                 /* for now, duplicate the ack path in vmx_intr_assist */
                 hvm_vcpu_ack_pending_irq(v, intack);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:36 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHXD-0007xq-RP; Tue, 11 Dec 2012 04:33:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX9-0007qx-U6
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:34 +0000
Received: from [85.158.139.211:65031] by server-10.bemta-5.messagelabs.com id
	6D/F4-13383-B97B6C05; Tue, 11 Dec 2012 04:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1355200407!19469468!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25979 invoked from network); 11 Dec 2012 04:33:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0003JC-Li
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0007FH-JP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Message-Id: <E1TiHX5-0007FH-JP@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] streamline guest copy operations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355134705 -3600
# Node ID 1b72138bddda1982f064f6411d3e4ff9400bd1bd
# Parent  efc61beab92afe0465c9637f438302e7aaecdea3
streamline guest copy operations

- use the variants not validating the VA range when writing back
  structures/fields to the same space that they were previously read
  from
- when only a single field of a structure actually changed, copy back
  just that field where possible
- consolidate copying back results in a few places

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/domctl.c	Mon Dec 10 11:18:25 2012 +0100
@@ -51,6 +51,7 @@ long arch_do_domctl(
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
+    bool_t copyback = 0;
 
     switch ( domctl->cmd )
     {
@@ -66,7 +67,7 @@ long arch_do_domctl(
                                 &domctl->u.shadow_op,
                                 guest_handle_cast(u_domctl, void));
             rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
+            copyback = 1;
         } 
     }
     break;
@@ -150,8 +151,7 @@ long arch_do_domctl(
         }
 
         rcu_unlock_domain(d);
-
-        copy_to_guest(u_domctl, domctl, 1);
+        copyback = 1;
     }
     break;
 
@@ -417,7 +417,7 @@ long arch_do_domctl(
             spin_unlock(&d->page_alloc_lock);
 
             domctl->u.getmemlist.num_pfns = i;
-            copy_to_guest(u_domctl, domctl, 1);
+            copyback = 1;
         getmemlist_out:
             rcu_unlock_domain(d);
         }
@@ -548,13 +548,11 @@ long arch_do_domctl(
             ret = -EFAULT;
 
     gethvmcontext_out:
-        if ( copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
+        rcu_unlock_domain(d);
+        copyback = 1;
 
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -636,11 +634,9 @@ long arch_do_domctl(
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
+        rcu_unlock_domain(d);
         ret = 0;
-        rcu_unlock_domain(d);
-
-        if ( copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
+        copyback = 1;
     }
     break;
 
@@ -685,13 +681,9 @@ long arch_do_domctl(
 
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
+        rcu_unlock_domain(d);
         ret = 0;
-        rcu_unlock_domain(d);
-
-        if ( copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
-
-
+        copyback = 1;
     }
     break;
 
@@ -1133,9 +1125,8 @@ long arch_do_domctl(
 
     ext_vcpucontext_out:
         rcu_unlock_domain(d);
-        if ( (domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext) &&
-             copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
+        if ( domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext )
+            copyback = 1;
     }
     break;
 
@@ -1277,10 +1268,10 @@ long arch_do_domctl(
             domctl->u.gdbsx_guest_memio.len;
 
         ret = gdbsx_guest_mem_io(domctl->domain, &domctl->u.gdbsx_guest_memio);
-        if ( !ret && copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
 
         rcu_unlock_domain(d);
+        if ( !ret )
+           copyback = 1;
     }
     break;
 
@@ -1367,10 +1358,9 @@ long arch_do_domctl(
                 }
             }
         }
+        rcu_unlock_domain(d);
         ret = 0;
-        if ( copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
-        rcu_unlock_domain(d);
+        copyback = 1;
     }
     break;
 
@@ -1494,9 +1484,8 @@ long arch_do_domctl(
 
     vcpuextstate_out:
         rcu_unlock_domain(d);
-        if ( (domctl->cmd == XEN_DOMCTL_getvcpuextstate) &&
-             copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
+        if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
+            copyback = 1;
     }
     break;
 
@@ -1513,7 +1502,7 @@ long arch_do_domctl(
                 ret = mem_event_domctl(d, &domctl->u.mem_event_op,
                                        guest_handle_cast(u_domctl, void));
             rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
+            copyback = 1;
         } 
     }
     break;
@@ -1548,8 +1537,7 @@ long arch_do_domctl(
                   &domctl->u.audit_p2m.m2p_bad,
                   &domctl->u.audit_p2m.p2m_bad);
         rcu_unlock_domain(d);
-        if ( copy_to_guest(u_domctl, domctl, 1) ) 
-            ret = -EFAULT;
+        copyback = 1;
     }
     break;
 #endif /* P2M_AUDIT */
@@ -1605,6 +1593,9 @@ long arch_do_domctl(
         break;
     }
 
+    if ( copyback && __copy_to_guest(u_domctl, domctl, 1) )
+        ret = -EFAULT;
+
     return ret;
 }
 
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/mm.c	Mon Dec 10 11:18:25 2012 +0100
@@ -4407,7 +4407,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
 
         if ( xatp.space == XENMAPSPACE_gmfn_range )
         {
-            if ( rc && copy_to_guest(arg, &xatp, 1) )
+            if ( rc && __copy_to_guest(arg, &xatp, 1) )
                 rc = -EFAULT;
 
             if ( rc == -EAGAIN )
@@ -4492,7 +4492,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
         map.nr_entries = min(map.nr_entries, d->arch.pv_domain.nr_e820);
         if ( copy_to_guest(map.buffer, d->arch.pv_domain.e820,
                            map.nr_entries) ||
-             copy_to_guest(arg, &map, 1) )
+             __copy_to_guest(arg, &map, 1) )
         {
             spin_unlock(&d->arch.pv_domain.e820_lock);
             return -EFAULT;
@@ -4559,7 +4559,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
 
         ctxt.map.nr_entries = ctxt.n;
 
-        if ( copy_to_guest(arg, &ctxt.map, 1) )
+        if ( __copy_to_guest(arg, &ctxt.map, 1) )
             return -EFAULT;
 
         return 0;
@@ -4630,7 +4630,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
             target.pod_cache_pages = p2m->pod.count;
             target.pod_entries     = p2m->pod.entry_count;
 
-            if ( copy_to_guest(arg, &target, 1) )
+            if ( __copy_to_guest(arg, &target, 1) )
             {
                 rc= -EFAULT;
                 goto pod_target_out_unlock;
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/physdev.c	Mon Dec 10 11:18:25 2012 +0100
@@ -384,7 +384,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         irq_status_query.flags |= XENIRQSTAT_needs_eoi;
         if ( pirq_shared(v->domain, irq) )
             irq_status_query.flags |= XENIRQSTAT_shared;
-        ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
+        ret = __copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
         break;
     }
 
@@ -412,7 +412,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         ret = physdev_map_pirq(map.domid, map.type, &map.index, &map.pirq,
                                &msi);
 
-        if ( copy_to_guest(arg, &map, 1) != 0 )
+        if ( __copy_to_guest(arg, &map, 1) )
             ret = -EFAULT;
         break;
     }
@@ -440,7 +440,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         if ( ret )
             break;
         ret = ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.value);
-        if ( copy_to_guest(arg, &apic, 1) != 0 )
+        if ( __copy_to_guest(arg, &apic, 1) )
             ret = -EFAULT;
         break;
     }
@@ -478,7 +478,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         irq_op.vector = irq_op.irq;
         ret = 0;
         
-        if ( copy_to_guest(arg, &irq_op, 1) != 0 )
+        if ( __copy_to_guest(arg, &irq_op, 1) )
             ret = -EFAULT;
         break;
     }
@@ -714,7 +714,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         if ( ret >= 0 )
         {
             out.pirq = ret;
-            ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
+            ret = __copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
         }
 
         break;
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/platform_hypercall.c	Mon Dec 10 11:18:25 2012 +0100
@@ -115,7 +115,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
         {
             op->u.add_memtype.handle = 0;
             op->u.add_memtype.reg    = ret;
-            ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
+            ret = __copy_field_to_guest(u_xenpf_op, op, u.add_memtype) ?
+                  -EFAULT : 0;
             if ( ret != 0 )
                 mtrr_del_page(ret, 0, 0);
         }
@@ -157,7 +158,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             op->u.read_memtype.mfn     = mfn;
             op->u.read_memtype.nr_mfns = nr_mfns;
             op->u.read_memtype.type    = type;
-            ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
+            ret = __copy_field_to_guest(u_xenpf_op, op, u.read_memtype)
+                  ? -EFAULT : 0;
         }
     }
     break;
@@ -263,8 +265,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             C(legacy_sectors_per_track);
 #undef C
 
-            ret = (copy_field_to_guest(u_xenpf_op, op,
-                                      u.firmware_info.u.disk_info)
+            ret = (__copy_field_to_guest(u_xenpf_op, op,
+                                         u.firmware_info.u.disk_info)
                    ? -EFAULT : 0);
             break;
         }
@@ -281,8 +283,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             op->u.firmware_info.u.disk_mbr_signature.mbr_signature =
                 sig->signature;
 
-            ret = (copy_field_to_guest(u_xenpf_op, op,
-                                      u.firmware_info.u.disk_mbr_signature)
+            ret = (__copy_field_to_guest(u_xenpf_op, op,
+                                         u.firmware_info.u.disk_mbr_signature)
                    ? -EFAULT : 0);
             break;
         }
@@ -299,10 +301,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
                 bootsym(boot_edid_caps) >> 8;
 
             ret = 0;
-            if ( copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
-                                     u.vbeddc_info.capabilities) ||
-                 copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
-                                     u.vbeddc_info.edid_transfer_time) ||
+            if ( __copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
+                                       u.vbeddc_info.capabilities) ||
+                 __copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
+                                       u.vbeddc_info.edid_transfer_time) ||
                  copy_to_compat(op->u.firmware_info.u.vbeddc_info.edid,
                                 bootsym(boot_edid_info), 128) )
                 ret = -EFAULT;
@@ -311,8 +313,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             ret = efi_get_info(op->u.firmware_info.index,
                                &op->u.firmware_info.u.efi_info);
             if ( ret == 0 &&
-                 copy_field_to_guest(u_xenpf_op, op,
-                                     u.firmware_info.u.efi_info) )
+                 __copy_field_to_guest(u_xenpf_op, op,
+                                       u.firmware_info.u.efi_info) )
                 ret = -EFAULT;
             break;
         case XEN_FW_KBD_SHIFT_FLAGS:
@@ -323,8 +325,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             op->u.firmware_info.u.kbd_shift_flags = bootsym(kbd_shift_flags);
 
             ret = 0;
-            if ( copy_field_to_guest(u_xenpf_op, op,
-                                     u.firmware_info.u.kbd_shift_flags) )
+            if ( __copy_field_to_guest(u_xenpf_op, op,
+                                       u.firmware_info.u.kbd_shift_flags) )
                 ret = -EFAULT;
             break;
         default:
@@ -340,7 +342,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
 
         ret = efi_runtime_call(&op->u.efi_runtime_call);
         if ( ret == 0 &&
-             copy_field_to_guest(u_xenpf_op, op, u.efi_runtime_call) )
+             __copy_field_to_guest(u_xenpf_op, op, u.efi_runtime_call) )
             ret = -EFAULT;
         break;
 
@@ -412,7 +414,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             ret = cpumask_to_xenctl_cpumap(&ctlmap, cpumap);
         free_cpumask_var(cpumap);
 
-        if ( ret == 0 && copy_to_guest(u_xenpf_op, op, 1) )
+        if ( ret == 0 && __copy_field_to_guest(u_xenpf_op, op, u.getidletime) )
             ret = -EFAULT;
     }
     break;
@@ -503,7 +505,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
 
         put_cpu_maps();
 
-        ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
+        ret = __copy_field_to_guest(u_xenpf_op, op, u.pcpu_info) ? -EFAULT : 0;
     }
     break;
 
@@ -538,7 +540,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
 
         put_cpu_maps();
 
-        if ( copy_field_to_guest(u_xenpf_op, op, u.pcpu_version) )
+        if ( __copy_field_to_guest(u_xenpf_op, op, u.pcpu_version) )
             ret = -EFAULT;
     }
     break;
@@ -639,7 +641,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
 
         case XEN_CORE_PARKING_GET:
             op->u.core_parking.idle_nums = get_cur_idle_nums();
-            ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
+            ret = __copy_field_to_guest(u_xenpf_op, op, u.core_parking) ?
+                  -EFAULT : 0;
             break;
 
         default:
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/sysctl.c
--- a/xen/arch/x86/sysctl.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/sysctl.c	Mon Dec 10 11:18:25 2012 +0100
@@ -93,7 +93,7 @@ long arch_do_sysctl(
         if ( iommu_enabled )
             pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm_directio;
 
-        if ( copy_to_guest(u_sysctl, sysctl, 1) )
+        if ( __copy_field_to_guest(u_sysctl, sysctl, u.physinfo) )
             ret = -EFAULT;
     }
     break;
@@ -133,7 +133,8 @@ long arch_do_sysctl(
             }
         }
 
-        ret = ((i <= max_cpu_index) || copy_to_guest(u_sysctl, sysctl, 1))
+        ret = ((i <= max_cpu_index) ||
+               __copy_field_to_guest(u_sysctl, sysctl, u.topologyinfo))
             ? -EFAULT : 0;
     }
     break;
@@ -185,7 +186,8 @@ long arch_do_sysctl(
             }
         }
 
-        ret = ((i <= max_node_index) || copy_to_guest(u_sysctl, sysctl, 1))
+        ret = ((i <= max_node_index) ||
+               __copy_field_to_guest(u_sysctl, sysctl, u.numainfo))
             ? -EFAULT : 0;
     }
     break;
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/mm.c	Mon Dec 10 11:18:25 2012 +0100
@@ -122,7 +122,7 @@ int compat_arch_memory_op(int op, XEN_GU
 #define XLAT_memory_map_HNDL_buffer(_d_, _s_) ((void)0)
         XLAT_memory_map(&cmp, nat);
 #undef XLAT_memory_map_HNDL_buffer
-        if ( copy_to_guest(arg, &cmp, 1) )
+        if ( __copy_to_guest(arg, &cmp, 1) )
             rc = -EFAULT;
 
         break;
@@ -148,7 +148,7 @@ int compat_arch_memory_op(int op, XEN_GU
 
         XLAT_pod_target(&cmp, nat);
 
-        if ( copy_to_guest(arg, &cmp, 1) )
+        if ( __copy_to_guest(arg, &cmp, 1) )
         {
             if ( rc == __HYPERVISOR_memory_op )
                 hypercall_cancel_continuation();
@@ -200,7 +200,7 @@ int compat_arch_memory_op(int op, XEN_GU
         }
 
         xmml.nr_extents = i;
-        if ( copy_to_guest(arg, &xmml, 1) )
+        if ( __copy_to_guest(arg, &xmml, 1) )
             rc = -EFAULT;
 
         break;
@@ -219,7 +219,7 @@ int compat_arch_memory_op(int op, XEN_GU
         if ( copy_from_guest(&meo, arg, 1) )
             return -EFAULT;
         rc = do_mem_event_op(op, meo.domain, (void *) &meo);
-        if ( !rc && copy_to_guest(arg, &meo, 1) )
+        if ( !rc && __copy_to_guest(arg, &meo, 1) )
             return -EFAULT;
         break;
     }
@@ -231,7 +231,7 @@ int compat_arch_memory_op(int op, XEN_GU
         if ( mso.op == XENMEM_sharing_op_audit )
             return mem_sharing_audit(); 
         rc = do_mem_event_op(op, mso.domain, (void *) &mso);
-        if ( !rc && copy_to_guest(arg, &mso, 1) )
+        if ( !rc && __copy_to_guest(arg, &mso, 1) )
             return -EFAULT;
         break;
     }
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/x86_64/mm.c	Mon Dec 10 11:18:25 2012 +0100
@@ -1074,7 +1074,7 @@ long subarch_memory_op(int op, XEN_GUEST
         }
 
         xmml.nr_extents = i;
-        if ( copy_to_guest(arg, &xmml, 1) )
+        if ( __copy_to_guest(arg, &xmml, 1) )
             return -EFAULT;
 
         break;
@@ -1092,7 +1092,7 @@ long subarch_memory_op(int op, XEN_GUEST
         if ( copy_from_guest(&meo, arg, 1) )
             return -EFAULT;
         rc = do_mem_event_op(op, meo.domain, (void *) &meo);
-        if ( !rc && copy_to_guest(arg, &meo, 1) )
+        if ( !rc && __copy_to_guest(arg, &meo, 1) )
             return -EFAULT;
         break;
     }
@@ -1104,7 +1104,7 @@ long subarch_memory_op(int op, XEN_GUEST
         if ( mso.op == XENMEM_sharing_op_audit )
             return mem_sharing_audit(); 
         rc = do_mem_event_op(op, mso.domain, (void *) &mso);
-        if ( !rc && copy_to_guest(arg, &mso, 1) )
+        if ( !rc && __copy_to_guest(arg, &mso, 1) )
             return -EFAULT;
         break;
     }
diff -r efc61beab92a -r 1b72138bddda xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/compat/memory.c	Mon Dec 10 11:18:25 2012 +0100
@@ -292,8 +292,9 @@ int compat_memory_op(unsigned int cmd, X
             }
 
             cmp.xchg.nr_exchanged = nat.xchg->nr_exchanged;
-            if ( copy_field_to_guest(guest_handle_cast(compat, compat_memory_exchange_t),
-                                     &cmp.xchg, nr_exchanged) )
+            if ( __copy_field_to_guest(guest_handle_cast(compat,
+                                                         compat_memory_exchange_t),
+                                       &cmp.xchg, nr_exchanged) )
                 rc = -EFAULT;
 
             if ( rc < 0 )
diff -r efc61beab92a -r 1b72138bddda xen/common/domctl.c
--- a/xen/common/domctl.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/domctl.c	Mon Dec 10 11:18:25 2012 +0100
@@ -242,6 +242,7 @@ void domctl_lock_release(void)
 long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
+    bool_t copyback = 0;
     struct xen_domctl curop, *op = &curop;
 
     if ( copy_from_guest(op, u_domctl, 1) )
@@ -469,8 +470,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
                sizeof(xen_domain_handle_t));
 
         op->domain = d->domain_id;
-        if ( copy_to_guest(u_domctl, op, 1) )
-            ret = -EFAULT;
+        copyback = 1;
     }
     break;
 
@@ -653,8 +653,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
             goto scheduler_op_out;
 
         ret = sched_adjust(d, &op->u.scheduler_op);
-        if ( copy_to_guest(u_domctl, op, 1) )
-            ret = -EFAULT;
+        copyback = 1;
 
     scheduler_op_out:
         rcu_unlock_domain(d);
@@ -686,8 +685,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         getdomaininfo(d, &op->u.getdomaininfo);
 
         op->domain = op->u.getdomaininfo.domain;
-        if ( copy_to_guest(u_domctl, op, 1) )
-            ret = -EFAULT;
+        copyback = 1;
 
     getdomaininfo_out:
         rcu_read_unlock(&domlist_read_lock);
@@ -747,8 +745,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         ret = copy_to_guest(op->u.vcpucontext.ctxt, c.nat, 1);
 #endif
 
-        if ( copy_to_guest(u_domctl, op, 1) || ret )
+        if ( ret )
             ret = -EFAULT;
+        copyback = 1;
 
     getvcpucontext_out:
         xfree(c.nat);
@@ -786,9 +785,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         op->u.getvcpuinfo.cpu_time = runstate.time[RUNSTATE_running];
         op->u.getvcpuinfo.cpu      = v->processor;
         ret = 0;
-
-        if ( copy_to_guest(u_domctl, op, 1) )
-            ret = -EFAULT;
+        copyback = 1;
 
     getvcpuinfo_out:
         rcu_unlock_domain(d);
@@ -1045,6 +1042,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     domctl_lock_release();
 
+    if ( copyback && __copy_to_guest(u_domctl, op, 1) )
+        ret = -EFAULT;
+
     return ret;
 }
 
diff -r efc61beab92a -r 1b72138bddda xen/common/event_channel.c
--- a/xen/common/event_channel.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/event_channel.c	Mon Dec 10 11:18:25 2012 +0100
@@ -981,7 +981,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&alloc_unbound, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_alloc_unbound(&alloc_unbound);
-        if ( (rc == 0) && (copy_to_guest(arg, &alloc_unbound, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &alloc_unbound, 1) )
             rc = -EFAULT; /* Cleaning up here would be a mess! */
         break;
     }
@@ -991,7 +991,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&bind_interdomain, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_bind_interdomain(&bind_interdomain);
-        if ( (rc == 0) && (copy_to_guest(arg, &bind_interdomain, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &bind_interdomain, 1) )
             rc = -EFAULT; /* Cleaning up here would be a mess! */
         break;
     }
@@ -1001,7 +1001,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&bind_virq, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_bind_virq(&bind_virq);
-        if ( (rc == 0) && (copy_to_guest(arg, &bind_virq, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &bind_virq, 1) )
             rc = -EFAULT; /* Cleaning up here would be a mess! */
         break;
     }
@@ -1011,7 +1011,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&bind_ipi, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_bind_ipi(&bind_ipi);
-        if ( (rc == 0) && (copy_to_guest(arg, &bind_ipi, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &bind_ipi, 1) )
             rc = -EFAULT; /* Cleaning up here would be a mess! */
         break;
     }
@@ -1021,7 +1021,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&bind_pirq, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_bind_pirq(&bind_pirq);
-        if ( (rc == 0) && (copy_to_guest(arg, &bind_pirq, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &bind_pirq, 1) )
             rc = -EFAULT; /* Cleaning up here would be a mess! */
         break;
     }
@@ -1047,7 +1047,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&status, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_status(&status);
-        if ( (rc == 0) && (copy_to_guest(arg, &status, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &status, 1) )
             rc = -EFAULT;
         break;
     }
diff -r efc61beab92a -r 1b72138bddda xen/common/grant_table.c
--- a/xen/common/grant_table.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/grant_table.c	Mon Dec 10 11:18:25 2012 +0100
@@ -1115,12 +1115,13 @@ gnttab_unmap_grant_ref(
 
         for ( i = 0; i < c; i++ )
         {
-            if ( unlikely(__copy_from_guest_offset(&op, uop, done+i, 1)) )
+            if ( unlikely(__copy_from_guest(&op, uop, 1)) )
                 goto fault;
             __gnttab_unmap_grant_ref(&op, &(common[i]));
             ++partial_done;
-            if ( unlikely(__copy_to_guest_offset(uop, done+i, &op, 1)) )
+            if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
                 goto fault;
+            guest_handle_add_offset(uop, 1);
         }
 
         flush_tlb_mask(current->domain->domain_dirty_cpumask);
@@ -1177,12 +1178,13 @@ gnttab_unmap_and_replace(
         
         for ( i = 0; i < c; i++ )
         {
-            if ( unlikely(__copy_from_guest_offset(&op, uop, done+i, 1)) )
+            if ( unlikely(__copy_from_guest(&op, uop, 1)) )
                 goto fault;
             __gnttab_unmap_and_replace(&op, &(common[i]));
             ++partial_done;
-            if ( unlikely(__copy_to_guest_offset(uop, done+i, &op, 1)) )
+            if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
                 goto fault;
+            guest_handle_add_offset(uop, 1);
         }
         
         flush_tlb_mask(current->domain->domain_dirty_cpumask);
@@ -1396,7 +1398,7 @@ gnttab_setup_table(
  out2:
     rcu_unlock_domain(d);
  out1:
-    if ( unlikely(copy_to_guest(uop, &op, 1)) )
+    if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
         return -EFAULT;
 
     return 0;
@@ -1446,7 +1448,7 @@ gnttab_query_size(
     rcu_unlock_domain(d);
 
  query_out:
-    if ( unlikely(copy_to_guest(uop, &op, 1)) )
+    if ( unlikely(__copy_to_guest(uop, &op, 1)) )
         return -EFAULT;
 
     return 0;
@@ -1542,7 +1544,7 @@ gnttab_transfer(
             return i;
 
         /* Read from caller address space. */
-        if ( unlikely(__copy_from_guest_offset(&gop, uop, i, 1)) )
+        if ( unlikely(__copy_from_guest(&gop, uop, 1)) )
         {
             gdprintk(XENLOG_INFO, "gnttab_transfer: error reading req %d/%d\n",
                     i, count);
@@ -1701,12 +1703,13 @@ gnttab_transfer(
         gop.status = GNTST_okay;
 
     copyback:
-        if ( unlikely(__copy_to_guest_offset(uop, i, &gop, 1)) )
+        if ( unlikely(__copy_field_to_guest(uop, &gop, status)) )
         {
             gdprintk(XENLOG_INFO, "gnttab_transfer: error writing resp "
                      "%d/%d\n", i, count);
             return -EFAULT;
         }
+        guest_handle_add_offset(uop, 1);
     }
 
     return 0;
@@ -2143,17 +2146,18 @@ gnttab_copy(
     {
         if (i && hypercall_preempt_check())
             return i;
-        if ( unlikely(__copy_from_guest_offset(&op, uop, i, 1)) )
+        if ( unlikely(__copy_from_guest(&op, uop, 1)) )
             return -EFAULT;
         __gnttab_copy(&op);
-        if ( unlikely(__copy_to_guest_offset(uop, i, &op, 1)) )
+        if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
             return -EFAULT;
+        guest_handle_add_offset(uop, 1);
     }
     return 0;
 }
 
 static long
-gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t uop))
+gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t) uop)
 {
     gnttab_set_version_t op;
     struct domain *d = current->domain;
@@ -2265,7 +2269,7 @@ out_unlock:
 out:
     op.version = gt->gt_version;
 
-    if (copy_to_guest(uop, &op, 1))
+    if (__copy_to_guest(uop, &op, 1))
         res = -EFAULT;
 
     return res;
@@ -2329,14 +2333,14 @@ gnttab_get_status_frames(XEN_GUEST_HANDL
 out2:
     rcu_unlock_domain(d);
 out1:
-    if ( unlikely(copy_to_guest(uop, &op, 1)) )
+    if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
         return -EFAULT;
 
     return 0;
 }
 
 static long
-gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
+gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t) uop)
 {
     gnttab_get_version_t op;
     struct domain *d;
@@ -2359,7 +2363,7 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARA
 
     rcu_unlock_domain(d);
 
-    if ( copy_to_guest(uop, &op, 1) )
+    if ( __copy_field_to_guest(uop, &op, version) )
         return -EFAULT;
 
     return 0;
@@ -2421,7 +2425,7 @@ out:
 }
 
 static long
-gnttab_swap_grant_ref(XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t uop),
+gnttab_swap_grant_ref(XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t) uop,
                       unsigned int count)
 {
     int i;
@@ -2431,11 +2435,12 @@ gnttab_swap_grant_ref(XEN_GUEST_HANDLE_P
     {
         if ( i && hypercall_preempt_check() )
             return i;
-        if ( unlikely(__copy_from_guest_offset(&op, uop, i, 1)) )
+        if ( unlikely(__copy_from_guest(&op, uop, 1)) )
             return -EFAULT;
         op.status = __gnttab_swap_grant_ref(op.ref_a, op.ref_b);
-        if ( unlikely(__copy_to_guest_offset(uop, i, &op, 1)) )
+        if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
             return -EFAULT;
+        guest_handle_add_offset(uop, 1);
     }
     return 0;
 }
diff -r efc61beab92a -r 1b72138bddda xen/common/memory.c
--- a/xen/common/memory.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/memory.c	Mon Dec 10 11:18:25 2012 +0100
@@ -359,7 +359,7 @@ static long memory_exchange(XEN_GUEST_HA
         {
             exch.nr_exchanged = i << in_chunk_order;
             rcu_unlock_domain(d);
-            if ( copy_field_to_guest(arg, &exch, nr_exchanged) )
+            if ( __copy_field_to_guest(arg, &exch, nr_exchanged) )
                 return -EFAULT;
             return hypercall_create_continuation(
                 __HYPERVISOR_memory_op, "lh", XENMEM_exchange, arg);
@@ -500,7 +500,7 @@ static long memory_exchange(XEN_GUEST_HA
     }
 
     exch.nr_exchanged = exch.in.nr_extents;
-    if ( copy_field_to_guest(arg, &exch, nr_exchanged) )
+    if ( __copy_field_to_guest(arg, &exch, nr_exchanged) )
         rc = -EFAULT;
     rcu_unlock_domain(d);
     return rc;
@@ -527,7 +527,7 @@ static long memory_exchange(XEN_GUEST_HA
     exch.nr_exchanged = i << in_chunk_order;
 
  fail_early:
-    if ( copy_field_to_guest(arg, &exch, nr_exchanged) )
+    if ( __copy_field_to_guest(arg, &exch, nr_exchanged) )
         rc = -EFAULT;
     return rc;
 }
diff -r efc61beab92a -r 1b72138bddda xen/common/sysctl.c
--- a/xen/common/sysctl.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/sysctl.c	Mon Dec 10 11:18:25 2012 +0100
@@ -30,6 +30,7 @@
 long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
     long ret = 0;
+    int copyback = -1;
     struct xen_sysctl curop, *op = &curop;
     static DEFINE_SPINLOCK(sysctl_lock);
 
@@ -55,42 +56,28 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
     switch ( op->cmd )
     {
     case XEN_SYSCTL_readconsole:
-    {
         ret = xsm_readconsole(op->u.readconsole.clear);
         if ( ret )
             break;
 
         ret = read_console_ring(&op->u.readconsole);
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
 
     case XEN_SYSCTL_tbuf_op:
-    {
         ret = xsm_tbufcontrol();
         if ( ret )
             break;
 
         ret = tb_control(&op->u.tbuf_op);
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
     
     case XEN_SYSCTL_sched_id:
-    {
         ret = xsm_sched_id();
         if ( ret )
             break;
 
         op->u.sched_id.sched_id = sched_id();
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-        else
-            ret = 0;
-    }
-    break;
+        break;
 
     case XEN_SYSCTL_getdomaininfolist:
     { 
@@ -129,38 +116,27 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
             break;
         
         op->u.getdomaininfolist.num_domains = num_domains;
-
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
     }
     break;
 
 #ifdef PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
-    {
         ret = xsm_perfcontrol();
         if ( ret )
             break;
 
         ret = perfc_control(&op->u.perfc_op);
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
 #endif
 
 #ifdef LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
-    {
         ret = xsm_lockprof();
         if ( ret )
             break;
 
         ret = spinlock_profile_control(&op->u.lockprof_op);
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
 #endif
     case XEN_SYSCTL_debug_keys:
     {
@@ -179,6 +155,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
             handle_keypress(c, guest_cpu_user_regs());
         }
         ret = 0;
+        copyback = 0;
     }
     break;
 
@@ -193,22 +170,21 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
         if ( ret )
             break;
 
+        ret = -EFAULT;
         for ( i = 0; i < nr_cpus; i++ )
         {
             cpuinfo.idletime = get_cpu_idle_time(i);
 
-            ret = -EFAULT;
             if ( copy_to_guest_offset(op->u.getcpuinfo.info, i, &cpuinfo, 1) )
                 goto out;
         }
 
         op->u.getcpuinfo.nr_cpus = i;
-        ret = copy_to_guest(u_sysctl, op, 1) ? -EFAULT : 0;
+        ret = 0;
     }
     break;
 
     case XEN_SYSCTL_availheap:
-    { 
         ret = xsm_availheap();
         if ( ret )
             break;
@@ -218,47 +194,26 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
             op->u.availheap.min_bitwidth,
             op->u.availheap.max_bitwidth);
         op->u.availheap.avail_bytes <<= PAGE_SHIFT;
-
-        ret = copy_to_guest(u_sysctl, op, 1) ? -EFAULT : 0;
-    }
-    break;
+        break;
 
 #ifdef HAS_ACPI
     case XEN_SYSCTL_get_pmstat:
-    {
         ret = xsm_get_pmstat();
         if ( ret )
             break;
 
         ret = do_get_pm_info(&op->u.get_pmstat);
-        if ( ret )
-            break;
-
-        if ( copy_to_guest(u_sysctl, op, 1) )
-        {
-            ret = -EFAULT;
-            break;
-        }
-    }
-    break;
+        break;
 
     case XEN_SYSCTL_pm_op:
-    {
         ret = xsm_pm_op();
         if ( ret )
             break;
 
         ret = do_pm_op(&op->u.pm_op);
-        if ( ret && (ret != -EAGAIN) )
-            break;
-
-        if ( copy_to_guest(u_sysctl, op, 1) )
-        {
-            ret = -EFAULT;
-            break;
-        }
-    }
-    break;
+        if ( ret == -EAGAIN )
+            copyback = 1;
+        break;
 #endif
 
     case XEN_SYSCTL_page_offline_op:
@@ -317,41 +272,39 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
         }
 
         xfree(status);
+        copyback = 0;
     }
     break;
 
     case XEN_SYSCTL_cpupool_op:
-    {
         ret = xsm_cpupool_op();
         if ( ret )
             break;
 
         ret = cpupool_do_sysctl(&op->u.cpupool_op);
-        if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
 
     case XEN_SYSCTL_scheduler_op:
-    {
         ret = xsm_sched_op();
         if ( ret )
             break;
 
         ret = sched_adjust_global(&op->u.scheduler_op);
-        if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
 
     default:
         ret = arch_do_sysctl(op, u_sysctl);
+        copyback = 0;
         break;
     }
 
  out:
     spin_unlock(&sysctl_lock);
 
+    if ( copyback && (!ret || copyback > 0) &&
+         __copy_to_guest(u_sysctl, op, 1) )
+        ret = -EFAULT;
+
     return ret;
 }
 
diff -r efc61beab92a -r 1b72138bddda xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/xenoprof.c	Mon Dec 10 11:18:25 2012 +0100
@@ -449,7 +449,7 @@ static int add_passive_list(XEN_GUEST_HA
             current->domain, __pa(d->xenoprof->rawbuf),
             passive.buf_gmaddr, d->xenoprof->npages);
 
-    if ( copy_to_guest(arg, &passive, 1) )
+    if ( __copy_to_guest(arg, &passive, 1) )
     {
         put_domain(d);
         return -EFAULT;
@@ -604,7 +604,7 @@ static int xenoprof_op_init(XEN_GUEST_HA
     if ( xenoprof_init.is_primary )
         xenoprof_primary_profiler = current->domain;
 
-    return (copy_to_guest(arg, &xenoprof_init, 1) ? -EFAULT : 0);
+    return __copy_to_guest(arg, &xenoprof_init, 1) ? -EFAULT : 0;
 }
 
 #define ret_t long
@@ -651,10 +651,7 @@ static int xenoprof_op_get_buffer(XEN_GU
             d, __pa(d->xenoprof->rawbuf), xenoprof_get_buffer.buf_gmaddr,
             d->xenoprof->npages);
 
-    if ( copy_to_guest(arg, &xenoprof_get_buffer, 1) )
-        return -EFAULT;
-
-    return 0;
+    return __copy_to_guest(arg, &xenoprof_get_buffer, 1) ? -EFAULT : 0;
 }
 
 #define NONPRIV_OP(op) ( (op == XENOPROF_init)          \
diff -r efc61beab92a -r 1b72138bddda xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Mon Dec 10 11:18:25 2012 +0100
@@ -586,7 +586,7 @@ int iommu_do_domctl(
             domctl->u.get_device_group.num_sdevs = ret;
             ret = 0;
         }
-        if ( copy_to_guest(u_domctl, domctl, 1) )
+        if ( __copy_field_to_guest(u_domctl, domctl, u.get_device_group) )
             ret = -EFAULT;
         rcu_unlock_domain(d);
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:36 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHXD-0007xq-RP; Tue, 11 Dec 2012 04:33:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX9-0007qx-U6
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:34 +0000
Received: from [85.158.139.211:65031] by server-10.bemta-5.messagelabs.com id
	6D/F4-13383-B97B6C05; Tue, 11 Dec 2012 04:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1355200407!19469468!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.4 required=7.0 tests=INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25979 invoked from network); 11 Dec 2012 04:33:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0003JC-Li
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX5-0007FH-JP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:27 +0000
Message-Id: <E1TiHX5-0007FH-JP@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] streamline guest copy operations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355134705 -3600
# Node ID 1b72138bddda1982f064f6411d3e4ff9400bd1bd
# Parent  efc61beab92afe0465c9637f438302e7aaecdea3
streamline guest copy operations

- use the variants not validating the VA range when writing back
  structures/fields to the same space that they were previously read
  from
- when only a single field of a structure actually changed, copy back
  just that field where possible
- consolidate copying back results in a few places

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/domctl.c	Mon Dec 10 11:18:25 2012 +0100
@@ -51,6 +51,7 @@ long arch_do_domctl(
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
+    bool_t copyback = 0;
 
     switch ( domctl->cmd )
     {
@@ -66,7 +67,7 @@ long arch_do_domctl(
                                 &domctl->u.shadow_op,
                                 guest_handle_cast(u_domctl, void));
             rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
+            copyback = 1;
         } 
     }
     break;
@@ -150,8 +151,7 @@ long arch_do_domctl(
         }
 
         rcu_unlock_domain(d);
-
-        copy_to_guest(u_domctl, domctl, 1);
+        copyback = 1;
     }
     break;
 
@@ -417,7 +417,7 @@ long arch_do_domctl(
             spin_unlock(&d->page_alloc_lock);
 
             domctl->u.getmemlist.num_pfns = i;
-            copy_to_guest(u_domctl, domctl, 1);
+            copyback = 1;
         getmemlist_out:
             rcu_unlock_domain(d);
         }
@@ -548,13 +548,11 @@ long arch_do_domctl(
             ret = -EFAULT;
 
     gethvmcontext_out:
-        if ( copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
+        rcu_unlock_domain(d);
+        copyback = 1;
 
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -636,11 +634,9 @@ long arch_do_domctl(
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
+        rcu_unlock_domain(d);
         ret = 0;
-        rcu_unlock_domain(d);
-
-        if ( copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
+        copyback = 1;
     }
     break;
 
@@ -685,13 +681,9 @@ long arch_do_domctl(
 
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
+        rcu_unlock_domain(d);
         ret = 0;
-        rcu_unlock_domain(d);
-
-        if ( copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
-
-
+        copyback = 1;
     }
     break;
 
@@ -1133,9 +1125,8 @@ long arch_do_domctl(
 
     ext_vcpucontext_out:
         rcu_unlock_domain(d);
-        if ( (domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext) &&
-             copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
+        if ( domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext )
+            copyback = 1;
     }
     break;
 
@@ -1277,10 +1268,10 @@ long arch_do_domctl(
             domctl->u.gdbsx_guest_memio.len;
 
         ret = gdbsx_guest_mem_io(domctl->domain, &domctl->u.gdbsx_guest_memio);
-        if ( !ret && copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
 
         rcu_unlock_domain(d);
+        if ( !ret )
+           copyback = 1;
     }
     break;
 
@@ -1367,10 +1358,9 @@ long arch_do_domctl(
                 }
             }
         }
+        rcu_unlock_domain(d);
         ret = 0;
-        if ( copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
-        rcu_unlock_domain(d);
+        copyback = 1;
     }
     break;
 
@@ -1494,9 +1484,8 @@ long arch_do_domctl(
 
     vcpuextstate_out:
         rcu_unlock_domain(d);
-        if ( (domctl->cmd == XEN_DOMCTL_getvcpuextstate) &&
-             copy_to_guest(u_domctl, domctl, 1) )
-            ret = -EFAULT;
+        if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
+            copyback = 1;
     }
     break;
 
@@ -1513,7 +1502,7 @@ long arch_do_domctl(
                 ret = mem_event_domctl(d, &domctl->u.mem_event_op,
                                        guest_handle_cast(u_domctl, void));
             rcu_unlock_domain(d);
-            copy_to_guest(u_domctl, domctl, 1);
+            copyback = 1;
         } 
     }
     break;
@@ -1548,8 +1537,7 @@ long arch_do_domctl(
                   &domctl->u.audit_p2m.m2p_bad,
                   &domctl->u.audit_p2m.p2m_bad);
         rcu_unlock_domain(d);
-        if ( copy_to_guest(u_domctl, domctl, 1) ) 
-            ret = -EFAULT;
+        copyback = 1;
     }
     break;
 #endif /* P2M_AUDIT */
@@ -1605,6 +1593,9 @@ long arch_do_domctl(
         break;
     }
 
+    if ( copyback && __copy_to_guest(u_domctl, domctl, 1) )
+        ret = -EFAULT;
+
     return ret;
 }
 
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/mm.c	Mon Dec 10 11:18:25 2012 +0100
@@ -4407,7 +4407,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
 
         if ( xatp.space == XENMAPSPACE_gmfn_range )
         {
-            if ( rc && copy_to_guest(arg, &xatp, 1) )
+            if ( rc && __copy_to_guest(arg, &xatp, 1) )
                 rc = -EFAULT;
 
             if ( rc == -EAGAIN )
@@ -4492,7 +4492,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
         map.nr_entries = min(map.nr_entries, d->arch.pv_domain.nr_e820);
         if ( copy_to_guest(map.buffer, d->arch.pv_domain.e820,
                            map.nr_entries) ||
-             copy_to_guest(arg, &map, 1) )
+             __copy_to_guest(arg, &map, 1) )
         {
             spin_unlock(&d->arch.pv_domain.e820_lock);
             return -EFAULT;
@@ -4559,7 +4559,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
 
         ctxt.map.nr_entries = ctxt.n;
 
-        if ( copy_to_guest(arg, &ctxt.map, 1) )
+        if ( __copy_to_guest(arg, &ctxt.map, 1) )
             return -EFAULT;
 
         return 0;
@@ -4630,7 +4630,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
             target.pod_cache_pages = p2m->pod.count;
             target.pod_entries     = p2m->pod.entry_count;
 
-            if ( copy_to_guest(arg, &target, 1) )
+            if ( __copy_to_guest(arg, &target, 1) )
             {
                 rc= -EFAULT;
                 goto pod_target_out_unlock;
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/physdev.c	Mon Dec 10 11:18:25 2012 +0100
@@ -384,7 +384,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         irq_status_query.flags |= XENIRQSTAT_needs_eoi;
         if ( pirq_shared(v->domain, irq) )
             irq_status_query.flags |= XENIRQSTAT_shared;
-        ret = copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
+        ret = __copy_to_guest(arg, &irq_status_query, 1) ? -EFAULT : 0;
         break;
     }
 
@@ -412,7 +412,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         ret = physdev_map_pirq(map.domid, map.type, &map.index, &map.pirq,
                                &msi);
 
-        if ( copy_to_guest(arg, &map, 1) != 0 )
+        if ( __copy_to_guest(arg, &map, 1) )
             ret = -EFAULT;
         break;
     }
@@ -440,7 +440,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         if ( ret )
             break;
         ret = ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.value);
-        if ( copy_to_guest(arg, &apic, 1) != 0 )
+        if ( __copy_to_guest(arg, &apic, 1) )
             ret = -EFAULT;
         break;
     }
@@ -478,7 +478,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         irq_op.vector = irq_op.irq;
         ret = 0;
         
-        if ( copy_to_guest(arg, &irq_op, 1) != 0 )
+        if ( __copy_to_guest(arg, &irq_op, 1) )
             ret = -EFAULT;
         break;
     }
@@ -714,7 +714,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         if ( ret >= 0 )
         {
             out.pirq = ret;
-            ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
+            ret = __copy_to_guest(arg, &out, 1) ? -EFAULT : 0;
         }
 
         break;
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/platform_hypercall.c	Mon Dec 10 11:18:25 2012 +0100
@@ -115,7 +115,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
         {
             op->u.add_memtype.handle = 0;
             op->u.add_memtype.reg    = ret;
-            ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
+            ret = __copy_field_to_guest(u_xenpf_op, op, u.add_memtype) ?
+                  -EFAULT : 0;
             if ( ret != 0 )
                 mtrr_del_page(ret, 0, 0);
         }
@@ -157,7 +158,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             op->u.read_memtype.mfn     = mfn;
             op->u.read_memtype.nr_mfns = nr_mfns;
             op->u.read_memtype.type    = type;
-            ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
+            ret = __copy_field_to_guest(u_xenpf_op, op, u.read_memtype)
+                  ? -EFAULT : 0;
         }
     }
     break;
@@ -263,8 +265,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             C(legacy_sectors_per_track);
 #undef C
 
-            ret = (copy_field_to_guest(u_xenpf_op, op,
-                                      u.firmware_info.u.disk_info)
+            ret = (__copy_field_to_guest(u_xenpf_op, op,
+                                         u.firmware_info.u.disk_info)
                    ? -EFAULT : 0);
             break;
         }
@@ -281,8 +283,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             op->u.firmware_info.u.disk_mbr_signature.mbr_signature =
                 sig->signature;
 
-            ret = (copy_field_to_guest(u_xenpf_op, op,
-                                      u.firmware_info.u.disk_mbr_signature)
+            ret = (__copy_field_to_guest(u_xenpf_op, op,
+                                         u.firmware_info.u.disk_mbr_signature)
                    ? -EFAULT : 0);
             break;
         }
@@ -299,10 +301,10 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
                 bootsym(boot_edid_caps) >> 8;
 
             ret = 0;
-            if ( copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
-                                     u.vbeddc_info.capabilities) ||
-                 copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
-                                     u.vbeddc_info.edid_transfer_time) ||
+            if ( __copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
+                                       u.vbeddc_info.capabilities) ||
+                 __copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
+                                       u.vbeddc_info.edid_transfer_time) ||
                  copy_to_compat(op->u.firmware_info.u.vbeddc_info.edid,
                                 bootsym(boot_edid_info), 128) )
                 ret = -EFAULT;
@@ -311,8 +313,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             ret = efi_get_info(op->u.firmware_info.index,
                                &op->u.firmware_info.u.efi_info);
             if ( ret == 0 &&
-                 copy_field_to_guest(u_xenpf_op, op,
-                                     u.firmware_info.u.efi_info) )
+                 __copy_field_to_guest(u_xenpf_op, op,
+                                       u.firmware_info.u.efi_info) )
                 ret = -EFAULT;
             break;
         case XEN_FW_KBD_SHIFT_FLAGS:
@@ -323,8 +325,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             op->u.firmware_info.u.kbd_shift_flags = bootsym(kbd_shift_flags);
 
             ret = 0;
-            if ( copy_field_to_guest(u_xenpf_op, op,
-                                     u.firmware_info.u.kbd_shift_flags) )
+            if ( __copy_field_to_guest(u_xenpf_op, op,
+                                       u.firmware_info.u.kbd_shift_flags) )
                 ret = -EFAULT;
             break;
         default:
@@ -340,7 +342,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
 
         ret = efi_runtime_call(&op->u.efi_runtime_call);
         if ( ret == 0 &&
-             copy_field_to_guest(u_xenpf_op, op, u.efi_runtime_call) )
+             __copy_field_to_guest(u_xenpf_op, op, u.efi_runtime_call) )
             ret = -EFAULT;
         break;
 
@@ -412,7 +414,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
             ret = cpumask_to_xenctl_cpumap(&ctlmap, cpumap);
         free_cpumask_var(cpumap);
 
-        if ( ret == 0 && copy_to_guest(u_xenpf_op, op, 1) )
+        if ( ret == 0 && __copy_field_to_guest(u_xenpf_op, op, u.getidletime) )
             ret = -EFAULT;
     }
     break;
@@ -503,7 +505,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
 
         put_cpu_maps();
 
-        ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
+        ret = __copy_field_to_guest(u_xenpf_op, op, u.pcpu_info) ? -EFAULT : 0;
     }
     break;
 
@@ -538,7 +540,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
 
         put_cpu_maps();
 
-        if ( copy_field_to_guest(u_xenpf_op, op, u.pcpu_version) )
+        if ( __copy_field_to_guest(u_xenpf_op, op, u.pcpu_version) )
             ret = -EFAULT;
     }
     break;
@@ -639,7 +641,8 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PA
 
         case XEN_CORE_PARKING_GET:
             op->u.core_parking.idle_nums = get_cur_idle_nums();
-            ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
+            ret = __copy_field_to_guest(u_xenpf_op, op, u.core_parking) ?
+                  -EFAULT : 0;
             break;
 
         default:
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/sysctl.c
--- a/xen/arch/x86/sysctl.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/sysctl.c	Mon Dec 10 11:18:25 2012 +0100
@@ -93,7 +93,7 @@ long arch_do_sysctl(
         if ( iommu_enabled )
             pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm_directio;
 
-        if ( copy_to_guest(u_sysctl, sysctl, 1) )
+        if ( __copy_field_to_guest(u_sysctl, sysctl, u.physinfo) )
             ret = -EFAULT;
     }
     break;
@@ -133,7 +133,8 @@ long arch_do_sysctl(
             }
         }
 
-        ret = ((i <= max_cpu_index) || copy_to_guest(u_sysctl, sysctl, 1))
+        ret = ((i <= max_cpu_index) ||
+               __copy_field_to_guest(u_sysctl, sysctl, u.topologyinfo))
             ? -EFAULT : 0;
     }
     break;
@@ -185,7 +186,8 @@ long arch_do_sysctl(
             }
         }
 
-        ret = ((i <= max_node_index) || copy_to_guest(u_sysctl, sysctl, 1))
+        ret = ((i <= max_node_index) ||
+               __copy_field_to_guest(u_sysctl, sysctl, u.numainfo))
             ? -EFAULT : 0;
     }
     break;
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/mm.c	Mon Dec 10 11:18:25 2012 +0100
@@ -122,7 +122,7 @@ int compat_arch_memory_op(int op, XEN_GU
 #define XLAT_memory_map_HNDL_buffer(_d_, _s_) ((void)0)
         XLAT_memory_map(&cmp, nat);
 #undef XLAT_memory_map_HNDL_buffer
-        if ( copy_to_guest(arg, &cmp, 1) )
+        if ( __copy_to_guest(arg, &cmp, 1) )
             rc = -EFAULT;
 
         break;
@@ -148,7 +148,7 @@ int compat_arch_memory_op(int op, XEN_GU
 
         XLAT_pod_target(&cmp, nat);
 
-        if ( copy_to_guest(arg, &cmp, 1) )
+        if ( __copy_to_guest(arg, &cmp, 1) )
         {
             if ( rc == __HYPERVISOR_memory_op )
                 hypercall_cancel_continuation();
@@ -200,7 +200,7 @@ int compat_arch_memory_op(int op, XEN_GU
         }
 
         xmml.nr_extents = i;
-        if ( copy_to_guest(arg, &xmml, 1) )
+        if ( __copy_to_guest(arg, &xmml, 1) )
             rc = -EFAULT;
 
         break;
@@ -219,7 +219,7 @@ int compat_arch_memory_op(int op, XEN_GU
         if ( copy_from_guest(&meo, arg, 1) )
             return -EFAULT;
         rc = do_mem_event_op(op, meo.domain, (void *) &meo);
-        if ( !rc && copy_to_guest(arg, &meo, 1) )
+        if ( !rc && __copy_to_guest(arg, &meo, 1) )
             return -EFAULT;
         break;
     }
@@ -231,7 +231,7 @@ int compat_arch_memory_op(int op, XEN_GU
         if ( mso.op == XENMEM_sharing_op_audit )
             return mem_sharing_audit(); 
         rc = do_mem_event_op(op, mso.domain, (void *) &mso);
-        if ( !rc && copy_to_guest(arg, &mso, 1) )
+        if ( !rc && __copy_to_guest(arg, &mso, 1) )
             return -EFAULT;
         break;
     }
diff -r efc61beab92a -r 1b72138bddda xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/arch/x86/x86_64/mm.c	Mon Dec 10 11:18:25 2012 +0100
@@ -1074,7 +1074,7 @@ long subarch_memory_op(int op, XEN_GUEST
         }
 
         xmml.nr_extents = i;
-        if ( copy_to_guest(arg, &xmml, 1) )
+        if ( __copy_to_guest(arg, &xmml, 1) )
             return -EFAULT;
 
         break;
@@ -1092,7 +1092,7 @@ long subarch_memory_op(int op, XEN_GUEST
         if ( copy_from_guest(&meo, arg, 1) )
             return -EFAULT;
         rc = do_mem_event_op(op, meo.domain, (void *) &meo);
-        if ( !rc && copy_to_guest(arg, &meo, 1) )
+        if ( !rc && __copy_to_guest(arg, &meo, 1) )
             return -EFAULT;
         break;
     }
@@ -1104,7 +1104,7 @@ long subarch_memory_op(int op, XEN_GUEST
         if ( mso.op == XENMEM_sharing_op_audit )
             return mem_sharing_audit(); 
         rc = do_mem_event_op(op, mso.domain, (void *) &mso);
-        if ( !rc && copy_to_guest(arg, &mso, 1) )
+        if ( !rc && __copy_to_guest(arg, &mso, 1) )
             return -EFAULT;
         break;
     }
diff -r efc61beab92a -r 1b72138bddda xen/common/compat/memory.c
--- a/xen/common/compat/memory.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/compat/memory.c	Mon Dec 10 11:18:25 2012 +0100
@@ -292,8 +292,9 @@ int compat_memory_op(unsigned int cmd, X
             }
 
             cmp.xchg.nr_exchanged = nat.xchg->nr_exchanged;
-            if ( copy_field_to_guest(guest_handle_cast(compat, compat_memory_exchange_t),
-                                     &cmp.xchg, nr_exchanged) )
+            if ( __copy_field_to_guest(guest_handle_cast(compat,
+                                                         compat_memory_exchange_t),
+                                       &cmp.xchg, nr_exchanged) )
                 rc = -EFAULT;
 
             if ( rc < 0 )
diff -r efc61beab92a -r 1b72138bddda xen/common/domctl.c
--- a/xen/common/domctl.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/domctl.c	Mon Dec 10 11:18:25 2012 +0100
@@ -242,6 +242,7 @@ void domctl_lock_release(void)
 long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
+    bool_t copyback = 0;
     struct xen_domctl curop, *op = &curop;
 
     if ( copy_from_guest(op, u_domctl, 1) )
@@ -469,8 +470,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
                sizeof(xen_domain_handle_t));
 
         op->domain = d->domain_id;
-        if ( copy_to_guest(u_domctl, op, 1) )
-            ret = -EFAULT;
+        copyback = 1;
     }
     break;
 
@@ -653,8 +653,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
             goto scheduler_op_out;
 
         ret = sched_adjust(d, &op->u.scheduler_op);
-        if ( copy_to_guest(u_domctl, op, 1) )
-            ret = -EFAULT;
+        copyback = 1;
 
     scheduler_op_out:
         rcu_unlock_domain(d);
@@ -686,8 +685,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         getdomaininfo(d, &op->u.getdomaininfo);
 
         op->domain = op->u.getdomaininfo.domain;
-        if ( copy_to_guest(u_domctl, op, 1) )
-            ret = -EFAULT;
+        copyback = 1;
 
     getdomaininfo_out:
         rcu_read_unlock(&domlist_read_lock);
@@ -747,8 +745,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         ret = copy_to_guest(op->u.vcpucontext.ctxt, c.nat, 1);
 #endif
 
-        if ( copy_to_guest(u_domctl, op, 1) || ret )
+        if ( ret )
             ret = -EFAULT;
+        copyback = 1;
 
     getvcpucontext_out:
         xfree(c.nat);
@@ -786,9 +785,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         op->u.getvcpuinfo.cpu_time = runstate.time[RUNSTATE_running];
         op->u.getvcpuinfo.cpu      = v->processor;
         ret = 0;
-
-        if ( copy_to_guest(u_domctl, op, 1) )
-            ret = -EFAULT;
+        copyback = 1;
 
     getvcpuinfo_out:
         rcu_unlock_domain(d);
@@ -1045,6 +1042,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     domctl_lock_release();
 
+    if ( copyback && __copy_to_guest(u_domctl, op, 1) )
+        ret = -EFAULT;
+
     return ret;
 }
 
diff -r efc61beab92a -r 1b72138bddda xen/common/event_channel.c
--- a/xen/common/event_channel.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/event_channel.c	Mon Dec 10 11:18:25 2012 +0100
@@ -981,7 +981,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&alloc_unbound, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_alloc_unbound(&alloc_unbound);
-        if ( (rc == 0) && (copy_to_guest(arg, &alloc_unbound, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &alloc_unbound, 1) )
             rc = -EFAULT; /* Cleaning up here would be a mess! */
         break;
     }
@@ -991,7 +991,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&bind_interdomain, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_bind_interdomain(&bind_interdomain);
-        if ( (rc == 0) && (copy_to_guest(arg, &bind_interdomain, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &bind_interdomain, 1) )
             rc = -EFAULT; /* Cleaning up here would be a mess! */
         break;
     }
@@ -1001,7 +1001,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&bind_virq, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_bind_virq(&bind_virq);
-        if ( (rc == 0) && (copy_to_guest(arg, &bind_virq, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &bind_virq, 1) )
             rc = -EFAULT; /* Cleaning up here would be a mess! */
         break;
     }
@@ -1011,7 +1011,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&bind_ipi, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_bind_ipi(&bind_ipi);
-        if ( (rc == 0) && (copy_to_guest(arg, &bind_ipi, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &bind_ipi, 1) )
             rc = -EFAULT; /* Cleaning up here would be a mess! */
         break;
     }
@@ -1021,7 +1021,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&bind_pirq, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_bind_pirq(&bind_pirq);
-        if ( (rc == 0) && (copy_to_guest(arg, &bind_pirq, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &bind_pirq, 1) )
             rc = -EFAULT; /* Cleaning up here would be a mess! */
         break;
     }
@@ -1047,7 +1047,7 @@ long do_event_channel_op(int cmd, XEN_GU
         if ( copy_from_guest(&status, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_status(&status);
-        if ( (rc == 0) && (copy_to_guest(arg, &status, 1) != 0) )
+        if ( !rc && __copy_to_guest(arg, &status, 1) )
             rc = -EFAULT;
         break;
     }
diff -r efc61beab92a -r 1b72138bddda xen/common/grant_table.c
--- a/xen/common/grant_table.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/grant_table.c	Mon Dec 10 11:18:25 2012 +0100
@@ -1115,12 +1115,13 @@ gnttab_unmap_grant_ref(
 
         for ( i = 0; i < c; i++ )
         {
-            if ( unlikely(__copy_from_guest_offset(&op, uop, done+i, 1)) )
+            if ( unlikely(__copy_from_guest(&op, uop, 1)) )
                 goto fault;
             __gnttab_unmap_grant_ref(&op, &(common[i]));
             ++partial_done;
-            if ( unlikely(__copy_to_guest_offset(uop, done+i, &op, 1)) )
+            if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
                 goto fault;
+            guest_handle_add_offset(uop, 1);
         }
 
         flush_tlb_mask(current->domain->domain_dirty_cpumask);
@@ -1177,12 +1178,13 @@ gnttab_unmap_and_replace(
         
         for ( i = 0; i < c; i++ )
         {
-            if ( unlikely(__copy_from_guest_offset(&op, uop, done+i, 1)) )
+            if ( unlikely(__copy_from_guest(&op, uop, 1)) )
                 goto fault;
             __gnttab_unmap_and_replace(&op, &(common[i]));
             ++partial_done;
-            if ( unlikely(__copy_to_guest_offset(uop, done+i, &op, 1)) )
+            if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
                 goto fault;
+            guest_handle_add_offset(uop, 1);
         }
         
         flush_tlb_mask(current->domain->domain_dirty_cpumask);
@@ -1396,7 +1398,7 @@ gnttab_setup_table(
  out2:
     rcu_unlock_domain(d);
  out1:
-    if ( unlikely(copy_to_guest(uop, &op, 1)) )
+    if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
         return -EFAULT;
 
     return 0;
@@ -1446,7 +1448,7 @@ gnttab_query_size(
     rcu_unlock_domain(d);
 
  query_out:
-    if ( unlikely(copy_to_guest(uop, &op, 1)) )
+    if ( unlikely(__copy_to_guest(uop, &op, 1)) )
         return -EFAULT;
 
     return 0;
@@ -1542,7 +1544,7 @@ gnttab_transfer(
             return i;
 
         /* Read from caller address space. */
-        if ( unlikely(__copy_from_guest_offset(&gop, uop, i, 1)) )
+        if ( unlikely(__copy_from_guest(&gop, uop, 1)) )
         {
             gdprintk(XENLOG_INFO, "gnttab_transfer: error reading req %d/%d\n",
                     i, count);
@@ -1701,12 +1703,13 @@ gnttab_transfer(
         gop.status = GNTST_okay;
 
     copyback:
-        if ( unlikely(__copy_to_guest_offset(uop, i, &gop, 1)) )
+        if ( unlikely(__copy_field_to_guest(uop, &gop, status)) )
         {
             gdprintk(XENLOG_INFO, "gnttab_transfer: error writing resp "
                      "%d/%d\n", i, count);
             return -EFAULT;
         }
+        guest_handle_add_offset(uop, 1);
     }
 
     return 0;
@@ -2143,17 +2146,18 @@ gnttab_copy(
     {
         if (i && hypercall_preempt_check())
             return i;
-        if ( unlikely(__copy_from_guest_offset(&op, uop, i, 1)) )
+        if ( unlikely(__copy_from_guest(&op, uop, 1)) )
             return -EFAULT;
         __gnttab_copy(&op);
-        if ( unlikely(__copy_to_guest_offset(uop, i, &op, 1)) )
+        if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
             return -EFAULT;
+        guest_handle_add_offset(uop, 1);
     }
     return 0;
 }
 
 static long
-gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t uop))
+gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t) uop)
 {
     gnttab_set_version_t op;
     struct domain *d = current->domain;
@@ -2265,7 +2269,7 @@ out_unlock:
 out:
     op.version = gt->gt_version;
 
-    if (copy_to_guest(uop, &op, 1))
+    if (__copy_to_guest(uop, &op, 1))
         res = -EFAULT;
 
     return res;
@@ -2329,14 +2333,14 @@ gnttab_get_status_frames(XEN_GUEST_HANDL
 out2:
     rcu_unlock_domain(d);
 out1:
-    if ( unlikely(copy_to_guest(uop, &op, 1)) )
+    if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
         return -EFAULT;
 
     return 0;
 }
 
 static long
-gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t uop))
+gnttab_get_version(XEN_GUEST_HANDLE_PARAM(gnttab_get_version_t) uop)
 {
     gnttab_get_version_t op;
     struct domain *d;
@@ -2359,7 +2363,7 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARA
 
     rcu_unlock_domain(d);
 
-    if ( copy_to_guest(uop, &op, 1) )
+    if ( __copy_field_to_guest(uop, &op, version) )
         return -EFAULT;
 
     return 0;
@@ -2421,7 +2425,7 @@ out:
 }
 
 static long
-gnttab_swap_grant_ref(XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t uop),
+gnttab_swap_grant_ref(XEN_GUEST_HANDLE_PARAM(gnttab_swap_grant_ref_t) uop,
                       unsigned int count)
 {
     int i;
@@ -2431,11 +2435,12 @@ gnttab_swap_grant_ref(XEN_GUEST_HANDLE_P
     {
         if ( i && hypercall_preempt_check() )
             return i;
-        if ( unlikely(__copy_from_guest_offset(&op, uop, i, 1)) )
+        if ( unlikely(__copy_from_guest(&op, uop, 1)) )
             return -EFAULT;
         op.status = __gnttab_swap_grant_ref(op.ref_a, op.ref_b);
-        if ( unlikely(__copy_to_guest_offset(uop, i, &op, 1)) )
+        if ( unlikely(__copy_field_to_guest(uop, &op, status)) )
             return -EFAULT;
+        guest_handle_add_offset(uop, 1);
     }
     return 0;
 }
diff -r efc61beab92a -r 1b72138bddda xen/common/memory.c
--- a/xen/common/memory.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/memory.c	Mon Dec 10 11:18:25 2012 +0100
@@ -359,7 +359,7 @@ static long memory_exchange(XEN_GUEST_HA
         {
             exch.nr_exchanged = i << in_chunk_order;
             rcu_unlock_domain(d);
-            if ( copy_field_to_guest(arg, &exch, nr_exchanged) )
+            if ( __copy_field_to_guest(arg, &exch, nr_exchanged) )
                 return -EFAULT;
             return hypercall_create_continuation(
                 __HYPERVISOR_memory_op, "lh", XENMEM_exchange, arg);
@@ -500,7 +500,7 @@ static long memory_exchange(XEN_GUEST_HA
     }
 
     exch.nr_exchanged = exch.in.nr_extents;
-    if ( copy_field_to_guest(arg, &exch, nr_exchanged) )
+    if ( __copy_field_to_guest(arg, &exch, nr_exchanged) )
         rc = -EFAULT;
     rcu_unlock_domain(d);
     return rc;
@@ -527,7 +527,7 @@ static long memory_exchange(XEN_GUEST_HA
     exch.nr_exchanged = i << in_chunk_order;
 
  fail_early:
-    if ( copy_field_to_guest(arg, &exch, nr_exchanged) )
+    if ( __copy_field_to_guest(arg, &exch, nr_exchanged) )
         rc = -EFAULT;
     return rc;
 }
diff -r efc61beab92a -r 1b72138bddda xen/common/sysctl.c
--- a/xen/common/sysctl.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/sysctl.c	Mon Dec 10 11:18:25 2012 +0100
@@ -30,6 +30,7 @@
 long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
     long ret = 0;
+    int copyback = -1;
     struct xen_sysctl curop, *op = &curop;
     static DEFINE_SPINLOCK(sysctl_lock);
 
@@ -55,42 +56,28 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
     switch ( op->cmd )
     {
     case XEN_SYSCTL_readconsole:
-    {
         ret = xsm_readconsole(op->u.readconsole.clear);
         if ( ret )
             break;
 
         ret = read_console_ring(&op->u.readconsole);
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
 
     case XEN_SYSCTL_tbuf_op:
-    {
         ret = xsm_tbufcontrol();
         if ( ret )
             break;
 
         ret = tb_control(&op->u.tbuf_op);
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
     
     case XEN_SYSCTL_sched_id:
-    {
         ret = xsm_sched_id();
         if ( ret )
             break;
 
         op->u.sched_id.sched_id = sched_id();
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-        else
-            ret = 0;
-    }
-    break;
+        break;
 
     case XEN_SYSCTL_getdomaininfolist:
     { 
@@ -129,38 +116,27 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
             break;
         
         op->u.getdomaininfolist.num_domains = num_domains;
-
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
     }
     break;
 
 #ifdef PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
-    {
         ret = xsm_perfcontrol();
         if ( ret )
             break;
 
         ret = perfc_control(&op->u.perfc_op);
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
 #endif
 
 #ifdef LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
-    {
         ret = xsm_lockprof();
         if ( ret )
             break;
 
         ret = spinlock_profile_control(&op->u.lockprof_op);
-        if ( copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
 #endif
     case XEN_SYSCTL_debug_keys:
     {
@@ -179,6 +155,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
             handle_keypress(c, guest_cpu_user_regs());
         }
         ret = 0;
+        copyback = 0;
     }
     break;
 
@@ -193,22 +170,21 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
         if ( ret )
             break;
 
+        ret = -EFAULT;
         for ( i = 0; i < nr_cpus; i++ )
         {
             cpuinfo.idletime = get_cpu_idle_time(i);
 
-            ret = -EFAULT;
             if ( copy_to_guest_offset(op->u.getcpuinfo.info, i, &cpuinfo, 1) )
                 goto out;
         }
 
         op->u.getcpuinfo.nr_cpus = i;
-        ret = copy_to_guest(u_sysctl, op, 1) ? -EFAULT : 0;
+        ret = 0;
     }
     break;
 
     case XEN_SYSCTL_availheap:
-    { 
         ret = xsm_availheap();
         if ( ret )
             break;
@@ -218,47 +194,26 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
             op->u.availheap.min_bitwidth,
             op->u.availheap.max_bitwidth);
         op->u.availheap.avail_bytes <<= PAGE_SHIFT;
-
-        ret = copy_to_guest(u_sysctl, op, 1) ? -EFAULT : 0;
-    }
-    break;
+        break;
 
 #ifdef HAS_ACPI
     case XEN_SYSCTL_get_pmstat:
-    {
         ret = xsm_get_pmstat();
         if ( ret )
             break;
 
         ret = do_get_pm_info(&op->u.get_pmstat);
-        if ( ret )
-            break;
-
-        if ( copy_to_guest(u_sysctl, op, 1) )
-        {
-            ret = -EFAULT;
-            break;
-        }
-    }
-    break;
+        break;
 
     case XEN_SYSCTL_pm_op:
-    {
         ret = xsm_pm_op();
         if ( ret )
             break;
 
         ret = do_pm_op(&op->u.pm_op);
-        if ( ret && (ret != -EAGAIN) )
-            break;
-
-        if ( copy_to_guest(u_sysctl, op, 1) )
-        {
-            ret = -EFAULT;
-            break;
-        }
-    }
-    break;
+        if ( ret == -EAGAIN )
+            copyback = 1;
+        break;
 #endif
 
     case XEN_SYSCTL_page_offline_op:
@@ -317,41 +272,39 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
         }
 
         xfree(status);
+        copyback = 0;
     }
     break;
 
     case XEN_SYSCTL_cpupool_op:
-    {
         ret = xsm_cpupool_op();
         if ( ret )
             break;
 
         ret = cpupool_do_sysctl(&op->u.cpupool_op);
-        if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
 
     case XEN_SYSCTL_scheduler_op:
-    {
         ret = xsm_sched_op();
         if ( ret )
             break;
 
         ret = sched_adjust_global(&op->u.scheduler_op);
-        if ( (ret == 0) && copy_to_guest(u_sysctl, op, 1) )
-            ret = -EFAULT;
-    }
-    break;
+        break;
 
     default:
         ret = arch_do_sysctl(op, u_sysctl);
+        copyback = 0;
         break;
     }
 
  out:
     spin_unlock(&sysctl_lock);
 
+    if ( copyback && (!ret || copyback > 0) &&
+         __copy_to_guest(u_sysctl, op, 1) )
+        ret = -EFAULT;
+
     return ret;
 }
 
diff -r efc61beab92a -r 1b72138bddda xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/common/xenoprof.c	Mon Dec 10 11:18:25 2012 +0100
@@ -449,7 +449,7 @@ static int add_passive_list(XEN_GUEST_HA
             current->domain, __pa(d->xenoprof->rawbuf),
             passive.buf_gmaddr, d->xenoprof->npages);
 
-    if ( copy_to_guest(arg, &passive, 1) )
+    if ( __copy_to_guest(arg, &passive, 1) )
     {
         put_domain(d);
         return -EFAULT;
@@ -604,7 +604,7 @@ static int xenoprof_op_init(XEN_GUEST_HA
     if ( xenoprof_init.is_primary )
         xenoprof_primary_profiler = current->domain;
 
-    return (copy_to_guest(arg, &xenoprof_init, 1) ? -EFAULT : 0);
+    return __copy_to_guest(arg, &xenoprof_init, 1) ? -EFAULT : 0;
 }
 
 #define ret_t long
@@ -651,10 +651,7 @@ static int xenoprof_op_get_buffer(XEN_GU
             d, __pa(d->xenoprof->rawbuf), xenoprof_get_buffer.buf_gmaddr,
             d->xenoprof->npages);
 
-    if ( copy_to_guest(arg, &xenoprof_get_buffer, 1) )
-        return -EFAULT;
-
-    return 0;
+    return __copy_to_guest(arg, &xenoprof_get_buffer, 1) ? -EFAULT : 0;
 }
 
 #define NONPRIV_OP(op) ( (op == XENOPROF_init)          \
diff -r efc61beab92a -r 1b72138bddda xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Mon Dec 10 11:16:37 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Mon Dec 10 11:18:25 2012 +0100
@@ -586,7 +586,7 @@ int iommu_do_domctl(
             domctl->u.get_device_group.num_sdevs = ret;
             ret = 0;
         }
-        if ( copy_to_guest(u_domctl, domctl, 1) )
+        if ( __copy_field_to_guest(u_domctl, domctl, u.get_device_group) )
             ret = -EFAULT;
         rcu_unlock_domain(d);
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHXF-00080G-1b; Tue, 11 Dec 2012 04:33:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHXD-0007wy-OP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:35 +0000
Received: from [85.158.137.99:5147] by server-15.bemta-3.messagelabs.com id
	27/3E-23779-A97B6C05; Tue, 11 Dec 2012 04:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1355200408!13914975!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25766 invoked from network); 11 Dec 2012 04:33:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX6-0003JL-P8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX6-0007GH-Nm
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:28 +0000
Message-Id: <E1TiHX6-0007GH-Nm@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: reserve next two XENMEM_ op
	numbers for future/out-of-tree use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1355138177 0
# Node ID 03cb71bc32f95b4029843e0254b4448e0c6a817a
# Parent  21a5b181f8adef6c5f840ee8453de96b340021e3
xen: reserve next two XENMEM_ op numbers for future/out-of-tree use

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 21a5b181f8ad -r 03cb71bc32f9 xen/include/public/memory.h
--- a/xen/include/public/memory.h	Mon Dec 10 11:15:53 2012 +0000
+++ b/xen/include/public/memory.h	Mon Dec 10 11:16:17 2012 +0000
@@ -421,6 +421,12 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
 
+/*
+ * Reserve ops for future/out-of-tree "claim" patches (Oracle)
+ */
+#define XENMEM_claim_pages                  24
+#define XENMEM_get_unclaimed_pages          25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHXF-00080U-46; Tue, 11 Dec 2012 04:33:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHXE-0007xY-4d
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:36 +0000
Received: from [193.109.254.147:17127] by server-15.bemta-14.messagelabs.com
	id B1/9F-12105-F97B6C05; Tue, 11 Dec 2012 04:33:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1355200400!9660595!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19016 invoked from network); 11 Dec 2012 04:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWy-0003IT-Mv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWy-0007C8-L3
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:20 +0000
Message-Id: <E1TiHWy-0007C8-L3@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable IA32E mode while
	do VM entry
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813046 0
# Node ID 1ed1507fa0407f1da715d04fe1b510e81ca4fb31
# Parent  e6eb1e52da7cfcb1a7697b35b4d842f35107d1ed
nested vmx: enable IA32E mode while do VM entry

Some VMMs may check the platform capability to judge whether long
mode guest is supported. Therefore we need to expose this bit to
guest VMM.

Xen on Xen works fine in current solution because Xen doesn't
check this capability but directly set it in VMCS if guest
supports long mode.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r e6eb1e52da7c -r 1ed1507fa040 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:56:49 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:57:26 2012 +0000
@@ -1376,7 +1376,8 @@ int nvmx_msr_read_intercept(unsigned int
         tmp = VMX_ENTRY_CTLS_DEFAULT1;
         data = VM_ENTRY_LOAD_GUEST_PAT |
                VM_ENTRY_LOAD_GUEST_EFER |
-               VM_ENTRY_LOAD_PERF_GLOBAL_CTRL;
+               VM_ENTRY_LOAD_PERF_GLOBAL_CTRL |
+               VM_ENTRY_IA32E_MODE;
         data = ((data | tmp) << 32) | tmp;
         break;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHXF-00080G-1b; Tue, 11 Dec 2012 04:33:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHXD-0007wy-OP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:35 +0000
Received: from [85.158.137.99:5147] by server-15.bemta-3.messagelabs.com id
	27/3E-23779-A97B6C05; Tue, 11 Dec 2012 04:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-217.messagelabs.com!1355200408!13914975!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25766 invoked from network); 11 Dec 2012 04:33:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX6-0003JL-P8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX6-0007GH-Nm
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:28 +0000
Message-Id: <E1TiHX6-0007GH-Nm@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: reserve next two XENMEM_ op
	numbers for future/out-of-tree use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1355138177 0
# Node ID 03cb71bc32f95b4029843e0254b4448e0c6a817a
# Parent  21a5b181f8adef6c5f840ee8453de96b340021e3
xen: reserve next two XENMEM_ op numbers for future/out-of-tree use

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 21a5b181f8ad -r 03cb71bc32f9 xen/include/public/memory.h
--- a/xen/include/public/memory.h	Mon Dec 10 11:15:53 2012 +0000
+++ b/xen/include/public/memory.h	Mon Dec 10 11:16:17 2012 +0000
@@ -421,6 +421,12 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
 
+/*
+ * Reserve ops for future/out-of-tree "claim" patches (Oracle)
+ */
+#define XENMEM_claim_pages                  24
+#define XENMEM_get_unclaimed_pages          25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHXF-00080U-46; Tue, 11 Dec 2012 04:33:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHXE-0007xY-4d
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:36 +0000
Received: from [193.109.254.147:17127] by server-15.bemta-14.messagelabs.com
	id B1/9F-12105-F97B6C05; Tue, 11 Dec 2012 04:33:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1355200400!9660595!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19016 invoked from network); 11 Dec 2012 04:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWy-0003IT-Mv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWy-0007C8-L3
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:20 +0000
Message-Id: <E1TiHWy-0007C8-L3@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: enable IA32E mode while
	do VM entry
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1354813046 0
# Node ID 1ed1507fa0407f1da715d04fe1b510e81ca4fb31
# Parent  e6eb1e52da7cfcb1a7697b35b4d842f35107d1ed
nested vmx: enable IA32E mode while do VM entry

Some VMMs may check the platform capability to judge whether long
mode guest is supported. Therefore we need to expose this bit to
guest VMM.

Xen on Xen works fine in current solution because Xen doesn't
check this capability but directly set it in VMCS if guest
supports long mode.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r e6eb1e52da7c -r 1ed1507fa040 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:56:49 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Thu Dec 06 16:57:26 2012 +0000
@@ -1376,7 +1376,8 @@ int nvmx_msr_read_intercept(unsigned int
         tmp = VMX_ENTRY_CTLS_DEFAULT1;
         data = VM_ENTRY_LOAD_GUEST_PAT |
                VM_ENTRY_LOAD_GUEST_EFER |
-               VM_ENTRY_LOAD_PERF_GLOBAL_CTRL;
+               VM_ENTRY_LOAD_PERF_GLOBAL_CTRL |
+               VM_ENTRY_IA32E_MODE;
         data = ((data | tmp) << 32) | tmp;
         break;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHXG-00082n-7I; Tue, 11 Dec 2012 04:33:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHXF-00080E-Fv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:37 +0000
Received: from [193.109.254.147:17178] by server-14.bemta-14.messagelabs.com
	id FA/07-14517-0A7B6C05; Tue, 11 Dec 2012 04:33:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1355200414!6970471!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29894 invoked from network); 11 Dec 2012 04:33:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX6-0003JH-8p
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX6-0007Fh-6w
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:28 +0000
Message-Id: <E1TiHX6-0007Fh-6w@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: centralize accounting for
	domain tot_pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1355138153 0
# Node ID 21a5b181f8adef6c5f840ee8453de96b340021e3
# Parent  1b72138bddda1982f064f6411d3e4ff9400bd1bd
xen: centralize accounting for domain tot_pages

Provide and use a common function for all adjustments to a
domain's tot_pages counter in anticipation of future and/or
out-of-tree patches that must adjust related counters
atomically.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 1b72138bddda -r 21a5b181f8ad xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/arch/x86/mm.c	Mon Dec 10 11:15:53 2012 +0000
@@ -3843,7 +3843,7 @@ int donate_page(
     {
         if ( d->tot_pages >= d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_adjust_tot_pages(d, 1);
     }
 
     page->count_info = PGC_allocated | 1;
@@ -3893,7 +3893,7 @@ int steal_page(
     } while ( (y = cmpxchg(&page->count_info, x, x | 1)) != x );
 
     /* Unlink from original owner. */
-    if ( !(memflags & MEMF_no_refcount) && !--d->tot_pages )
+    if ( !(memflags & MEMF_no_refcount) && !domain_adjust_tot_pages(d, -1) )
         drop_dom_ref = 1;
     page_list_del(page, &d->page_list);
 
diff -r 1b72138bddda -r 21a5b181f8ad xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/arch/x86/mm/mem_sharing.c	Mon Dec 10 11:15:53 2012 +0000
@@ -639,7 +639,7 @@ static int page_make_sharable(struct dom
     }
 
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_adjust_tot_pages(d, -1);
     drop_dom_ref = (d->tot_pages == 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct doma
     ASSERT(page_get_owner(page) == dom_cow);
     page_set_owner(page, d);
 
-    if ( d->tot_pages++ == 0 )
+    if ( domain_adjust_tot_pages(d, 1) == 1 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff -r 1b72138bddda -r 21a5b181f8ad xen/common/grant_table.c
--- a/xen/common/grant_table.c	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/common/grant_table.c	Mon Dec 10 11:15:53 2012 +0000
@@ -1667,7 +1667,7 @@ gnttab_transfer(
         }
 
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ == 0) )
+        if ( unlikely(domain_adjust_tot_pages(e, 1) == 1) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff -r 1b72138bddda -r 21a5b181f8ad xen/common/memory.c
--- a/xen/common/memory.c	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/common/memory.c	Mon Dec 10 11:15:53 2012 +0000
@@ -465,7 +465,7 @@ static long memory_exchange(XEN_GUEST_HA
                              (j * (1UL << exch.out.extent_order)));
 
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -= dec_count;
+                domain_adjust_tot_pages(d, -dec_count);
                 drop_dom_ref = (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
 
diff -r 1b72138bddda -r 21a5b181f8ad xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/common/page_alloc.c	Mon Dec 10 11:15:53 2012 +0000
@@ -239,6 +239,12 @@ static long midsize_alloc_zone_pages;
 
 static DEFINE_SPINLOCK(heap_lock);
 
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    return d->tot_pages += pages;
+}
+
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
 {
@@ -1291,7 +1297,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages == 0) )
             get_knownalive_domain(d);
 
-        d->tot_pages += 1 << order;
+        domain_adjust_tot_pages(d, 1 << order);
     }
 
     for ( i = 0; i < (1 << order); i++ )
@@ -1375,7 +1381,7 @@ void free_domheap_pages(struct page_info
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
 
-        d->tot_pages -= 1 << order;
+        domain_adjust_tot_pages(d, -(1 << order));
         drop_dom_ref = (d->tot_pages == 0);
 
         spin_unlock_recursive(&d->page_alloc_lock);
diff -r 1b72138bddda -r 21a5b181f8ad xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/include/xen/mm.h	Mon Dec 10 11:15:53 2012 +0000
@@ -48,6 +48,8 @@ void free_xenheap_pages(void *v, unsigne
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
 
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:33:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHXG-00082n-7I; Tue, 11 Dec 2012 04:33:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHXF-00080E-Fv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:37 +0000
Received: from [193.109.254.147:17178] by server-14.bemta-14.messagelabs.com
	id FA/07-14517-0A7B6C05; Tue, 11 Dec 2012 04:33:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1355200414!6970471!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29894 invoked from network); 11 Dec 2012 04:33:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX6-0003JH-8p
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHX6-0007Fh-6w
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:28 +0000
Message-Id: <E1TiHX6-0007Fh-6w@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: centralize accounting for
	domain tot_pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dan Magenheimer <dan.magenheimer@oracle.com>
# Date 1355138153 0
# Node ID 21a5b181f8adef6c5f840ee8453de96b340021e3
# Parent  1b72138bddda1982f064f6411d3e4ff9400bd1bd
xen: centralize accounting for domain tot_pages

Provide and use a common function for all adjustments to a
domain's tot_pages counter in anticipation of future and/or
out-of-tree patches that must adjust related counters
atomically.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 1b72138bddda -r 21a5b181f8ad xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/arch/x86/mm.c	Mon Dec 10 11:15:53 2012 +0000
@@ -3843,7 +3843,7 @@ int donate_page(
     {
         if ( d->tot_pages >= d->max_pages )
             goto fail;
-        d->tot_pages++;
+        domain_adjust_tot_pages(d, 1);
     }
 
     page->count_info = PGC_allocated | 1;
@@ -3893,7 +3893,7 @@ int steal_page(
     } while ( (y = cmpxchg(&page->count_info, x, x | 1)) != x );
 
     /* Unlink from original owner. */
-    if ( !(memflags & MEMF_no_refcount) && !--d->tot_pages )
+    if ( !(memflags & MEMF_no_refcount) && !domain_adjust_tot_pages(d, -1) )
         drop_dom_ref = 1;
     page_list_del(page, &d->page_list);
 
diff -r 1b72138bddda -r 21a5b181f8ad xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/arch/x86/mm/mem_sharing.c	Mon Dec 10 11:15:53 2012 +0000
@@ -639,7 +639,7 @@ static int page_make_sharable(struct dom
     }
 
     page_set_owner(page, dom_cow);
-    d->tot_pages--;
+    domain_adjust_tot_pages(d, -1);
     drop_dom_ref = (d->tot_pages == 0);
     page_list_del(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
@@ -680,7 +680,7 @@ static int page_make_private(struct doma
     ASSERT(page_get_owner(page) == dom_cow);
     page_set_owner(page, d);
 
-    if ( d->tot_pages++ == 0 )
+    if ( domain_adjust_tot_pages(d, 1) == 1 )
         get_domain(d);
     page_list_add_tail(page, &d->page_list);
     spin_unlock(&d->page_alloc_lock);
diff -r 1b72138bddda -r 21a5b181f8ad xen/common/grant_table.c
--- a/xen/common/grant_table.c	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/common/grant_table.c	Mon Dec 10 11:15:53 2012 +0000
@@ -1667,7 +1667,7 @@ gnttab_transfer(
         }
 
         /* Okay, add the page to 'e'. */
-        if ( unlikely(e->tot_pages++ == 0) )
+        if ( unlikely(domain_adjust_tot_pages(e, 1) == 1) )
             get_knownalive_domain(e);
         page_list_add_tail(page, &e->page_list);
         page_set_owner(page, e);
diff -r 1b72138bddda -r 21a5b181f8ad xen/common/memory.c
--- a/xen/common/memory.c	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/common/memory.c	Mon Dec 10 11:15:53 2012 +0000
@@ -465,7 +465,7 @@ static long memory_exchange(XEN_GUEST_HA
                              (j * (1UL << exch.out.extent_order)));
 
                 spin_lock(&d->page_alloc_lock);
-                d->tot_pages -= dec_count;
+                domain_adjust_tot_pages(d, -dec_count);
                 drop_dom_ref = (dec_count && !d->tot_pages);
                 spin_unlock(&d->page_alloc_lock);
 
diff -r 1b72138bddda -r 21a5b181f8ad xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/common/page_alloc.c	Mon Dec 10 11:15:53 2012 +0000
@@ -239,6 +239,12 @@ static long midsize_alloc_zone_pages;
 
 static DEFINE_SPINLOCK(heap_lock);
 
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages)
+{
+    ASSERT(spin_is_locked(&d->page_alloc_lock));
+    return d->tot_pages += pages;
+}
+
 static unsigned long init_node_heap(int node, unsigned long mfn,
                                     unsigned long nr, bool_t *use_tail)
 {
@@ -1291,7 +1297,7 @@ int assign_pages(
         if ( unlikely(d->tot_pages == 0) )
             get_knownalive_domain(d);
 
-        d->tot_pages += 1 << order;
+        domain_adjust_tot_pages(d, 1 << order);
     }
 
     for ( i = 0; i < (1 << order); i++ )
@@ -1375,7 +1381,7 @@ void free_domheap_pages(struct page_info
             page_list_del2(&pg[i], &d->page_list, &d->arch.relmem_list);
         }
 
-        d->tot_pages -= 1 << order;
+        domain_adjust_tot_pages(d, -(1 << order));
         drop_dom_ref = (d->tot_pages == 0);
 
         spin_unlock_recursive(&d->page_alloc_lock);
diff -r 1b72138bddda -r 21a5b181f8ad xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Mon Dec 10 11:18:25 2012 +0100
+++ b/xen/include/xen/mm.h	Mon Dec 10 11:15:53 2012 +0000
@@ -48,6 +48,8 @@ void free_xenheap_pages(void *v, unsigne
 #define alloc_xenheap_page() (alloc_xenheap_pages(0,0))
 #define free_xenheap_page(v) (free_xenheap_pages(v,0))
 
+unsigned long domain_adjust_tot_pages(struct domain *d, long pages);
+
 /* Domain suballocator. These functions are *not* interrupt-safe.*/
 void init_domheap_pages(paddr_t ps, paddr_t pe);
 struct page_info *alloc_domheap_pages(

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:34:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHY8-0000AH-CK; Tue, 11 Dec 2012 04:34:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHY7-00009h-4G
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:34:31 +0000
Received: from [85.158.139.83:10429] by server-10.bemta-5.messagelabs.com id
	63/85-13383-6D7B6C05; Tue, 11 Dec 2012 04:34:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1355200468!25270325!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18579 invoked from network); 11 Dec 2012 04:34:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:34:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWt-0003Hz-Gv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWt-00079i-CX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:15 +0000
Message-Id: <E1TiHWt-00079i-CX@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HVM: remove dead code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354799631 -3600
# Node ID 8f7bb944bcb6f736db8a9562e904628ec4629f67
# Parent  42b22e498d0e7e1345966c018bd18a83c067aa4b
x86/HVM: remove dead code

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 42b22e498d0e -r 8f7bb944bcb6 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Dec 06 14:13:10 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Thu Dec 06 14:13:51 2012 +0100
@@ -2460,9 +2460,7 @@ static enum hvm_copy_result __hvm_copy(
             return HVMCOPY_unhandleable;
         }
         if ( !page )
-        {
             return HVMCOPY_bad_gfn_to_mfn;
-        }
 
         p = (char *)__map_domain_page(page) + (addr & ~PAGE_MASK);
 
@@ -2560,11 +2558,7 @@ static enum hvm_copy_result __hvm_clear(
             return HVMCOPY_unhandleable;
         }
         if ( !page )
-        {
-            if ( page )
-                put_page(page);
             return HVMCOPY_bad_gfn_to_mfn;
-        }
 
         p = (char *)__map_domain_page(page) + (addr & ~PAGE_MASK);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 04:34:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 04:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiHY8-0000AH-CK; Tue, 11 Dec 2012 04:34:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHY7-00009h-4G
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:34:31 +0000
Received: from [85.158.139.83:10429] by server-10.bemta-5.messagelabs.com id
	63/85-13383-6D7B6C05; Tue, 11 Dec 2012 04:34:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1355200468!25270325!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18579 invoked from network); 11 Dec 2012 04:34:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 04:34:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWt-0003Hz-Gv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiHWt-00079i-CX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 04:33:15 +0000
Message-Id: <E1TiHWt-00079i-CX@xenbits.xen.org>
Date: Tue, 11 Dec 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/HVM: remove dead code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354799631 -3600
# Node ID 8f7bb944bcb6f736db8a9562e904628ec4629f67
# Parent  42b22e498d0e7e1345966c018bd18a83c067aa4b
x86/HVM: remove dead code

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 42b22e498d0e -r 8f7bb944bcb6 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Dec 06 14:13:10 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Thu Dec 06 14:13:51 2012 +0100
@@ -2460,9 +2460,7 @@ static enum hvm_copy_result __hvm_copy(
             return HVMCOPY_unhandleable;
         }
         if ( !page )
-        {
             return HVMCOPY_bad_gfn_to_mfn;
-        }
 
         p = (char *)__map_domain_page(page) + (addr & ~PAGE_MASK);
 
@@ -2560,11 +2558,7 @@ static enum hvm_copy_result __hvm_clear(
             return HVMCOPY_unhandleable;
         }
         if ( !page )
-        {
-            if ( page )
-                put_page(page);
             return HVMCOPY_bad_gfn_to_mfn;
-        }
 
         p = (char *)__map_domain_page(page) + (addr & ~PAGE_MASK);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 11:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 11:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiOQi-00082G-Me; Tue, 11 Dec 2012 11:55:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQh-00081m-NN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:19 +0000
Received: from [85.158.139.211:25146] by server-4.bemta-5.messagelabs.com id
	1F/33-14693-62F17C05; Tue, 11 Dec 2012 11:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1355226917!19531089!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29068 invoked from network); 11 Dec 2012 11:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 11:55:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQe-000082-TK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQe-0002JM-Qs
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:16 +0000
Message-Id: <E1TiOQe-0002JM-Qs@xenbits.xen.org>
Date: Tue, 11 Dec 2012 11:55:16 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Kouya Shimura <kouya@jp.fujitsu.com>
# Date 1354788718 -3600
# Node ID 1206a35266733ee3dcca1a9f4d341a4b98d1e49d
# Parent  8194979b8104f8a2f539dc5289bb2316fcdbf571
x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26203:b5cb6cccc32c
xen-unstable date: Thu Nov 29 11:01:00 UTC 2012
---


diff -r 8194979b8104 -r 1206a3526673 xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Dec 06 11:10:15 2012 +0100
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Dec 06 11:11:58 2012 +0100
@@ -686,6 +686,9 @@ void hap_teardown(struct domain *d)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
+    xfree(d->arch.hvm_domain.dirty_vram);
+    d->arch.hvm_domain.dirty_vram = NULL;
+
     paging_unlock(d);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 11:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 11:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiOQi-00082G-Me; Tue, 11 Dec 2012 11:55:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQh-00081m-NN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:19 +0000
Received: from [85.158.139.211:25146] by server-4.bemta-5.messagelabs.com id
	1F/33-14693-62F17C05; Tue, 11 Dec 2012 11:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-206.messagelabs.com!1355226917!19531089!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29068 invoked from network); 11 Dec 2012 11:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 11:55:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQe-000082-TK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQe-0002JM-Qs
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:16 +0000
Message-Id: <E1TiOQe-0002JM-Qs@xenbits.xen.org>
Date: Tue, 11 Dec 2012 11:55:16 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/hap: Fix memory leak of
	domain->arch.hvm_domain.dirty_vram
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Kouya Shimura <kouya@jp.fujitsu.com>
# Date 1354788718 -3600
# Node ID 1206a35266733ee3dcca1a9f4d341a4b98d1e49d
# Parent  8194979b8104f8a2f539dc5289bb2316fcdbf571
x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset: 26203:b5cb6cccc32c
xen-unstable date: Thu Nov 29 11:01:00 UTC 2012
---


diff -r 8194979b8104 -r 1206a3526673 xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Dec 06 11:10:15 2012 +0100
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Dec 06 11:11:58 2012 +0100
@@ -686,6 +686,9 @@ void hap_teardown(struct domain *d)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
+    xfree(d->arch.hvm_domain.dirty_vram);
+    d->arch.hvm_domain.dirty_vram = NULL;
+
     paging_unlock(d);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 11:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 11:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiOQj-00082n-S8; Tue, 11 Dec 2012 11:55:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQi-000828-Kf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:20 +0000
Received: from [85.158.137.99:52347] by server-15.bemta-3.messagelabs.com id
	6A/EF-07921-72F17C05; Tue, 11 Dec 2012 11:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-217.messagelabs.com!1355226915!12615901!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6266 invoked from network); 11 Dec 2012 11:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 11:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQd-00007t-0D
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQc-0002Id-Df
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:14 +0000
Message-Id: <E1TiOQc-0002Id-Df@xenbits.xen.org>
Date: Tue, 11 Dec 2012 11:55:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] MAINTAINERS: Reference stable
	maintenance policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354788106 -3600
# Node ID 6efa959326cc1eba19840d9caa1af1a12c3afe72
# Parent  b306bce613413c772af7a7660c9fd44d347b5ee2
MAINTAINERS: Reference stable maintenance policy

I also couldn't resist fixing a typo and adding a reference to
http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26238:53805e238cca
xen-unstable date: Thu Dec  6 09:56:53 UTC 2012
---


diff -r b306bce61341 -r 6efa959326cc MAINTAINERS
--- a/MAINTAINERS	Tue Dec 04 18:02:59 2012 +0000
+++ b/MAINTAINERS	Thu Dec 06 11:01:46 2012 +0100
@@ -1,5 +1,6 @@
 
 	List of maintainers and how to submit changes
+	=============================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
@@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
 	'diff -u' to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
-	job the maintainersdo is to keep things looking the same.
+	job the maintainers do is to keep things looking the same.
+
+	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
+	hints on how to submit a patch to xen-unstable in a suitable
+	form.
 
 	PLEASE try to include any credit lines you want added with the
 	patch. It avoids people being missed off by mistake and makes
@@ -34,6 +39,28 @@ 4.	Make sure you have the right to send 
 
 5.	Happy hacking.
 
+
+	Stable Release Maintenance
+	==========================
+
+The policy for inclusion in a Xen stable release is different to that
+for inclusion in xen-unstable.
+
+Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
+information.
+
+Remember to copy the stable branch maintainer. The maintainer for this
+branch is:
+
+	Jan Beulich <jbeulich@suse.com>
+
+Tools backport requests should also be copied to:
+
+	Ian Jackson <Ian.Jackson@eu.citrix.com>
+
+	Unstable Subsystem Maintainers
+	==============================
+
 Descriptions of section entries:
 
 	M: Mail patches to: FullName <address@domain>

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 11:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 11:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiOQj-00082n-S8; Tue, 11 Dec 2012 11:55:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQi-000828-Kf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:20 +0000
Received: from [85.158.137.99:52347] by server-15.bemta-3.messagelabs.com id
	6A/EF-07921-72F17C05; Tue, 11 Dec 2012 11:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-217.messagelabs.com!1355226915!12615901!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6266 invoked from network); 11 Dec 2012 11:55:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 11:55:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQd-00007t-0D
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQc-0002Id-Df
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:14 +0000
Message-Id: <E1TiOQc-0002Id-Df@xenbits.xen.org>
Date: Tue, 11 Dec 2012 11:55:13 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] MAINTAINERS: Reference stable
	maintenance policy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1354788106 -3600
# Node ID 6efa959326cc1eba19840d9caa1af1a12c3afe72
# Parent  b306bce613413c772af7a7660c9fd44d347b5ee2
MAINTAINERS: Reference stable maintenance policy

I also couldn't resist fixing a typo and adding a reference to
http://wiki.xen.org/wiki/Submitting_Xen_Patches for the normal case as
well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26238:53805e238cca
xen-unstable date: Thu Dec  6 09:56:53 UTC 2012
---


diff -r b306bce61341 -r 6efa959326cc MAINTAINERS
--- a/MAINTAINERS	Tue Dec 04 18:02:59 2012 +0000
+++ b/MAINTAINERS	Thu Dec 06 11:01:46 2012 +0100
@@ -1,5 +1,6 @@
 
 	List of maintainers and how to submit changes
+	=============================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
@@ -15,7 +16,11 @@ 3.	Make a patch available to the relevan
 	'diff -u' to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
-	job the maintainersdo is to keep things looking the same.
+	job the maintainers do is to keep things looking the same.
+
+	PLEASE see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
+	hints on how to submit a patch to xen-unstable in a suitable
+	form.
 
 	PLEASE try to include any credit lines you want added with the
 	patch. It avoids people being missed off by mistake and makes
@@ -34,6 +39,28 @@ 4.	Make sure you have the right to send 
 
 5.	Happy hacking.
 
+
+	Stable Release Maintenance
+	==========================
+
+The policy for inclusion in a Xen stable release is different to that
+for inclusion in xen-unstable.
+
+Please see http://wiki.xen.org/wiki/Xen_Maintenance_Releases for more
+information.
+
+Remember to copy the stable branch maintainer. The maintainer for this
+branch is:
+
+	Jan Beulich <jbeulich@suse.com>
+
+Tools backport requests should also be copied to:
+
+	Ian Jackson <Ian.Jackson@eu.citrix.com>
+
+	Unstable Subsystem Maintainers
+	==============================
+
 Descriptions of section entries:
 
 	M: Mail patches to: FullName <address@domain>

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 11:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 11:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiOQi-00082L-PQ; Tue, 11 Dec 2012 11:55:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQh-00081r-Rz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:19 +0000
Received: from [85.158.137.99:52287] by server-2.bemta-3.messagelabs.com id
	3A/EE-11239-62F17C05; Tue, 11 Dec 2012 11:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1355226916!13496355!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17704 invoked from network); 11 Dec 2012 11:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 11:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQe-00007z-Eo
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQe-0002J7-31
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:16 +0000
Message-Id: <E1TiOQe-0002J7-31@xenbits.xen.org>
Date: Tue, 11 Dec 2012 11:55:15 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] ACPI: fix return value of
	XEN_PM_PDC platform op
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354788615 -3600
# Node ID 8194979b8104f8a2f539dc5289bb2316fcdbf571
# Parent  594b333b211d8926270e65b6dc962d1d26a6e73b
ACPI: fix return value of XEN_PM_PDC platform op

Should return -EFAULT when copying to guest memory fails.

Once touching this code, also switch to using the more relaxed copy
function (copying from the same guest memory already validated the
virtual address range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26196:5faf5b8b702e
xen-unstable date: Wed Nov 28 09:03:51 UTC 2012
---


diff -r 594b333b211d -r 8194979b8104 xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c	Thu Dec 06 11:07:56 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c	Thu Dec 06 11:10:15 2012 +0100
@@ -523,8 +523,8 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_G
                     ACPI_PDC_SMP_C1PT) & ~mask;
         ret = arch_acpi_set_pdc_bits(acpi_id, bits, mask);
     }
-    if ( !ret )
-        ret = copy_to_guest_offset(pdc, 2, bits + 2, 1);
+    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, 1) )
+        ret = -EFAULT;
 
     return ret;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 11:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 11:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiOQi-00082L-PQ; Tue, 11 Dec 2012 11:55:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQh-00081r-Rz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:19 +0000
Received: from [85.158.137.99:52287] by server-2.bemta-3.messagelabs.com id
	3A/EE-11239-62F17C05; Tue, 11 Dec 2012 11:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-217.messagelabs.com!1355226916!13496355!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17704 invoked from network); 11 Dec 2012 11:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 11:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQe-00007z-Eo
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQe-0002J7-31
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:16 +0000
Message-Id: <E1TiOQe-0002J7-31@xenbits.xen.org>
Date: Tue, 11 Dec 2012 11:55:15 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] ACPI: fix return value of
	XEN_PM_PDC platform op
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354788615 -3600
# Node ID 8194979b8104f8a2f539dc5289bb2316fcdbf571
# Parent  594b333b211d8926270e65b6dc962d1d26a6e73b
ACPI: fix return value of XEN_PM_PDC platform op

Should return -EFAULT when copying to guest memory fails.

Once touching this code, also switch to using the more relaxed copy
function (copying from the same guest memory already validated the
virtual address range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26196:5faf5b8b702e
xen-unstable date: Wed Nov 28 09:03:51 UTC 2012
---


diff -r 594b333b211d -r 8194979b8104 xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c	Thu Dec 06 11:07:56 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c	Thu Dec 06 11:10:15 2012 +0100
@@ -523,8 +523,8 @@ int acpi_set_pdc_bits(u32 acpi_id, XEN_G
                     ACPI_PDC_SMP_C1PT) & ~mask;
         ret = arch_acpi_set_pdc_bits(acpi_id, bits, mask);
     }
-    if ( !ret )
-        ret = copy_to_guest_offset(pdc, 2, bits + 2, 1);
+    if ( !ret && __copy_to_guest_offset(pdc, 2, bits + 2, 1) )
+        ret = -EFAULT;
 
     return ret;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 11:58:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 11:58:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiOU0-0008P5-7e; Tue, 11 Dec 2012 11:58:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOTy-0008Ou-9J
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:58:42 +0000
Received: from [85.158.143.35:14490] by server-2.bemta-4.messagelabs.com id
	A4/34-30861-1FF17C05; Tue, 11 Dec 2012 11:58:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1355226916!12431783!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14247 invoked from network); 11 Dec 2012 11:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 11:55:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQd-00007w-Me
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQd-0002Is-Dh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:15 +0000
Message-Id: <E1TiOQd-0002Is-Dh@xenbits.xen.org>
Date: Tue, 11 Dec 2012 11:55:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: fix hypercall continuation
	cancellation in XENMAPSPACE_gmfn_range compat wrapper
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354788476 -3600
# Node ID 594b333b211d8926270e65b6dc962d1d26a6e73b
# Parent  6efa959326cc1eba19840d9caa1af1a12c3afe72
x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper

When no continuation was established, there must also not be an attempt
to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
multicall case, adjusts the guest mode return address in a way assuming
that an earlier call hypercall_create_continuation() took place.

Once touching this code, also restructure it slightly to improve
readability and switch to using the more relaxed copy function (copying
from the same guest memory already validated the virtual address
range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26195:7670eabcbafc
xen-unstable date: Wed Nov 28 09:02:26 UTC 2012
---


diff -r 6efa959326cc -r 594b333b211d xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Thu Dec 06 11:01:46 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/mm.c	Thu Dec 06 11:07:56 2012 +0100
@@ -66,21 +66,20 @@ int compat_arch_memory_op(int op, XEN_GU
         XLAT_add_to_physmap(nat, &cmp);
         rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
 
-        if ( cmp.space == XENMAPSPACE_gmfn_range )
+        if ( !rc || cmp.space != XENMAPSPACE_gmfn_range )
+            break;
+
+        XLAT_add_to_physmap(&cmp, nat);
+        if ( __copy_to_guest(arg, &cmp, 1) )
         {
-            if ( rc )
-            {
-                XLAT_add_to_physmap(&cmp, nat);
-                if ( copy_to_guest(arg, &cmp, 1) )
-                {
-                    hypercall_cancel_continuation();
-                    return -EFAULT;
-                }
-            }
             if ( rc == __HYPERVISOR_memory_op )
-                hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+                hypercall_cancel_continuation();
+            return -EFAULT;
         }
 
+        if ( rc == __HYPERVISOR_memory_op )
+            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+
         break;
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 11:58:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 11:58:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiOU0-0008P5-7e; Tue, 11 Dec 2012 11:58:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOTy-0008Ou-9J
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:58:42 +0000
Received: from [85.158.143.35:14490] by server-2.bemta-4.messagelabs.com id
	A4/34-30861-1FF17C05; Tue, 11 Dec 2012 11:58:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1355226916!12431783!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14247 invoked from network); 11 Dec 2012 11:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 11:55:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQd-00007w-Me
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiOQd-0002Is-Dh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 11:55:15 +0000
Message-Id: <E1TiOQd-0002Is-Dh@xenbits.xen.org>
Date: Tue, 11 Dec 2012 11:55:14 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: fix hypercall continuation
	cancellation in XENMAPSPACE_gmfn_range compat wrapper
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1354788476 -3600
# Node ID 594b333b211d8926270e65b6dc962d1d26a6e73b
# Parent  6efa959326cc1eba19840d9caa1af1a12c3afe72
x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper

When no continuation was established, there must also not be an attempt
to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
multicall case, adjusts the guest mode return address in a way assuming
that an earlier call hypercall_create_continuation() took place.

Once touching this code, also restructure it slightly to improve
readability and switch to using the more relaxed copy function (copying
from the same guest memory already validated the virtual address
range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26195:7670eabcbafc
xen-unstable date: Wed Nov 28 09:02:26 UTC 2012
---


diff -r 6efa959326cc -r 594b333b211d xen/arch/x86/x86_64/compat/mm.c
--- a/xen/arch/x86/x86_64/compat/mm.c	Thu Dec 06 11:01:46 2012 +0100
+++ b/xen/arch/x86/x86_64/compat/mm.c	Thu Dec 06 11:07:56 2012 +0100
@@ -66,21 +66,20 @@ int compat_arch_memory_op(int op, XEN_GU
         XLAT_add_to_physmap(nat, &cmp);
         rc = arch_memory_op(op, guest_handle_from_ptr(nat, void));
 
-        if ( cmp.space == XENMAPSPACE_gmfn_range )
+        if ( !rc || cmp.space != XENMAPSPACE_gmfn_range )
+            break;
+
+        XLAT_add_to_physmap(&cmp, nat);
+        if ( __copy_to_guest(arg, &cmp, 1) )
         {
-            if ( rc )
-            {
-                XLAT_add_to_physmap(&cmp, nat);
-                if ( copy_to_guest(arg, &cmp, 1) )
-                {
-                    hypercall_cancel_continuation();
-                    return -EFAULT;
-                }
-            }
             if ( rc == __HYPERVISOR_memory_op )
-                hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+                hypercall_cancel_continuation();
+            return -EFAULT;
         }
 
+        if ( rc == __HYPERVISOR_memory_op )
+            hypercall_xlat_continuation(NULL, 0x2, nat, arg);
+
         break;
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:44:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ81-0001nm-P7; Tue, 11 Dec 2012 13:44:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ81-0001nh-29
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:09 +0000
Received: from [193.109.254.147:8382] by server-10.bemta-14.messagelabs.com id
	12/7A-31741-8A837C05; Tue, 11 Dec 2012 13:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1355233446!2496183!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22362 invoked from network); 11 Dec 2012 13:44:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ7y-0001HJ-4L
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ7x-0005MP-Mw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:05 +0000
Date: Tue, 11 Dec 2012 13:44:05 +0000
Message-Id: <E1TiQ7x-0005MP-Mw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tcg/arm: fix TLB access in
	qemu-ld/st ops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d17bd1d8cc27f8c1a24c65f555a77a661c332b7f
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Tue Oct 9 21:53:11 2012 +0200

    tcg/arm: fix TLB access in qemu-ld/st ops
    
    The TCG arm backend considers likely that the offset to the TLB
    entries does not exceed 12 bits for mem_index = 0. In practice this is
    not true for at least the MIPS target.
    
    The current patch fixes that by loading the bits 23-12 with a separate
    instruction, and using loads with address writeback, independently of
    the value of mem_idx. In total this allow a 24-bit offset, which is a
    lot more than needed.
    
    Cc: Andrzej Zaborowski <balrogg@gmail.com>
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/arm/tcg-target.c |   78 +++++++++++++++++++++++++++-----------------------
 1 files changed, 42 insertions(+), 36 deletions(-)

diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index e790bf0..9550102 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -639,6 +639,22 @@ static inline void tcg_out_ld32_12(TCGContext *s, int cond,
                         (rn << 16) | (rd << 12) | ((-im) & 0xfff));
 }
 
+/* Offset pre-increment with base writeback.  */
+static inline void tcg_out_ld32_12wb(TCGContext *s, int cond,
+                                     int rd, int rn, tcg_target_long im)
+{
+    /* ldr with writeback and both register equals is UNPREDICTABLE */
+    assert(rd != rn);
+
+    if (im >= 0) {
+        tcg_out32(s, (cond << 28) | 0x05b00000 |
+                        (rn << 16) | (rd << 12) | (im & 0xfff));
+    } else {
+        tcg_out32(s, (cond << 28) | 0x05300000 |
+                        (rn << 16) | (rd << 12) | ((-im) & 0xfff));
+    }
+}
+
 static inline void tcg_out_st32_12(TCGContext *s, int cond,
                 int rd, int rn, tcg_target_long im)
 {
@@ -1071,7 +1087,7 @@ static inline void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc)
 {
     int addr_reg, data_reg, data_reg2, bswap;
 #ifdef CONFIG_SOFTMMU
-    int mem_index, s_bits;
+    int mem_index, s_bits, tlb_offset;
     TCGReg argreg;
 # if TARGET_LONG_BITS == 64
     int addr_reg2;
@@ -1111,19 +1127,15 @@ static inline void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc)
                     TCG_REG_R0, TCG_REG_R8, CPU_TLB_SIZE - 1);
     tcg_out_dat_reg(s, COND_AL, ARITH_ADD, TCG_REG_R0, TCG_AREG0,
                     TCG_REG_R0, SHIFT_IMM_LSL(CPU_TLB_ENTRY_BITS));
-    /* In the
-     *  ldr r1 [r0, #(offsetof(CPUArchState, tlb_table[mem_index][0].addr_read))]
-     * below, the offset is likely to exceed 12 bits if mem_index != 0 and
-     * not exceed otherwise, so use an
-     *  add r0, r0, #(mem_index * sizeof *CPUArchState.tlb_table)
-     * before.
-     */
-    if (mem_index)
+    /* We assume that the offset is contained within 20 bits.  */
+    tlb_offset = offsetof(CPUArchState, tlb_table[mem_index][0].addr_read);
+    assert(tlb_offset & ~0xfffff == 0);
+    if (tlb_offset > 0xfff) {
         tcg_out_dat_imm(s, COND_AL, ARITH_ADD, TCG_REG_R0, TCG_REG_R0,
-                        (mem_index << (TLB_SHIFT & 1)) |
-                        ((16 - (TLB_SHIFT >> 1)) << 8));
-    tcg_out_ld32_12(s, COND_AL, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addr_read));
+                        0xa00 | (tlb_offset >> 12));
+        tlb_offset &= 0xfff;
+    }
+    tcg_out_ld32_12wb(s, COND_AL, TCG_REG_R1, TCG_REG_R0, tlb_offset);
     tcg_out_dat_reg(s, COND_AL, ARITH_CMP, 0, TCG_REG_R1,
                     TCG_REG_R8, SHIFT_IMM_LSL(TARGET_PAGE_BITS));
     /* Check alignment.  */
@@ -1131,15 +1143,14 @@ static inline void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc)
         tcg_out_dat_imm(s, COND_EQ, ARITH_TST,
                         0, addr_reg, (1 << s_bits) - 1);
 #  if TARGET_LONG_BITS == 64
-    /* XXX: possibly we could use a block data load or writeback in
-     * the first access.  */
-    tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addr_read) + 4);
+    /* XXX: possibly we could use a block data load in the first access.  */
+    tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0, 4);
     tcg_out_dat_reg(s, COND_EQ, ARITH_CMP, 0,
                     TCG_REG_R1, addr_reg2, SHIFT_IMM_LSL(0));
 #  endif
     tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addend));
+                    offsetof(CPUTLBEntry, addend)
+                    - offsetof(CPUTLBEntry, addr_read));
 
     switch (opc) {
     case 0:
@@ -1288,7 +1299,7 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
 {
     int addr_reg, data_reg, data_reg2, bswap;
 #ifdef CONFIG_SOFTMMU
-    int mem_index, s_bits;
+    int mem_index, s_bits, tlb_offset;
     TCGReg argreg;
 # if TARGET_LONG_BITS == 64
     int addr_reg2;
@@ -1325,19 +1336,15 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
                     TCG_REG_R0, TCG_REG_R8, CPU_TLB_SIZE - 1);
     tcg_out_dat_reg(s, COND_AL, ARITH_ADD, TCG_REG_R0,
                     TCG_AREG0, TCG_REG_R0, SHIFT_IMM_LSL(CPU_TLB_ENTRY_BITS));
-    /* In the
-     *  ldr r1 [r0, #(offsetof(CPUArchState, tlb_table[mem_index][0].addr_write))]
-     * below, the offset is likely to exceed 12 bits if mem_index != 0 and
-     * not exceed otherwise, so use an
-     *  add r0, r0, #(mem_index * sizeof *CPUArchState.tlb_table)
-     * before.
-     */
-    if (mem_index)
+    /* We assume that the offset is contained within 20 bits.  */
+    tlb_offset = offsetof(CPUArchState, tlb_table[mem_index][0].addr_write);
+    assert(tlb_offset & ~0xfffff == 0);
+    if (tlb_offset > 0xfff) {
         tcg_out_dat_imm(s, COND_AL, ARITH_ADD, TCG_REG_R0, TCG_REG_R0,
-                        (mem_index << (TLB_SHIFT & 1)) |
-                        ((16 - (TLB_SHIFT >> 1)) << 8));
-    tcg_out_ld32_12(s, COND_AL, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addr_write));
+                        0xa00 | (tlb_offset >> 12));
+        tlb_offset &= 0xfff;
+    }
+    tcg_out_ld32_12wb(s, COND_AL, TCG_REG_R1, TCG_REG_R0, tlb_offset);
     tcg_out_dat_reg(s, COND_AL, ARITH_CMP, 0, TCG_REG_R1,
                     TCG_REG_R8, SHIFT_IMM_LSL(TARGET_PAGE_BITS));
     /* Check alignment.  */
@@ -1345,15 +1352,14 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
         tcg_out_dat_imm(s, COND_EQ, ARITH_TST,
                         0, addr_reg, (1 << s_bits) - 1);
 #  if TARGET_LONG_BITS == 64
-    /* XXX: possibly we could use a block data load or writeback in
-     * the first access.  */
-    tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addr_write) + 4);
+    /* XXX: possibly we could use a block data load in the first access.  */
+    tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0, 4);
     tcg_out_dat_reg(s, COND_EQ, ARITH_CMP, 0,
                     TCG_REG_R1, addr_reg2, SHIFT_IMM_LSL(0));
 #  endif
     tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addend));
+                    offsetof(CPUTLBEntry, addend)
+                    - offsetof(CPUTLBEntry, addr_write));
 
     switch (opc) {
     case 0:
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:44:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ81-0001nm-P7; Tue, 11 Dec 2012 13:44:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ81-0001nh-29
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:09 +0000
Received: from [193.109.254.147:8382] by server-10.bemta-14.messagelabs.com id
	12/7A-31741-8A837C05; Tue, 11 Dec 2012 13:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1355233446!2496183!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22362 invoked from network); 11 Dec 2012 13:44:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ7y-0001HJ-4L
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ7x-0005MP-Mw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:05 +0000
Date: Tue, 11 Dec 2012 13:44:05 +0000
Message-Id: <E1TiQ7x-0005MP-Mw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tcg/arm: fix TLB access in
	qemu-ld/st ops
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d17bd1d8cc27f8c1a24c65f555a77a661c332b7f
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Tue Oct 9 21:53:11 2012 +0200

    tcg/arm: fix TLB access in qemu-ld/st ops
    
    The TCG arm backend considers likely that the offset to the TLB
    entries does not exceed 12 bits for mem_index = 0. In practice this is
    not true for at least the MIPS target.
    
    The current patch fixes that by loading the bits 23-12 with a separate
    instruction, and using loads with address writeback, independently of
    the value of mem_idx. In total this allow a 24-bit offset, which is a
    lot more than needed.
    
    Cc: Andrzej Zaborowski <balrogg@gmail.com>
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/arm/tcg-target.c |   78 +++++++++++++++++++++++++++-----------------------
 1 files changed, 42 insertions(+), 36 deletions(-)

diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index e790bf0..9550102 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -639,6 +639,22 @@ static inline void tcg_out_ld32_12(TCGContext *s, int cond,
                         (rn << 16) | (rd << 12) | ((-im) & 0xfff));
 }
 
+/* Offset pre-increment with base writeback.  */
+static inline void tcg_out_ld32_12wb(TCGContext *s, int cond,
+                                     int rd, int rn, tcg_target_long im)
+{
+    /* ldr with writeback and both register equals is UNPREDICTABLE */
+    assert(rd != rn);
+
+    if (im >= 0) {
+        tcg_out32(s, (cond << 28) | 0x05b00000 |
+                        (rn << 16) | (rd << 12) | (im & 0xfff));
+    } else {
+        tcg_out32(s, (cond << 28) | 0x05300000 |
+                        (rn << 16) | (rd << 12) | ((-im) & 0xfff));
+    }
+}
+
 static inline void tcg_out_st32_12(TCGContext *s, int cond,
                 int rd, int rn, tcg_target_long im)
 {
@@ -1071,7 +1087,7 @@ static inline void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc)
 {
     int addr_reg, data_reg, data_reg2, bswap;
 #ifdef CONFIG_SOFTMMU
-    int mem_index, s_bits;
+    int mem_index, s_bits, tlb_offset;
     TCGReg argreg;
 # if TARGET_LONG_BITS == 64
     int addr_reg2;
@@ -1111,19 +1127,15 @@ static inline void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc)
                     TCG_REG_R0, TCG_REG_R8, CPU_TLB_SIZE - 1);
     tcg_out_dat_reg(s, COND_AL, ARITH_ADD, TCG_REG_R0, TCG_AREG0,
                     TCG_REG_R0, SHIFT_IMM_LSL(CPU_TLB_ENTRY_BITS));
-    /* In the
-     *  ldr r1 [r0, #(offsetof(CPUArchState, tlb_table[mem_index][0].addr_read))]
-     * below, the offset is likely to exceed 12 bits if mem_index != 0 and
-     * not exceed otherwise, so use an
-     *  add r0, r0, #(mem_index * sizeof *CPUArchState.tlb_table)
-     * before.
-     */
-    if (mem_index)
+    /* We assume that the offset is contained within 20 bits.  */
+    tlb_offset = offsetof(CPUArchState, tlb_table[mem_index][0].addr_read);
+    assert(tlb_offset & ~0xfffff == 0);
+    if (tlb_offset > 0xfff) {
         tcg_out_dat_imm(s, COND_AL, ARITH_ADD, TCG_REG_R0, TCG_REG_R0,
-                        (mem_index << (TLB_SHIFT & 1)) |
-                        ((16 - (TLB_SHIFT >> 1)) << 8));
-    tcg_out_ld32_12(s, COND_AL, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addr_read));
+                        0xa00 | (tlb_offset >> 12));
+        tlb_offset &= 0xfff;
+    }
+    tcg_out_ld32_12wb(s, COND_AL, TCG_REG_R1, TCG_REG_R0, tlb_offset);
     tcg_out_dat_reg(s, COND_AL, ARITH_CMP, 0, TCG_REG_R1,
                     TCG_REG_R8, SHIFT_IMM_LSL(TARGET_PAGE_BITS));
     /* Check alignment.  */
@@ -1131,15 +1143,14 @@ static inline void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc)
         tcg_out_dat_imm(s, COND_EQ, ARITH_TST,
                         0, addr_reg, (1 << s_bits) - 1);
 #  if TARGET_LONG_BITS == 64
-    /* XXX: possibly we could use a block data load or writeback in
-     * the first access.  */
-    tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addr_read) + 4);
+    /* XXX: possibly we could use a block data load in the first access.  */
+    tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0, 4);
     tcg_out_dat_reg(s, COND_EQ, ARITH_CMP, 0,
                     TCG_REG_R1, addr_reg2, SHIFT_IMM_LSL(0));
 #  endif
     tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addend));
+                    offsetof(CPUTLBEntry, addend)
+                    - offsetof(CPUTLBEntry, addr_read));
 
     switch (opc) {
     case 0:
@@ -1288,7 +1299,7 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
 {
     int addr_reg, data_reg, data_reg2, bswap;
 #ifdef CONFIG_SOFTMMU
-    int mem_index, s_bits;
+    int mem_index, s_bits, tlb_offset;
     TCGReg argreg;
 # if TARGET_LONG_BITS == 64
     int addr_reg2;
@@ -1325,19 +1336,15 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
                     TCG_REG_R0, TCG_REG_R8, CPU_TLB_SIZE - 1);
     tcg_out_dat_reg(s, COND_AL, ARITH_ADD, TCG_REG_R0,
                     TCG_AREG0, TCG_REG_R0, SHIFT_IMM_LSL(CPU_TLB_ENTRY_BITS));
-    /* In the
-     *  ldr r1 [r0, #(offsetof(CPUArchState, tlb_table[mem_index][0].addr_write))]
-     * below, the offset is likely to exceed 12 bits if mem_index != 0 and
-     * not exceed otherwise, so use an
-     *  add r0, r0, #(mem_index * sizeof *CPUArchState.tlb_table)
-     * before.
-     */
-    if (mem_index)
+    /* We assume that the offset is contained within 20 bits.  */
+    tlb_offset = offsetof(CPUArchState, tlb_table[mem_index][0].addr_write);
+    assert(tlb_offset & ~0xfffff == 0);
+    if (tlb_offset > 0xfff) {
         tcg_out_dat_imm(s, COND_AL, ARITH_ADD, TCG_REG_R0, TCG_REG_R0,
-                        (mem_index << (TLB_SHIFT & 1)) |
-                        ((16 - (TLB_SHIFT >> 1)) << 8));
-    tcg_out_ld32_12(s, COND_AL, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addr_write));
+                        0xa00 | (tlb_offset >> 12));
+        tlb_offset &= 0xfff;
+    }
+    tcg_out_ld32_12wb(s, COND_AL, TCG_REG_R1, TCG_REG_R0, tlb_offset);
     tcg_out_dat_reg(s, COND_AL, ARITH_CMP, 0, TCG_REG_R1,
                     TCG_REG_R8, SHIFT_IMM_LSL(TARGET_PAGE_BITS));
     /* Check alignment.  */
@@ -1345,15 +1352,14 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
         tcg_out_dat_imm(s, COND_EQ, ARITH_TST,
                         0, addr_reg, (1 << s_bits) - 1);
 #  if TARGET_LONG_BITS == 64
-    /* XXX: possibly we could use a block data load or writeback in
-     * the first access.  */
-    tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addr_write) + 4);
+    /* XXX: possibly we could use a block data load in the first access.  */
+    tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0, 4);
     tcg_out_dat_reg(s, COND_EQ, ARITH_CMP, 0,
                     TCG_REG_R1, addr_reg2, SHIFT_IMM_LSL(0));
 #  endif
     tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0,
-                    offsetof(CPUArchState, tlb_table[0][0].addend));
+                    offsetof(CPUTLBEntry, addend)
+                    - offsetof(CPUTLBEntry, addr_write));
 
     switch (opc) {
     case 0:
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:44:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:44:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ8J-0001oT-SU; Tue, 11 Dec 2012 13:44:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8J-0001oN-5g
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:27 +0000
Received: from [85.158.138.51:54692] by server-9.bemta-3.messagelabs.com id
	51/CA-11948-AB837C05; Tue, 11 Dec 2012 13:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1355233456!28101376!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12129 invoked from network); 11 Dec 2012 13:44:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ88-0001HM-IC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ88-0005Mp-Cy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:16 +0000
Date: Tue, 11 Dec 2012 13:44:16 +0000
Message-Id: <E1TiQ88-0005Mp-Cy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tcg/arm: fix cross-endian
	qemu_st16
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7aab08aa786e3a8838beac758ee61c5000144937
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Tue Oct 9 21:53:11 2012 +0200

    tcg/arm: fix cross-endian qemu_st16
    
    The bswap16 TCG opcode assumes that the high bytes of the temp equal
    to 0 before calling it. The ARM backend implementation takes this
    assumption to slightly optimize the generated code.
    
    The same implementation is called for implementing the cross-endian
    qemu_st16 opcode, where this assumption is not true anymore. One way to
    fix that would be to zero the high bytes before calling it. Given the
    store instruction just ignore them, it is possible to provide a slightly
    more optimized version. With ARMv6+ the rev16 instruction does the work
    correctly. For lower ARM versions the patch provides a version which
    behaves correctly with non-zero high bytes, but fill them with junk.
    
    Cc: Andrzej Zaborowski <balrogg@gmail.com>
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/arm/tcg-target.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index 9550102..47612fe 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -611,6 +611,22 @@ static inline void tcg_out_bswap16(TCGContext *s, int cond, int rd, int rn)
     }
 }
 
+/* swap the two low bytes assuming that the two high input bytes and the
+   two high output bit can hold any value. */
+static inline void tcg_out_bswap16st(TCGContext *s, int cond, int rd, int rn)
+{
+    if (use_armv6_instructions) {
+        /* rev16 */
+        tcg_out32(s, 0x06bf0fb0 | (cond << 28) | (rd << 12) | rn);
+    } else {
+        tcg_out_dat_reg(s, cond, ARITH_MOV,
+                        TCG_REG_R8, 0, rn, SHIFT_IMM_LSR(8));
+        tcg_out_dat_imm(s, cond, ARITH_AND, TCG_REG_R8, TCG_REG_R8, 0xff);
+        tcg_out_dat_reg(s, cond, ARITH_ORR,
+                        rd, TCG_REG_R8, rn, SHIFT_IMM_LSL(8));
+    }
+}
+
 static inline void tcg_out_bswap32(TCGContext *s, int cond, int rd, int rn)
 {
     if (use_armv6_instructions) {
@@ -1367,7 +1383,7 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
         break;
     case 1:
         if (bswap) {
-            tcg_out_bswap16(s, COND_EQ, TCG_REG_R0, data_reg);
+            tcg_out_bswap16st(s, COND_EQ, TCG_REG_R0, data_reg);
             tcg_out_st16_r(s, COND_EQ, TCG_REG_R0, addr_reg, TCG_REG_R1);
         } else {
             tcg_out_st16_r(s, COND_EQ, data_reg, addr_reg, TCG_REG_R1);
@@ -1453,7 +1469,7 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
         break;
     case 1:
         if (bswap) {
-            tcg_out_bswap16(s, COND_AL, TCG_REG_R0, data_reg);
+            tcg_out_bswap16st(s, COND_AL, TCG_REG_R0, data_reg);
             tcg_out_st16_8(s, COND_AL, TCG_REG_R0, addr_reg, 0);
         } else {
             tcg_out_st16_8(s, COND_AL, data_reg, addr_reg, 0);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:44:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:44:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ8J-0001oT-SU; Tue, 11 Dec 2012 13:44:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8J-0001oN-5g
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:27 +0000
Received: from [85.158.138.51:54692] by server-9.bemta-3.messagelabs.com id
	51/CA-11948-AB837C05; Tue, 11 Dec 2012 13:44:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1355233456!28101376!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12129 invoked from network); 11 Dec 2012 13:44:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ88-0001HM-IC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ88-0005Mp-Cy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:16 +0000
Date: Tue, 11 Dec 2012 13:44:16 +0000
Message-Id: <E1TiQ88-0005Mp-Cy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tcg/arm: fix cross-endian
	qemu_st16
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7aab08aa786e3a8838beac758ee61c5000144937
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Tue Oct 9 21:53:11 2012 +0200

    tcg/arm: fix cross-endian qemu_st16
    
    The bswap16 TCG opcode assumes that the high bytes of the temp equal
    to 0 before calling it. The ARM backend implementation takes this
    assumption to slightly optimize the generated code.
    
    The same implementation is called for implementing the cross-endian
    qemu_st16 opcode, where this assumption is not true anymore. One way to
    fix that would be to zero the high bytes before calling it. Given the
    store instruction just ignore them, it is possible to provide a slightly
    more optimized version. With ARMv6+ the rev16 instruction does the work
    correctly. For lower ARM versions the patch provides a version which
    behaves correctly with non-zero high bytes, but fill them with junk.
    
    Cc: Andrzej Zaborowski <balrogg@gmail.com>
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/arm/tcg-target.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index 9550102..47612fe 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -611,6 +611,22 @@ static inline void tcg_out_bswap16(TCGContext *s, int cond, int rd, int rn)
     }
 }
 
+/* swap the two low bytes assuming that the two high input bytes and the
+   two high output bit can hold any value. */
+static inline void tcg_out_bswap16st(TCGContext *s, int cond, int rd, int rn)
+{
+    if (use_armv6_instructions) {
+        /* rev16 */
+        tcg_out32(s, 0x06bf0fb0 | (cond << 28) | (rd << 12) | rn);
+    } else {
+        tcg_out_dat_reg(s, cond, ARITH_MOV,
+                        TCG_REG_R8, 0, rn, SHIFT_IMM_LSR(8));
+        tcg_out_dat_imm(s, cond, ARITH_AND, TCG_REG_R8, TCG_REG_R8, 0xff);
+        tcg_out_dat_reg(s, cond, ARITH_ORR,
+                        rd, TCG_REG_R8, rn, SHIFT_IMM_LSL(8));
+    }
+}
+
 static inline void tcg_out_bswap32(TCGContext *s, int cond, int rd, int rn)
 {
     if (use_armv6_instructions) {
@@ -1367,7 +1383,7 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
         break;
     case 1:
         if (bswap) {
-            tcg_out_bswap16(s, COND_EQ, TCG_REG_R0, data_reg);
+            tcg_out_bswap16st(s, COND_EQ, TCG_REG_R0, data_reg);
             tcg_out_st16_r(s, COND_EQ, TCG_REG_R0, addr_reg, TCG_REG_R1);
         } else {
             tcg_out_st16_r(s, COND_EQ, data_reg, addr_reg, TCG_REG_R1);
@@ -1453,7 +1469,7 @@ static inline void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc)
         break;
     case 1:
         if (bswap) {
-            tcg_out_bswap16(s, COND_AL, TCG_REG_R0, data_reg);
+            tcg_out_bswap16st(s, COND_AL, TCG_REG_R0, data_reg);
             tcg_out_st16_8(s, COND_AL, TCG_REG_R0, addr_reg, 0);
         } else {
             tcg_out_st16_8(s, COND_AL, data_reg, addr_reg, 0);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:44:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ8M-0001ov-At; Tue, 11 Dec 2012 13:44:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8L-0001oc-Ay
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:29 +0000
Received: from [193.109.254.147:15966] by server-2.bemta-14.messagelabs.com id
	C9/2A-20829-CB837C05; Tue, 11 Dec 2012 13:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1355233467!1790995!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3240 invoked from network); 11 Dec 2012 13:44:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8I-0001HP-RH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8I-0005NF-Md
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:26 +0000
Date: Tue, 11 Dec 2012 13:44:26 +0000
Message-Id: <E1TiQ8I-0005NF-Md@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-openrisc: remove
	conflicting definitions from cpu.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 44e04d3b945ba6f5cc87e65192081da4783f73fa
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Tue Oct 9 21:53:12 2012 +0200

    target-openrisc: remove conflicting definitions from cpu.h
    
    On an ARM host, the registers definitions from cpu.h clash
    with /usr/include/sys/ucontext.h. As there are unused, just remove
    them.
    
    Cc: Jia Liu <proljc@gmail.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-openrisc/cpu.h |   18 ------------------
 1 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/target-openrisc/cpu.h b/target-openrisc/cpu.h
index d42ffb0..ebb5ad3 100644
--- a/target-openrisc/cpu.h
+++ b/target-openrisc/cpu.h
@@ -89,24 +89,6 @@ enum {
 /* Interrupt */
 #define NR_IRQS  32
 
-/* Registers */
-enum {
-    R0 = 0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10,
-    R11, R12, R13, R14, R15, R16, R17, R18, R19, R20,
-    R21, R22, R23, R24, R25, R26, R27, R28, R29, R30,
-    R31
-};
-
-/* Register aliases */
-enum {
-    R_ZERO = R0,
-    R_SP = R1,
-    R_FP = R2,
-    R_LR = R9,
-    R_RV = R11,
-    R_RVH = R12
-};
-
 /* Unit presece register */
 enum {
     UPR_UP = (1 << 0),
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:44:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ8M-0001ov-At; Tue, 11 Dec 2012 13:44:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8L-0001oc-Ay
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:29 +0000
Received: from [193.109.254.147:15966] by server-2.bemta-14.messagelabs.com id
	C9/2A-20829-CB837C05; Tue, 11 Dec 2012 13:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1355233467!1790995!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3240 invoked from network); 11 Dec 2012 13:44:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8I-0001HP-RH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8I-0005NF-Md
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:26 +0000
Date: Tue, 11 Dec 2012 13:44:26 +0000
Message-Id: <E1TiQ8I-0005NF-Md@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-openrisc: remove
	conflicting definitions from cpu.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 44e04d3b945ba6f5cc87e65192081da4783f73fa
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Tue Oct 9 21:53:12 2012 +0200

    target-openrisc: remove conflicting definitions from cpu.h
    
    On an ARM host, the registers definitions from cpu.h clash
    with /usr/include/sys/ucontext.h. As there are unused, just remove
    them.
    
    Cc: Jia Liu <proljc@gmail.com>
    Cc: qemu-stable@nongnu.org
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-openrisc/cpu.h |   18 ------------------
 1 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/target-openrisc/cpu.h b/target-openrisc/cpu.h
index d42ffb0..ebb5ad3 100644
--- a/target-openrisc/cpu.h
+++ b/target-openrisc/cpu.h
@@ -89,24 +89,6 @@ enum {
 /* Interrupt */
 #define NR_IRQS  32
 
-/* Registers */
-enum {
-    R0 = 0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10,
-    R11, R12, R13, R14, R15, R16, R17, R18, R19, R20,
-    R21, R22, R23, R24, R25, R26, R27, R28, R29, R30,
-    R31
-};
-
-/* Register aliases */
-enum {
-    R_ZERO = R0,
-    R_SP = R1,
-    R_FP = R2,
-    R_LR = R9,
-    R_RV = R11,
-    R_RVH = R12
-};
-
 /* Unit presece register */
 enum {
     UPR_UP = (1 << 0),
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:44:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:44:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ8c-0001rb-Kv; Tue, 11 Dec 2012 13:44:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8a-0001rF-Rf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:45 +0000
Received: from [85.158.137.99:21640] by server-6.bemta-3.messagelabs.com id
	30/68-12154-7C837C05; Tue, 11 Dec 2012 13:44:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1355233477!17149287!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30176 invoked from network); 11 Dec 2012 13:44:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8T-0001Hb-CE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8T-0005OC-0J
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:37 +0000
Date: Tue, 11 Dec 2012 13:44:37 +0000
Message-Id: <E1TiQ8T-0005OC-0J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-mips: Add comments
	on POOL32Axf encoding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0976911975671486976=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0976911975671486976==
Content-Type: text/plain

commit d132c79f6b68622e8a115327d1f60176e1816c7c
Author: é™³éŸ‹ä»» (Wei-Ren Chen) <chenwj@iis.sinica.edu.tw>
Date:   Wed Nov 21 13:50:45 2012 +0800

    target-mips: Add comments on POOL32Axf encoding
    
      Current QEMU MIPS POOL32AXF encoding comes from microMIPS32
    and microMIPS32 DSP. Add comment here to help reading.
    
    Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
    Reviewed-by: Eric Johnson <ericj@mips.com>
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-mips/translate.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/target-mips/translate.c b/target-mips/translate.c
index 8b438f8..7a85d21 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -10359,6 +10359,19 @@ enum {
 
 /* POOL32AXF encoding of minor opcode field extension */
 
+/*
+ * 1. MIPS Architecture for Programmers Volume II-B:
+ *      The microMIPS32 Instruction Set (Revision 3.05)
+ *
+ *    Table 6.5 POOL32Axf Encoding of Minor Opcode Extension Field
+ *
+ * 2. MIPS Architecture for Programmers VolumeIV-e:
+ *      The MIPS DSP Application-Specific Extension
+ *        to the microMIPS32 Architecture (Revision 2.34)
+ *
+ *    Table 5.5 POOL32Axf Encoding of Minor Opcode Extension Field
+ */
+
 enum {
     /* bits 11..6 */
     TEQ = 0x00,
@@ -10371,6 +10384,8 @@ enum {
     MFC0 = 0x03,
     MTC0 = 0x0b,
 
+    /* begin of microMIPS32 DSP */
+
     /* bits 13..12 for 0x01 */
     MFHI_ACC = 0x0,
     MFLO_ACC = 0x1,
@@ -10387,6 +10402,8 @@ enum {
     MULT_ACC = 0x0,
     MULTU_ACC = 0x1,
 
+    /* end of microMIPS32 DSP */
+
     /* bits 15..12 for 0x2c */
     SEB = 0x2,
     SEH = 0x3,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============0976911975671486976==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0976911975671486976==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:44:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:44:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ8c-0001rb-Kv; Tue, 11 Dec 2012 13:44:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8a-0001rF-Rf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:45 +0000
Received: from [85.158.137.99:21640] by server-6.bemta-3.messagelabs.com id
	30/68-12154-7C837C05; Tue, 11 Dec 2012 13:44:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1355233477!17149287!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30176 invoked from network); 11 Dec 2012 13:44:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8T-0001Hb-CE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8T-0005OC-0J
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:37 +0000
Date: Tue, 11 Dec 2012 13:44:37 +0000
Message-Id: <E1TiQ8T-0005OC-0J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-mips: Add comments
	on POOL32Axf encoding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0976911975671486976=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0976911975671486976==
Content-Type: text/plain

commit d132c79f6b68622e8a115327d1f60176e1816c7c
Author: é™³éŸ‹ä»» (Wei-Ren Chen) <chenwj@iis.sinica.edu.tw>
Date:   Wed Nov 21 13:50:45 2012 +0800

    target-mips: Add comments on POOL32Axf encoding
    
      Current QEMU MIPS POOL32AXF encoding comes from microMIPS32
    and microMIPS32 DSP. Add comment here to help reading.
    
    Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
    Reviewed-by: Eric Johnson <ericj@mips.com>
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-mips/translate.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/target-mips/translate.c b/target-mips/translate.c
index 8b438f8..7a85d21 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -10359,6 +10359,19 @@ enum {
 
 /* POOL32AXF encoding of minor opcode field extension */
 
+/*
+ * 1. MIPS Architecture for Programmers Volume II-B:
+ *      The microMIPS32 Instruction Set (Revision 3.05)
+ *
+ *    Table 6.5 POOL32Axf Encoding of Minor Opcode Extension Field
+ *
+ * 2. MIPS Architecture for Programmers VolumeIV-e:
+ *      The MIPS DSP Application-Specific Extension
+ *        to the microMIPS32 Architecture (Revision 2.34)
+ *
+ *    Table 5.5 POOL32Axf Encoding of Minor Opcode Extension Field
+ */
+
 enum {
     /* bits 11..6 */
     TEQ = 0x00,
@@ -10371,6 +10384,8 @@ enum {
     MFC0 = 0x03,
     MTC0 = 0x0b,
 
+    /* begin of microMIPS32 DSP */
+
     /* bits 13..12 for 0x01 */
     MFHI_ACC = 0x0,
     MFLO_ACC = 0x1,
@@ -10387,6 +10402,8 @@ enum {
     MULT_ACC = 0x0,
     MULTU_ACC = 0x1,
 
+    /* end of microMIPS32 DSP */
+
     /* bits 15..12 for 0x2c */
     SEB = 0x2,
     SEH = 0x3,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============0976911975671486976==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0976911975671486976==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:44:56 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:44:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ8i-0001sx-Nx; Tue, 11 Dec 2012 13:44:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8h-0001sQ-9a
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:51 +0000
Received: from [85.158.143.35:63510] by server-2.bemta-4.messagelabs.com id
	1D/C0-30861-2D837C05; Tue, 11 Dec 2012 13:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1355233488!15899479!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12939 invoked from network); 11 Dec 2012 13:44:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8d-0001Hg-Om
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8d-0005OZ-Gz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:47 +0000
Date: Tue, 11 Dec 2012 13:44:47 +0000
Message-Id: <E1TiQ8d-0005OZ-Gz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-mips: Clean up
	microMIPS32 major opcode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4150413166558717952=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4150413166558717952==
Content-Type: text/plain

commit 211da99290c8d570eee78f3f534f7e7d9d8f9da8
Author: é™³éŸ‹ä»» (Wei-Ren Chen) <chenwj@iis.sinica.edu.tw>
Date:   Wed Nov 21 14:04:41 2012 +0800

    target-mips: Clean up microMIPS32 major opcode
    
      I check MIPS microMIPS manual [1], and found the major opcode might
    be wrong. I add a comment to explicitly indicate what manual I am refering
    to, and according that manual I remove microMIPS32 major opcodes 0x1f.
    As for others, like 0x16, 0x17, 0x36 and 0x37, they are for higher-order
    MIPS ISA level or new revision of this microMIPS architecture. Quote
    from Johnson, they are belong MIPS64 [2].
    
    [1] http://www.mips.com/products/architectures/micromips/#specifications
    
        MIPS Architecture for Programmers Volume II-B:
          The microMIPS32 Instruction Set (Revision 3.05)
    
        MD00582-2B-microMIPS-AFP-03.05.pdf
    
    [2] http://www.mips.com/products/architectures/mips64/
    
        MIPS Architecture For Programmers
          Volume II-A: The MIPS64 Instruction Set
    
        MD00087-2B-MIPS64BIS-AFP-03.51.pdf
    
    Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
    Reviewed-by: Eric Johnson <ericj@mips.com>
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-mips/translate.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/target-mips/translate.c b/target-mips/translate.c
index 7a85d21..5342591 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -10239,9 +10239,19 @@ static int decode_mips16_opc (CPUMIPSState *env, DisasContext *ctx,
     return n_bytes;
 }
 
-/* microMIPS extension to MIPS32 */
+/* microMIPS extension to MIPS32/MIPS64 */
 
-/* microMIPS32 major opcodes */
+/*
+ * microMIPS32/microMIPS64 major opcodes
+ *
+ * 1. MIPS Architecture for Programmers Volume II-B:
+ *      The microMIPS32 Instruction Set (Revision 3.05)
+ *
+ *    Table 6.2 microMIPS32 Encoding of Major Opcode Field
+ *
+ * 2. MIPS Architecture For Programmers Volume II-A:
+ *      The MIPS64 Instruction Set (Revision 3.51)
+ */
 
 enum {
     POOL32A = 0x00,
@@ -10268,9 +10278,10 @@ enum {
     POOL16D = 0x13,
     ORI32 = 0x14,
     POOL32F = 0x15,
-    POOL32S = 0x16,
-    DADDIU32 = 0x17,
+    POOL32S = 0x16,  /* MIPS64 */
+    DADDIU32 = 0x17, /* MIPS64 */
 
+    /* 0x1f is reserved */
     POOL32C = 0x18,
     LWGP16 = 0x19,
     LW16 = 0x1a,
@@ -10278,7 +10289,6 @@ enum {
     XORI32 = 0x1c,
     JALS32 = 0x1d,
     ADDIUPC = 0x1e,
-    POOL48A = 0x1f,
 
     /* 0x20 is reserved */
     RES_20 = 0x20,
@@ -10307,8 +10317,8 @@ enum {
     B16 = 0x33,
     ANDI32 = 0x34,
     J32 = 0x35,
-    SD32 = 0x36,
-    LD32 = 0x37,
+    SD32 = 0x36, /* MIPS64 */
+    LD32 = 0x37, /* MIPS64 */
 
     /* 0x38 and 0x39 are reserved */
     RES_38 = 0x38,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============4150413166558717952==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============4150413166558717952==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:44:56 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:44:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ8i-0001sx-Nx; Tue, 11 Dec 2012 13:44:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8h-0001sQ-9a
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:51 +0000
Received: from [85.158.143.35:63510] by server-2.bemta-4.messagelabs.com id
	1D/C0-30861-2D837C05; Tue, 11 Dec 2012 13:44:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1355233488!15899479!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12939 invoked from network); 11 Dec 2012 13:44:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8d-0001Hg-Om
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8d-0005OZ-Gz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:47 +0000
Date: Tue, 11 Dec 2012 13:44:47 +0000
Message-Id: <E1TiQ8d-0005OZ-Gz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-mips: Clean up
	microMIPS32 major opcode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4150413166558717952=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4150413166558717952==
Content-Type: text/plain

commit 211da99290c8d570eee78f3f534f7e7d9d8f9da8
Author: é™³éŸ‹ä»» (Wei-Ren Chen) <chenwj@iis.sinica.edu.tw>
Date:   Wed Nov 21 14:04:41 2012 +0800

    target-mips: Clean up microMIPS32 major opcode
    
      I check MIPS microMIPS manual [1], and found the major opcode might
    be wrong. I add a comment to explicitly indicate what manual I am refering
    to, and according that manual I remove microMIPS32 major opcodes 0x1f.
    As for others, like 0x16, 0x17, 0x36 and 0x37, they are for higher-order
    MIPS ISA level or new revision of this microMIPS architecture. Quote
    from Johnson, they are belong MIPS64 [2].
    
    [1] http://www.mips.com/products/architectures/micromips/#specifications
    
        MIPS Architecture for Programmers Volume II-B:
          The microMIPS32 Instruction Set (Revision 3.05)
    
        MD00582-2B-microMIPS-AFP-03.05.pdf
    
    [2] http://www.mips.com/products/architectures/mips64/
    
        MIPS Architecture For Programmers
          Volume II-A: The MIPS64 Instruction Set
    
        MD00087-2B-MIPS64BIS-AFP-03.51.pdf
    
    Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
    Reviewed-by: Eric Johnson <ericj@mips.com>
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-mips/translate.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/target-mips/translate.c b/target-mips/translate.c
index 7a85d21..5342591 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -10239,9 +10239,19 @@ static int decode_mips16_opc (CPUMIPSState *env, DisasContext *ctx,
     return n_bytes;
 }
 
-/* microMIPS extension to MIPS32 */
+/* microMIPS extension to MIPS32/MIPS64 */
 
-/* microMIPS32 major opcodes */
+/*
+ * microMIPS32/microMIPS64 major opcodes
+ *
+ * 1. MIPS Architecture for Programmers Volume II-B:
+ *      The microMIPS32 Instruction Set (Revision 3.05)
+ *
+ *    Table 6.2 microMIPS32 Encoding of Major Opcode Field
+ *
+ * 2. MIPS Architecture For Programmers Volume II-A:
+ *      The MIPS64 Instruction Set (Revision 3.51)
+ */
 
 enum {
     POOL32A = 0x00,
@@ -10268,9 +10278,10 @@ enum {
     POOL16D = 0x13,
     ORI32 = 0x14,
     POOL32F = 0x15,
-    POOL32S = 0x16,
-    DADDIU32 = 0x17,
+    POOL32S = 0x16,  /* MIPS64 */
+    DADDIU32 = 0x17, /* MIPS64 */
 
+    /* 0x1f is reserved */
     POOL32C = 0x18,
     LWGP16 = 0x19,
     LW16 = 0x1a,
@@ -10278,7 +10289,6 @@ enum {
     XORI32 = 0x1c,
     JALS32 = 0x1d,
     ADDIUPC = 0x1e,
-    POOL48A = 0x1f,
 
     /* 0x20 is reserved */
     RES_20 = 0x20,
@@ -10307,8 +10317,8 @@ enum {
     B16 = 0x33,
     ANDI32 = 0x34,
     J32 = 0x35,
-    SD32 = 0x36,
-    LD32 = 0x37,
+    SD32 = 0x36, /* MIPS64 */
+    LD32 = 0x37, /* MIPS64 */
 
     /* 0x38 and 0x39 are reserved */
     RES_38 = 0x38,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============4150413166558717952==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============4150413166558717952==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:45:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:45:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ9D-0001yo-Ry; Tue, 11 Dec 2012 13:45:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9B-0001yO-R0
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:21 +0000
Received: from [85.158.139.211:15764] by server-1.bemta-5.messagelabs.com id
	7E/D2-12813-0F837C05; Tue, 11 Dec 2012 13:45:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1355233519!18209864!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11066 invoked from network); 11 Dec 2012 13:45:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:45:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ99-0001It-45
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ98-0005Qq-Ov
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:18 +0000
Date: Tue, 11 Dec 2012 13:45:18 +0000
Message-Id: <E1TiQ98-0005Qq-Ov@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tci: Fix type of
	tci_read_label
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6c5063c7a5bb1d3fe6b9931a1ec15294e39b8b1
Author: Richard Henderson <rth@twiddle.net>
Date:   Mon Nov 19 12:43:14 2012 -0800

    tci: Fix type of tci_read_label
    
    Fixes the pointer truncation that was occurring for branches.
    
    Cc: Stefan Weil <sw@weilnetz.de>
    Cc: Blue Swirl <blauwirbel@gmail.com>
    Signed-off-by: Richard Henderson <rth@twiddle.net>
    Reviewed-by: Stefan Weil <sw@weilnetz.de>
    Tested-by: Stefan Weil <sw@weilnetz.de>
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 tci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tci.c b/tci.c
index 9c87c8e..54cf1d9 100644
--- a/tci.c
+++ b/tci.c
@@ -338,9 +338,9 @@ static uint64_t tci_read_ri64(uint8_t **tb_ptr)
 }
 #endif
 
-static target_ulong tci_read_label(uint8_t **tb_ptr)
+static tcg_target_ulong tci_read_label(uint8_t **tb_ptr)
 {
-    target_ulong label = tci_read_i(tb_ptr);
+    tcg_target_ulong label = tci_read_i(tb_ptr);
     assert(label != 0);
     return label;
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:45:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:45:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ9D-0001yo-Ry; Tue, 11 Dec 2012 13:45:23 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9B-0001yO-R0
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:21 +0000
Received: from [85.158.139.211:15764] by server-1.bemta-5.messagelabs.com id
	7E/D2-12813-0F837C05; Tue, 11 Dec 2012 13:45:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1355233519!18209864!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11066 invoked from network); 11 Dec 2012 13:45:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:45:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ99-0001It-45
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ98-0005Qq-Ov
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:18 +0000
Date: Tue, 11 Dec 2012 13:45:18 +0000
Message-Id: <E1TiQ98-0005Qq-Ov@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tci: Fix type of
	tci_read_label
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6c5063c7a5bb1d3fe6b9931a1ec15294e39b8b1
Author: Richard Henderson <rth@twiddle.net>
Date:   Mon Nov 19 12:43:14 2012 -0800

    tci: Fix type of tci_read_label
    
    Fixes the pointer truncation that was occurring for branches.
    
    Cc: Stefan Weil <sw@weilnetz.de>
    Cc: Blue Swirl <blauwirbel@gmail.com>
    Signed-off-by: Richard Henderson <rth@twiddle.net>
    Reviewed-by: Stefan Weil <sw@weilnetz.de>
    Tested-by: Stefan Weil <sw@weilnetz.de>
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 tci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tci.c b/tci.c
index 9c87c8e..54cf1d9 100644
--- a/tci.c
+++ b/tci.c
@@ -338,9 +338,9 @@ static uint64_t tci_read_ri64(uint8_t **tb_ptr)
 }
 #endif
 
-static target_ulong tci_read_label(uint8_t **tb_ptr)
+static tcg_target_ulong tci_read_label(uint8_t **tb_ptr)
 {
-    target_ulong label = tci_read_i(tb_ptr);
+    tcg_target_ulong label = tci_read_i(tb_ptr);
     assert(label != 0);
     return label;
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:45:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:45:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ9P-00020z-0e; Tue, 11 Dec 2012 13:45:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9N-00020X-Ca
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:33 +0000
Received: from [85.158.139.83:29197] by server-1.bemta-5.messagelabs.com id
	0D/43-12813-CF837C05; Tue, 11 Dec 2012 13:45:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1355233498!25477807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23476 invoked from network); 11 Dec 2012 13:44:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8o-0001Hm-4z
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8n-0005Ow-Sj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:57 +0000
Date: Tue, 11 Dec 2012 13:44:57 +0000
Message-Id: <E1TiQ8n-0005Ow-Sj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tcg: mark local temps as
	MEM in dead_temp()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e5138db510efb61523be92c225d8c65eb985fff0
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sat Nov 24 11:53:55 2012 +0100

    tcg: mark local temps as MEM in dead_temp()
    
    In dead_temp, local temps should always be marked as back to memory,
    even if they have not been allocated (i.e. they are discared before
    cross a basic block).
    
    It fixes the following assertion in target-xtensa:
    
        qemu-system-xtensa: tcg/tcg.c:1665: temp_save: Assertion `s->temps[temp].val_type == 2 || s->temps[temp].fixed_reg' failed.
        Aborted
    
    Reported-by: Max Filippov <jcmvbkbc@gmail.com>
    Tested-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/tcg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 4f75696..cb193f2 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1615,7 +1615,7 @@ static inline void temp_dead(TCGContext *s, int temp)
         if (ts->val_type == TEMP_VAL_REG) {
             s->reg_to_temp[ts->reg] = -1;
         }
-        if (temp < s->nb_globals || (ts->temp_local && ts->mem_allocated)) {
+        if (temp < s->nb_globals || ts->temp_local) {
             ts->val_type = TEMP_VAL_MEM;
         } else {
             ts->val_type = TEMP_VAL_DEAD;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:45:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:45:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ9P-00020z-0e; Tue, 11 Dec 2012 13:45:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9N-00020X-Ca
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:33 +0000
Received: from [85.158.139.83:29197] by server-1.bemta-5.messagelabs.com id
	0D/43-12813-CF837C05; Tue, 11 Dec 2012 13:45:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1355233498!25477807!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23476 invoked from network); 11 Dec 2012 13:44:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:44:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8o-0001Hm-4z
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8n-0005Ow-Sj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:44:57 +0000
Date: Tue, 11 Dec 2012 13:44:57 +0000
Message-Id: <E1TiQ8n-0005Ow-Sj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tcg: mark local temps as
	MEM in dead_temp()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e5138db510efb61523be92c225d8c65eb985fff0
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sat Nov 24 11:53:55 2012 +0100

    tcg: mark local temps as MEM in dead_temp()
    
    In dead_temp, local temps should always be marked as back to memory,
    even if they have not been allocated (i.e. they are discared before
    cross a basic block).
    
    It fixes the following assertion in target-xtensa:
    
        qemu-system-xtensa: tcg/tcg.c:1665: temp_save: Assertion `s->temps[temp].val_type == 2 || s->temps[temp].fixed_reg' failed.
        Aborted
    
    Reported-by: Max Filippov <jcmvbkbc@gmail.com>
    Tested-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/tcg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 4f75696..cb193f2 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1615,7 +1615,7 @@ static inline void temp_dead(TCGContext *s, int temp)
         if (ts->val_type == TEMP_VAL_REG) {
             s->reg_to_temp[ts->reg] = -1;
         }
-        if (temp < s->nb_globals || (ts->temp_local && ts->mem_allocated)) {
+        if (temp < s->nb_globals || ts->temp_local) {
             ts->val_type = TEMP_VAL_MEM;
         } else {
             ts->val_type = TEMP_VAL_DEAD;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:45:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:45:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ9Q-00021B-3f; Tue, 11 Dec 2012 13:45:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9O-00020M-Bw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:34 +0000
Received: from [85.158.139.211:46118] by server-5.bemta-5.messagelabs.com id
	58/DD-22648-BF837C05; Tue, 11 Dec 2012 13:45:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1355233529!20035890!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4640 invoked from network); 11 Dec 2012 13:45:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:45:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9J-0001Iy-Eb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9J-0005RF-9K
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:29 +0000
Date: Tue, 11 Dec 2012 13:45:29 +0000
Message-Id: <E1TiQ9J-0005RF-9K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] block: Fix regression for
	MinGW (assertion caused by short string)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 89c9bc3d147fdaa932db99b0463b4af1d3e7cda1
Author: Stefan Weil <sw@weilnetz.de>
Date:   Thu Nov 22 07:25:48 2012 +0100

    block: Fix regression for MinGW (assertion caused by short string)
    
    The local string tmp_filename is passed to function get_tmp_filename
    which expects a string with minimum size MAX_PATH for w32 hosts.
    
    MAX_PATH is 260 and PATH_MAX is 259, so tmp_filename was too short.
    
    Commit eba25057b9a5e19d10ace2bc7716667a31297169 introduced this
    regression.
    
    Signed-off-by: Stefan Weil <sw@weilnetz.de>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 block.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/block.c b/block.c
index 854ebd6..c05875f 100644
--- a/block.c
+++ b/block.c
@@ -787,7 +787,8 @@ int bdrv_open(BlockDriverState *bs, const char *filename, int flags,
               BlockDriver *drv)
 {
     int ret;
-    char tmp_filename[PATH_MAX];
+    /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
+    char tmp_filename[PATH_MAX + 1];
 
     if (flags & BDRV_O_SNAPSHOT) {
         BlockDriverState *bs1;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:45:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:45:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ9Q-00021B-3f; Tue, 11 Dec 2012 13:45:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9O-00020M-Bw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:34 +0000
Received: from [85.158.139.211:46118] by server-5.bemta-5.messagelabs.com id
	58/DD-22648-BF837C05; Tue, 11 Dec 2012 13:45:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1355233529!20035890!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4640 invoked from network); 11 Dec 2012 13:45:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:45:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9J-0001Iy-Eb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9J-0005RF-9K
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:29 +0000
Date: Tue, 11 Dec 2012 13:45:29 +0000
Message-Id: <E1TiQ9J-0005RF-9K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] block: Fix regression for
	MinGW (assertion caused by short string)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 89c9bc3d147fdaa932db99b0463b4af1d3e7cda1
Author: Stefan Weil <sw@weilnetz.de>
Date:   Thu Nov 22 07:25:48 2012 +0100

    block: Fix regression for MinGW (assertion caused by short string)
    
    The local string tmp_filename is passed to function get_tmp_filename
    which expects a string with minimum size MAX_PATH for w32 hosts.
    
    MAX_PATH is 260 and PATH_MAX is 259, so tmp_filename was too short.
    
    Commit eba25057b9a5e19d10ace2bc7716667a31297169 introduced this
    regression.
    
    Signed-off-by: Stefan Weil <sw@weilnetz.de>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 block.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/block.c b/block.c
index 854ebd6..c05875f 100644
--- a/block.c
+++ b/block.c
@@ -787,7 +787,8 @@ int bdrv_open(BlockDriverState *bs, const char *filename, int flags,
               BlockDriver *drv)
 {
     int ret;
-    char tmp_filename[PATH_MAX];
+    /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
+    char tmp_filename[PATH_MAX + 1];
 
     if (flags & BDRV_O_SNAPSHOT) {
         BlockDriverState *bs1;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:45:55 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:45:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ9f-00024w-U5; Tue, 11 Dec 2012 13:45:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9e-00024Z-QV
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:50 +0000
Received: from [85.158.138.51:61028] by server-13.bemta-3.messagelabs.com id
	73/FA-00465-6E837C05; Tue, 11 Dec 2012 13:45:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1355233508!28474906!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4995 invoked from network); 11 Dec 2012 13:45:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:45:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8y-0001Iq-Jc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8y-0005Py-BT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:08 +0000
Date: Tue, 11 Dec 2012 13:45:08 +0000
Message-Id: <E1TiQ8y-0005Py-BT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-mips: remove
	POOL48A from the microMIPS decoding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 31abf92447353ee09ecad0b3b18e458eef3a1215
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sat Nov 24 13:35:06 2012 +0100

    target-mips: remove POOL48A from the microMIPS decoding
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-mips/translate.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/target-mips/translate.c b/target-mips/translate.c
index 5342591..71c55bc 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -12383,7 +12383,6 @@ static int decode_micromips_opc (CPUMIPSState *env, DisasContext *ctx, int *is_b
         case LB32:
         case LH32:
         case DADDIU32:
-        case POOL48A:           /* ??? */
         case LWC132:
         case LDC132:
         case LD32:
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:45:55 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:45:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ9f-00024w-U5; Tue, 11 Dec 2012 13:45:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9e-00024Z-QV
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:50 +0000
Received: from [85.158.138.51:61028] by server-13.bemta-3.messagelabs.com id
	73/FA-00465-6E837C05; Tue, 11 Dec 2012 13:45:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-174.messagelabs.com!1355233508!28474906!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4995 invoked from network); 11 Dec 2012 13:45:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:45:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8y-0001Iq-Jc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ8y-0005Py-BT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:08 +0000
Date: Tue, 11 Dec 2012 13:45:08 +0000
Message-Id: <E1TiQ8y-0005Py-BT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-mips: remove
	POOL48A from the microMIPS decoding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 31abf92447353ee09ecad0b3b18e458eef3a1215
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sat Nov 24 13:35:06 2012 +0100

    target-mips: remove POOL48A from the microMIPS decoding
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-mips/translate.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/target-mips/translate.c b/target-mips/translate.c
index 5342591..71c55bc 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -12383,7 +12383,6 @@ static int decode_micromips_opc (CPUMIPSState *env, DisasContext *ctx, int *is_b
         case LB32:
         case LH32:
         case DADDIU32:
-        case POOL48A:           /* ??? */
         case LWC132:
         case LDC132:
         case LD32:
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:45:57 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:45:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ9i-00025c-0l; Tue, 11 Dec 2012 13:45:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9g-000254-Ir
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:52 +0000
Received: from [85.158.139.83:2426] by server-13.bemta-5.messagelabs.com id
	47/76-10716-F0937C05; Tue, 11 Dec 2012 13:45:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1355233550!28812856!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29734 invoked from network); 11 Dec 2012 13:45:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:45:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9d-0001JD-S6
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9d-0005So-Pr
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:49 +0000
Date: Tue, 11 Dec 2012 13:45:49 +0000
Message-Id: <E1TiQ9d-0005So-Pr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] chardev: Use real-time
	clock for open timer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 06dec08374a4a4bd882994a3dfd103e314584c4c
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Thu Nov 22 18:30:02 2012 +0100

    chardev: Use real-time clock for open timer
    
    The vm clock may be stopped, and then we won't get open events anymore.
    Seen with QMP sessions.
    
    Reported-by: Dietmar Maurer <dietmar@proxmox.com>
    Tested-by: Luiz Capitulino <lcapitulino@redhat.com>
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 qemu-char.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 88f4025..242b799 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -134,9 +134,9 @@ static void qemu_chr_fire_open_event(void *opaque)
 void qemu_chr_generic_open(CharDriverState *s)
 {
     if (s->open_timer == NULL) {
-        s->open_timer = qemu_new_timer_ms(vm_clock,
+        s->open_timer = qemu_new_timer_ms(rt_clock,
                                           qemu_chr_fire_open_event, s);
-        qemu_mod_timer(s->open_timer, qemu_get_clock_ms(vm_clock) - 1);
+        qemu_mod_timer(s->open_timer, qemu_get_clock_ms(rt_clock) - 1);
     }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:45:57 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:45:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQ9i-00025c-0l; Tue, 11 Dec 2012 13:45:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9g-000254-Ir
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:52 +0000
Received: from [85.158.139.83:2426] by server-13.bemta-5.messagelabs.com id
	47/76-10716-F0937C05; Tue, 11 Dec 2012 13:45:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1355233550!28812856!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29734 invoked from network); 11 Dec 2012 13:45:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:45:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9d-0001JD-S6
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9d-0005So-Pr
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:49 +0000
Date: Tue, 11 Dec 2012 13:45:49 +0000
Message-Id: <E1TiQ9d-0005So-Pr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] chardev: Use real-time
	clock for open timer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 06dec08374a4a4bd882994a3dfd103e314584c4c
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Thu Nov 22 18:30:02 2012 +0100

    chardev: Use real-time clock for open timer
    
    The vm clock may be stopped, and then we won't get open events anymore.
    Seen with QMP sessions.
    
    Reported-by: Dietmar Maurer <dietmar@proxmox.com>
    Tested-by: Luiz Capitulino <lcapitulino@redhat.com>
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 qemu-char.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 88f4025..242b799 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -134,9 +134,9 @@ static void qemu_chr_fire_open_event(void *opaque)
 void qemu_chr_generic_open(CharDriverState *s)
 {
     if (s->open_timer == NULL) {
-        s->open_timer = qemu_new_timer_ms(vm_clock,
+        s->open_timer = qemu_new_timer_ms(rt_clock,
                                           qemu_chr_fire_open_event, s);
-        qemu_mod_timer(s->open_timer, qemu_get_clock_ms(vm_clock) - 1);
+        qemu_mod_timer(s->open_timer, qemu_get_clock_ms(rt_clock) - 1);
     }
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:46:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:46:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQA5-0002Ai-4G; Tue, 11 Dec 2012 13:46:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQA3-0002AN-Ua
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:16 +0000
Received: from [85.158.139.83:4726] by server-3.bemta-5.messagelabs.com id
	00/BF-25441-62937C05; Tue, 11 Dec 2012 13:46:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1355233560!28812903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30456 invoked from network); 11 Dec 2012 13:46:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9o-0001JP-AO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9o-0005TB-1u
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:00 +0000
Date: Tue, 11 Dec 2012 13:46:00 +0000
Message-Id: <E1TiQ9o-0005TB-1u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] vnc: fix option
	misspelling ("non-adapative" -> "non-adaptive")
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7eff57421ff31657434545104b9f91a28e7869ff
Author: Catalin Patulea <catalinp@google.com>
Date:   Fri Nov 9 19:01:26 2012 -0500

    vnc: fix option misspelling ("non-adapative" -> "non-adaptive")
    
    Signed-off-by: Catalin Patulea <catalinp@google.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 ui/vnc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index 61f120e..ba30362 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2945,7 +2945,7 @@ void vnc_display_open(DisplayState *ds, const char *display, Error **errp)
 #endif
         } else if (strncmp(options, "lossy", 5) == 0) {
             vs->lossy = true;
-        } else if (strncmp(options, "non-adapative", 13) == 0) {
+        } else if (strncmp(options, "non-adaptive", 12) == 0) {
             vs->non_adaptive = true;
         } else if (strncmp(options, "share=", 6) == 0) {
             if (strncmp(options+6, "ignore", 6) == 0) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:46:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:46:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQA5-0002Ai-4G; Tue, 11 Dec 2012 13:46:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQA3-0002AN-Ua
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:16 +0000
Received: from [85.158.139.83:4726] by server-3.bemta-5.messagelabs.com id
	00/BF-25441-62937C05; Tue, 11 Dec 2012 13:46:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1355233560!28812903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30456 invoked from network); 11 Dec 2012 13:46:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9o-0001JP-AO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9o-0005TB-1u
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:00 +0000
Date: Tue, 11 Dec 2012 13:46:00 +0000
Message-Id: <E1TiQ9o-0005TB-1u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] vnc: fix option
	misspelling ("non-adapative" -> "non-adaptive")
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7eff57421ff31657434545104b9f91a28e7869ff
Author: Catalin Patulea <catalinp@google.com>
Date:   Fri Nov 9 19:01:26 2012 -0500

    vnc: fix option misspelling ("non-adapative" -> "non-adaptive")
    
    Signed-off-by: Catalin Patulea <catalinp@google.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 ui/vnc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index 61f120e..ba30362 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2945,7 +2945,7 @@ void vnc_display_open(DisplayState *ds, const char *display, Error **errp)
 #endif
         } else if (strncmp(options, "lossy", 5) == 0) {
             vs->lossy = true;
-        } else if (strncmp(options, "non-adapative", 13) == 0) {
+        } else if (strncmp(options, "non-adaptive", 12) == 0) {
             vs->non_adaptive = true;
         } else if (strncmp(options, "share=", 6) == 0) {
             if (strncmp(options+6, "ignore", 6) == 0) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:46:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:46:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQAY-0002Hk-82; Tue, 11 Dec 2012 13:46:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAW-0002HK-6S
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:44 +0000
Received: from [85.158.138.51:14796] by server-13.bemta-3.messagelabs.com id
	43/7D-00465-34937C05; Tue, 11 Dec 2012 13:46:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1355233539!28488499!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26985 invoked from network); 11 Dec 2012 13:45:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:45:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9T-0001J1-Lc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9T-0005SQ-JI
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:39 +0000
Date: Tue, 11 Dec 2012 13:45:39 +0000
Message-Id: <E1TiQ9T-0005SQ-JI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Build system fix distclean
	error for pixman
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a85903ff80f9bfa6390069856a8ec706b0b5ad5a
Author: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Date:   Sat Nov 24 17:27:18 2012 +0800

    Build system fix distclean error for pixman
    
      Currently Makefile test if pixman have configure log, but the script directly
    return error if that file do not exist. This patch fix it.
    
    Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 3e8d441..9ecbcbb 100644
--- a/Makefile
+++ b/Makefile
@@ -286,7 +286,7 @@ distclean: clean
 	for d in $(TARGET_DIRS) $(QEMULIBS); do \
 	rm -rf $$d || exit 1 ; \
         done
-	test -f pixman/config.log && make -C pixman distclean
+	if test -f pixman/config.log; then make -C pixman distclean; fi
 
 KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:46:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:46:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQAY-0002Hk-82; Tue, 11 Dec 2012 13:46:46 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAW-0002HK-6S
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:44 +0000
Received: from [85.158.138.51:14796] by server-13.bemta-3.messagelabs.com id
	43/7D-00465-34937C05; Tue, 11 Dec 2012 13:46:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1355233539!28488499!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26985 invoked from network); 11 Dec 2012 13:45:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:45:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9T-0001J1-Lc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9T-0005SQ-JI
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:45:39 +0000
Date: Tue, 11 Dec 2012 13:45:39 +0000
Message-Id: <E1TiQ9T-0005SQ-JI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Build system fix distclean
	error for pixman
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a85903ff80f9bfa6390069856a8ec706b0b5ad5a
Author: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Date:   Sat Nov 24 17:27:18 2012 +0800

    Build system fix distclean error for pixman
    
      Currently Makefile test if pixman have configure log, but the script directly
    return error if that file do not exist. This patch fix it.
    
    Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
    Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 3e8d441..9ecbcbb 100644
--- a/Makefile
+++ b/Makefile
@@ -286,7 +286,7 @@ distclean: clean
 	for d in $(TARGET_DIRS) $(QEMULIBS); do \
 	rm -rf $$d || exit 1 ; \
         done
-	test -f pixman/config.log && make -C pixman distclean
+	if test -f pixman/config.log; then make -C pixman distclean; fi
 
 KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:46:49 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:46:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQAa-0002IZ-Ak; Tue, 11 Dec 2012 13:46:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAZ-0002Ht-5M
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:47 +0000
Received: from [85.158.138.51:16859] by server-10.bemta-3.messagelabs.com id
	0B/F3-07616-64937C05; Tue, 11 Dec 2012 13:46:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1355233570!28394303!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20578 invoked from network); 11 Dec 2012 13:46:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9y-0001Jv-Ol
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9y-0005Tn-MP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:10 +0000
Date: Tue, 11 Dec 2012 13:46:10 +0000
Message-Id: <E1TiQ9y-0005Tn-MP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tap: reset vnet header
	size on open
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 58ddcd50f30cb5c020bd4f9f36b01ee160a27cac
Author: Michael S. Tsirkin <mst@redhat.com>
Date:   Tue Nov 13 12:23:23 2012 +0200

    tap: reset vnet header size on open
    
    For tap, we currently assume the vnet header size is 10
    (the default value) but that might not be the case
    if tap is persistent and has been used by qemu previously.
    To fix, set host header size in tap device on open.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Tested-by: Alexander Graf <agraf@suse.de>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 net/tap.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/tap.c b/net/tap.c
index df89caa..1abfd44 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -341,6 +341,13 @@ static TAPState *net_tap_fd_init(NetClientState *peer,
     s->using_vnet_hdr = 0;
     s->has_ufo = tap_probe_has_ufo(s->fd);
     tap_set_offload(&s->nc, 0, 0, 0, 0, 0);
+    /*
+     * Make sure host header length is set correctly in tap:
+     * it might have been modified by another instance of qemu.
+     */
+    if (tap_probe_vnet_hdr_len(s->fd, s->host_vnet_hdr_len)) {
+        tap_fd_set_vnet_hdr_len(s->fd, s->host_vnet_hdr_len);
+    }
     tap_read_poll(s, 1);
     s->vhost_net = NULL;
     return s;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:46:49 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:46:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQAa-0002IZ-Ak; Tue, 11 Dec 2012 13:46:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAZ-0002Ht-5M
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:47 +0000
Received: from [85.158.138.51:16859] by server-10.bemta-3.messagelabs.com id
	0B/F3-07616-64937C05; Tue, 11 Dec 2012 13:46:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1355233570!28394303!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20578 invoked from network); 11 Dec 2012 13:46:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9y-0001Jv-Ol
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQ9y-0005Tn-MP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:10 +0000
Date: Tue, 11 Dec 2012 13:46:10 +0000
Message-Id: <E1TiQ9y-0005Tn-MP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tap: reset vnet header
	size on open
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 58ddcd50f30cb5c020bd4f9f36b01ee160a27cac
Author: Michael S. Tsirkin <mst@redhat.com>
Date:   Tue Nov 13 12:23:23 2012 +0200

    tap: reset vnet header size on open
    
    For tap, we currently assume the vnet header size is 10
    (the default value) but that might not be the case
    if tap is persistent and has been used by qemu previously.
    To fix, set host header size in tap device on open.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Tested-by: Alexander Graf <agraf@suse.de>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 net/tap.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/tap.c b/net/tap.c
index df89caa..1abfd44 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -341,6 +341,13 @@ static TAPState *net_tap_fd_init(NetClientState *peer,
     s->using_vnet_hdr = 0;
     s->has_ufo = tap_probe_has_ufo(s->fd);
     tap_set_offload(&s->nc, 0, 0, 0, 0, 0);
+    /*
+     * Make sure host header length is set correctly in tap:
+     * it might have been modified by another instance of qemu.
+     */
+    if (tap_probe_vnet_hdr_len(s->fd, s->host_vnet_hdr_len)) {
+        tap_fd_set_vnet_hdr_len(s->fd, s->host_vnet_hdr_len);
+    }
     tap_read_poll(s, 1);
     s->vhost_net = NULL;
     return s;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:00 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQAl-0002LS-E2; Tue, 11 Dec 2012 13:46:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAj-0002Kn-E9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:57 +0000
Received: from [193.109.254.147:21527] by server-15.bemta-14.messagelabs.com
	id 2C/A7-12105-05937C05; Tue, 11 Dec 2012 13:46:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1355233612!10082230!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8246 invoked from network); 11 Dec 2012 13:46:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAd-0001KG-SK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAd-0005WX-Qc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:51 +0000
Date: Tue, 11 Dec 2012 13:46:51 +0000
Message-Id: <E1TiQAd-0005WX-Qc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] use int64_t for return
	values from rbd instead of int
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 08448d5195aeff49bf25fb62b4a6218f079f5284
Author: Stefan Priebe <s.priebe@profihost.ag>
Date:   Tue Nov 20 13:44:55 2012 +0100

    use int64_t for return values from rbd instead of int
    
    rbd / rados tends to return pretty often length of writes
    or discarded blocks. These values might be bigger than int.
    
    The steps to reproduce are:
    
      mkfs.xfs -f a whole device bigger than int in bytes. mkfs.xfs sends
      a discard. Important is that you use scsi-hd and set
      discard_granularity=512. Otherwise rbd disabled discard support.
    
    Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/rbd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/rbd.c b/block/rbd.c
index 0aaacaf..f3becc7 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -69,7 +69,7 @@ typedef enum {
 typedef struct RBDAIOCB {
     BlockDriverAIOCB common;
     QEMUBH *bh;
-    int ret;
+    int64_t ret;
     QEMUIOVector *qiov;
     char *bounce;
     RBDAIOCmd cmd;
@@ -86,7 +86,7 @@ typedef struct RADOSCB {
     int done;
     int64_t size;
     char *buf;
-    int ret;
+    int64_t ret;
 } RADOSCB;
 
 #define RBD_FD_READ 0
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:00 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQAl-0002LS-E2; Tue, 11 Dec 2012 13:46:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAj-0002Kn-E9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:57 +0000
Received: from [193.109.254.147:21527] by server-15.bemta-14.messagelabs.com
	id 2C/A7-12105-05937C05; Tue, 11 Dec 2012 13:46:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1355233612!10082230!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8246 invoked from network); 11 Dec 2012 13:46:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAd-0001KG-SK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAd-0005WX-Qc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:51 +0000
Date: Tue, 11 Dec 2012 13:46:51 +0000
Message-Id: <E1TiQAd-0005WX-Qc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] use int64_t for return
	values from rbd instead of int
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 08448d5195aeff49bf25fb62b4a6218f079f5284
Author: Stefan Priebe <s.priebe@profihost.ag>
Date:   Tue Nov 20 13:44:55 2012 +0100

    use int64_t for return values from rbd instead of int
    
    rbd / rados tends to return pretty often length of writes
    or discarded blocks. These values might be bigger than int.
    
    The steps to reproduce are:
    
      mkfs.xfs -f a whole device bigger than int in bytes. mkfs.xfs sends
      a discard. Important is that you use scsi-hd and set
      discard_granularity=512. Otherwise rbd disabled discard support.
    
    Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/rbd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/rbd.c b/block/rbd.c
index 0aaacaf..f3becc7 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -69,7 +69,7 @@ typedef enum {
 typedef struct RBDAIOCB {
     BlockDriverAIOCB common;
     QEMUBH *bh;
-    int ret;
+    int64_t ret;
     QEMUIOVector *qiov;
     char *bounce;
     RBDAIOCmd cmd;
@@ -86,7 +86,7 @@ typedef struct RADOSCB {
     int done;
     int64_t size;
     char *buf;
-    int ret;
+    int64_t ret;
 } RADOSCB;
 
 #define RBD_FD_READ 0
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:08 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQAs-0002NN-Hm; Tue, 11 Dec 2012 13:47:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAq-0002Ml-Pw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:05 +0000
Received: from [85.158.137.99:46406] by server-2.bemta-3.messagelabs.com id
	D2/3F-11239-75937C05; Tue, 11 Dec 2012 13:47:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1355233601!18016236!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29591 invoked from network); 11 Dec 2012 13:46:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAT-0001KC-N1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAT-0005W8-Lb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:41 +0000
Date: Tue, 11 Dec 2012 13:46:41 +0000
Message-Id: <E1TiQAT-0005W8-Lb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] vdi: don't override
	libuuid symbols
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ba2aae32c40f544def6be7ae82be9bcb781e01d
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date:   Tue Nov 20 16:34:17 2012 +0100

    vdi: don't override libuuid symbols
    
    It's poor symbol hygiene to provide a global symbols that collide with a
    common library like libuuid.  If QEMU links against a shared library
    that depends on uuid_generate() it can end up calling our stub version
    of the function.
    
    This exact scenario happened with GlusterFS libgfapi.so, which depends
    on libglusterfs.so's uuid_generate().
    
    Scope the uuid stubs for vdi.c only and avoid affecting other shared
    objects.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
 block/vdi.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/block/vdi.c b/block/vdi.c
index f35b12e..c8330b7 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -60,9 +60,6 @@
 /* TODO: move uuid emulation to some central place in QEMU. */
 #include "sysemu.h"     /* UUID_FMT */
 typedef unsigned char uuid_t[16];
-void uuid_generate(uuid_t out);
-int uuid_is_null(const uuid_t uu);
-void uuid_unparse(const uuid_t uu, char *out);
 #endif
 
 /* Code configuration options. */
@@ -124,18 +121,18 @@ void uuid_unparse(const uuid_t uu, char *out);
 #define VDI_IS_ALLOCATED(X) ((X) < VDI_DISCARDED)
 
 #if !defined(CONFIG_UUID)
-void uuid_generate(uuid_t out)
+static inline void uuid_generate(uuid_t out)
 {
     memset(out, 0, sizeof(uuid_t));
 }
 
-int uuid_is_null(const uuid_t uu)
+static inline int uuid_is_null(const uuid_t uu)
 {
     uuid_t null_uuid = { 0 };
     return memcmp(uu, null_uuid, sizeof(uuid_t)) == 0;
 }
 
-void uuid_unparse(const uuid_t uu, char *out)
+static inline void uuid_unparse(const uuid_t uu, char *out)
 {
     snprintf(out, 37, UUID_FMT,
             uu[0], uu[1], uu[2], uu[3], uu[4], uu[5], uu[6], uu[7],
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:08 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQAs-0002NN-Hm; Tue, 11 Dec 2012 13:47:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAq-0002Ml-Pw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:05 +0000
Received: from [85.158.137.99:46406] by server-2.bemta-3.messagelabs.com id
	D2/3F-11239-75937C05; Tue, 11 Dec 2012 13:47:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1355233601!18016236!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29591 invoked from network); 11 Dec 2012 13:46:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAT-0001KC-N1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAT-0005W8-Lb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:41 +0000
Date: Tue, 11 Dec 2012 13:46:41 +0000
Message-Id: <E1TiQAT-0005W8-Lb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] vdi: don't override
	libuuid symbols
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ba2aae32c40f544def6be7ae82be9bcb781e01d
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date:   Tue Nov 20 16:34:17 2012 +0100

    vdi: don't override libuuid symbols
    
    It's poor symbol hygiene to provide a global symbols that collide with a
    common library like libuuid.  If QEMU links against a shared library
    that depends on uuid_generate() it can end up calling our stub version
    of the function.
    
    This exact scenario happened with GlusterFS libgfapi.so, which depends
    on libglusterfs.so's uuid_generate().
    
    Scope the uuid stubs for vdi.c only and avoid affecting other shared
    objects.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
 block/vdi.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/block/vdi.c b/block/vdi.c
index f35b12e..c8330b7 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -60,9 +60,6 @@
 /* TODO: move uuid emulation to some central place in QEMU. */
 #include "sysemu.h"     /* UUID_FMT */
 typedef unsigned char uuid_t[16];
-void uuid_generate(uuid_t out);
-int uuid_is_null(const uuid_t uu);
-void uuid_unparse(const uuid_t uu, char *out);
 #endif
 
 /* Code configuration options. */
@@ -124,18 +121,18 @@ void uuid_unparse(const uuid_t uu, char *out);
 #define VDI_IS_ALLOCATED(X) ((X) < VDI_DISCARDED)
 
 #if !defined(CONFIG_UUID)
-void uuid_generate(uuid_t out)
+static inline void uuid_generate(uuid_t out)
 {
     memset(out, 0, sizeof(uuid_t));
 }
 
-int uuid_is_null(const uuid_t uu)
+static inline int uuid_is_null(const uuid_t uu)
 {
     uuid_t null_uuid = { 0 };
     return memcmp(uu, null_uuid, sizeof(uuid_t)) == 0;
 }
 
-void uuid_unparse(const uuid_t uu, char *out)
+static inline void uuid_unparse(const uuid_t uu, char *out)
 {
     snprintf(out, 37, UUID_FMT,
             uu[0], uu[1], uu[2], uu[3], uu[4], uu[5], uu[6], uu[7],
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:08 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQAs-0002NU-Kg; Tue, 11 Dec 2012 13:47:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAq-0002Mn-Sm
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:05 +0000
Received: from [85.158.139.83:41888] by server-5.bemta-5.messagelabs.com id
	BE/B0-22648-85937C05; Tue, 11 Dec 2012 13:47:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1355233622!25354041!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28073 invoked from network); 11 Dec 2012 13:47:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAo-0001Kr-2n
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAo-0005Wu-1O
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:02 +0000
Date: Tue, 11 Dec 2012 13:47:02 +0000
Message-Id: <E1TiQAo-0005Wu-1O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ide: Fix crash with too
	long PRD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 038268e2e8087ee2fd8987a77ba580e15f14c147
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Tue Nov 20 17:27:43 2012 +0100

    ide: Fix crash with too long PRD
    
    Without this, s->nsector can become negative and badness happens (trying
    to malloc huge amount of memory and glib calls abort())
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/ide/core.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index 7d6b0fa..c2ab787 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -579,6 +579,7 @@ void ide_dma_cb(void *opaque, int ret)
     IDEState *s = opaque;
     int n;
     int64_t sector_num;
+    bool stay_active = false;
 
     if (ret < 0) {
         int op = BM_STATUS_DMA_RETRY;
@@ -594,6 +595,14 @@ void ide_dma_cb(void *opaque, int ret)
     }
 
     n = s->io_buffer_size >> 9;
+    if (n > s->nsector) {
+        /* The PRDs were longer than needed for this request. Shorten them so
+         * we don't get a negative remainder. The Active bit must remain set
+         * after the request completes. */
+        n = s->nsector;
+        stay_active = true;
+    }
+
     sector_num = ide_get_sector(s);
     if (n > 0) {
         dma_buf_commit(s);
@@ -646,6 +655,9 @@ eot:
         bdrv_acct_done(s->bs, &s->acct);
     }
     ide_set_inactive(s);
+    if (stay_active) {
+        s->bus->dma->ops->add_status(s->bus->dma, BM_STATUS_DMAING);
+    }
 }
 
 static void ide_sector_start_dma(IDEState *s, enum ide_dma_cmd dma_cmd)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:08 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQAs-0002NU-Kg; Tue, 11 Dec 2012 13:47:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAq-0002Mn-Sm
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:05 +0000
Received: from [85.158.139.83:41888] by server-5.bemta-5.messagelabs.com id
	BE/B0-22648-85937C05; Tue, 11 Dec 2012 13:47:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1355233622!25354041!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28073 invoked from network); 11 Dec 2012 13:47:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAo-0001Kr-2n
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAo-0005Wu-1O
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:02 +0000
Date: Tue, 11 Dec 2012 13:47:02 +0000
Message-Id: <E1TiQAo-0005Wu-1O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ide: Fix crash with too
	long PRD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 038268e2e8087ee2fd8987a77ba580e15f14c147
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Tue Nov 20 17:27:43 2012 +0100

    ide: Fix crash with too long PRD
    
    Without this, s->nsector can become negative and badness happens (trying
    to malloc huge amount of memory and glib calls abort())
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/ide/core.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index 7d6b0fa..c2ab787 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -579,6 +579,7 @@ void ide_dma_cb(void *opaque, int ret)
     IDEState *s = opaque;
     int n;
     int64_t sector_num;
+    bool stay_active = false;
 
     if (ret < 0) {
         int op = BM_STATUS_DMA_RETRY;
@@ -594,6 +595,14 @@ void ide_dma_cb(void *opaque, int ret)
     }
 
     n = s->io_buffer_size >> 9;
+    if (n > s->nsector) {
+        /* The PRDs were longer than needed for this request. Shorten them so
+         * we don't get a negative remainder. The Active bit must remain set
+         * after the request completes. */
+        n = s->nsector;
+        stay_active = true;
+    }
+
     sector_num = ide_get_sector(s);
     if (n > 0) {
         dma_buf_commit(s);
@@ -646,6 +655,9 @@ eot:
         bdrv_acct_done(s->bs, &s->acct);
     }
     ide_set_inactive(s);
+    if (stay_active) {
+        s->bus->dma->ops->add_status(s->bus->dma, BM_STATUS_DMAING);
+    }
 }
 
 static void ide_sector_start_dma(IDEState *s, enum ide_dma_cmd dma_cmd)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQB2-0002Qa-QZ; Tue, 11 Dec 2012 13:47:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQB1-0002Q5-QX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:15 +0000
Received: from [85.158.139.211:63527] by server-11.bemta-5.messagelabs.com id
	EC/4F-31624-26937C05; Tue, 11 Dec 2012 13:47:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1355233632!19908421!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6182 invoked from network); 11 Dec 2012 13:47:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAy-0001L0-8x
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAy-0005XK-78
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:12 +0000
Date: Tue, 11 Dec 2012 13:47:12 +0000
Message-Id: <E1TiQAy-0005XK-78@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ide: Fix status register
	after short PRDs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 72bcca73c7a67c8506fa737618861ad413dabf38
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Tue Nov 20 17:27:44 2012 +0100

    ide: Fix status register after short PRDs
    
    When failing a request because the length of the regions described by
    the PRDT was too short for the requested number of sectors, the IDE
    emulation forgot to update the status register, so that the device would
    keep the BSY flag set indefinitely.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/ide/core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index c2ab787..8da894f 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -625,6 +625,7 @@ void ide_dma_cb(void *opaque, int ret)
     if (s->bus->dma->ops->prepare_buf(s->bus->dma, ide_cmd_is_read(s)) == 0) {
         /* The PRDs were too short. Reset the Active bit, but don't raise an
          * interrupt. */
+        s->status = READY_STAT | SEEK_STAT;
         goto eot;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQB2-0002Qa-QZ; Tue, 11 Dec 2012 13:47:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQB1-0002Q5-QX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:15 +0000
Received: from [85.158.139.211:63527] by server-11.bemta-5.messagelabs.com id
	EC/4F-31624-26937C05; Tue, 11 Dec 2012 13:47:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1355233632!19908421!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6182 invoked from network); 11 Dec 2012 13:47:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAy-0001L0-8x
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAy-0005XK-78
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:12 +0000
Date: Tue, 11 Dec 2012 13:47:12 +0000
Message-Id: <E1TiQAy-0005XK-78@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ide: Fix status register
	after short PRDs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 72bcca73c7a67c8506fa737618861ad413dabf38
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Tue Nov 20 17:27:44 2012 +0100

    ide: Fix status register after short PRDs
    
    When failing a request because the length of the regions described by
    the PRDT was too short for the requested number of sectors, the IDE
    emulation forgot to update the status register, so that the device would
    keep the BSY flag set indefinitely.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/ide/core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index c2ab787..8da894f 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -625,6 +625,7 @@ void ide_dma_cb(void *opaque, int ret)
     if (s->bus->dma->ops->prepare_buf(s->bus->dma, ide_cmd_is_read(s)) == 0) {
         /* The PRDs were too short. Reset the Active bit, but don't raise an
          * interrupt. */
+        s->status = READY_STAT | SEEK_STAT;
         goto eot;
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQBF-0002TY-Tp; Tue, 11 Dec 2012 13:47:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBE-0002T9-EE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:28 +0000
Received: from [85.158.143.99:20620] by server-3.bemta-4.messagelabs.com id
	97/FC-18211-F6937C05; Tue, 11 Dec 2012 13:47:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1355233591!19362494!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19335 invoked from network); 11 Dec 2012 13:46:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAJ-0001K9-I4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAJ-0005Vj-FV
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:31 +0000
Date: Tue, 11 Dec 2012 13:46:31 +0000
Message-Id: <E1TiQAJ-0005Vj-FV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] block: add bdrv_reopen()
	support for raw hdev, floppy, and cdrom
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1bc6b705eed02dab9feb0e663219b5623f3d684d
Author: Jeff Cody <jcody@redhat.com>
Date:   Tue Nov 20 10:21:10 2012 -0500

    block: add bdrv_reopen() support for raw hdev, floppy, and cdrom
    
    For hdev, floppy, and cdrom, the reopen() handlers are the same as
    for the file reopen handler.  For floppy and cdrom types, however,
    we keep O_NONBLOCK, as in the _open function.
    
    Signed-off-by: Jeff Cody <jcody@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/raw-posix.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index f2f0404..550c81f 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -333,6 +333,10 @@ static int raw_reopen_prepare(BDRVReopenState *state,
     }
 #endif
 
+    if (s->type == FTYPE_FD || s->type == FTYPE_CD) {
+        raw_s->open_flags |= O_NONBLOCK;
+    }
+
     raw_parse_flags(state->flags, &raw_s->open_flags);
 
     raw_s->fd = -1;
@@ -1409,6 +1413,9 @@ static BlockDriver bdrv_host_device = {
     .bdrv_probe_device  = hdev_probe_device,
     .bdrv_file_open     = hdev_open,
     .bdrv_close         = raw_close,
+    .bdrv_reopen_prepare = raw_reopen_prepare,
+    .bdrv_reopen_commit  = raw_reopen_commit,
+    .bdrv_reopen_abort   = raw_reopen_abort,
     .bdrv_create        = hdev_create,
     .create_options     = raw_create_options,
     .bdrv_has_zero_init = hdev_has_zero_init,
@@ -1530,6 +1537,9 @@ static BlockDriver bdrv_host_floppy = {
     .bdrv_probe_device	= floppy_probe_device,
     .bdrv_file_open     = floppy_open,
     .bdrv_close         = raw_close,
+    .bdrv_reopen_prepare = raw_reopen_prepare,
+    .bdrv_reopen_commit  = raw_reopen_commit,
+    .bdrv_reopen_abort   = raw_reopen_abort,
     .bdrv_create        = hdev_create,
     .create_options     = raw_create_options,
     .bdrv_has_zero_init = hdev_has_zero_init,
@@ -1629,6 +1639,9 @@ static BlockDriver bdrv_host_cdrom = {
     .bdrv_probe_device	= cdrom_probe_device,
     .bdrv_file_open     = cdrom_open,
     .bdrv_close         = raw_close,
+    .bdrv_reopen_prepare = raw_reopen_prepare,
+    .bdrv_reopen_commit  = raw_reopen_commit,
+    .bdrv_reopen_abort   = raw_reopen_abort,
     .bdrv_create        = hdev_create,
     .create_options     = raw_create_options,
     .bdrv_has_zero_init = hdev_has_zero_init,
@@ -1748,6 +1761,9 @@ static BlockDriver bdrv_host_cdrom = {
     .bdrv_probe_device	= cdrom_probe_device,
     .bdrv_file_open     = cdrom_open,
     .bdrv_close         = raw_close,
+    .bdrv_reopen_prepare = raw_reopen_prepare,
+    .bdrv_reopen_commit  = raw_reopen_commit,
+    .bdrv_reopen_abort   = raw_reopen_abort,
     .bdrv_create        = hdev_create,
     .create_options     = raw_create_options,
     .bdrv_has_zero_init = hdev_has_zero_init,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQBF-0002TY-Tp; Tue, 11 Dec 2012 13:47:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBE-0002T9-EE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:28 +0000
Received: from [85.158.143.99:20620] by server-3.bemta-4.messagelabs.com id
	97/FC-18211-F6937C05; Tue, 11 Dec 2012 13:47:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1355233591!19362494!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19335 invoked from network); 11 Dec 2012 13:46:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAJ-0001K9-I4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQAJ-0005Vj-FV
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:31 +0000
Date: Tue, 11 Dec 2012 13:46:31 +0000
Message-Id: <E1TiQAJ-0005Vj-FV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] block: add bdrv_reopen()
	support for raw hdev, floppy, and cdrom
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1bc6b705eed02dab9feb0e663219b5623f3d684d
Author: Jeff Cody <jcody@redhat.com>
Date:   Tue Nov 20 10:21:10 2012 -0500

    block: add bdrv_reopen() support for raw hdev, floppy, and cdrom
    
    For hdev, floppy, and cdrom, the reopen() handlers are the same as
    for the file reopen handler.  For floppy and cdrom types, however,
    we keep O_NONBLOCK, as in the _open function.
    
    Signed-off-by: Jeff Cody <jcody@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/raw-posix.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index f2f0404..550c81f 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -333,6 +333,10 @@ static int raw_reopen_prepare(BDRVReopenState *state,
     }
 #endif
 
+    if (s->type == FTYPE_FD || s->type == FTYPE_CD) {
+        raw_s->open_flags |= O_NONBLOCK;
+    }
+
     raw_parse_flags(state->flags, &raw_s->open_flags);
 
     raw_s->fd = -1;
@@ -1409,6 +1413,9 @@ static BlockDriver bdrv_host_device = {
     .bdrv_probe_device  = hdev_probe_device,
     .bdrv_file_open     = hdev_open,
     .bdrv_close         = raw_close,
+    .bdrv_reopen_prepare = raw_reopen_prepare,
+    .bdrv_reopen_commit  = raw_reopen_commit,
+    .bdrv_reopen_abort   = raw_reopen_abort,
     .bdrv_create        = hdev_create,
     .create_options     = raw_create_options,
     .bdrv_has_zero_init = hdev_has_zero_init,
@@ -1530,6 +1537,9 @@ static BlockDriver bdrv_host_floppy = {
     .bdrv_probe_device	= floppy_probe_device,
     .bdrv_file_open     = floppy_open,
     .bdrv_close         = raw_close,
+    .bdrv_reopen_prepare = raw_reopen_prepare,
+    .bdrv_reopen_commit  = raw_reopen_commit,
+    .bdrv_reopen_abort   = raw_reopen_abort,
     .bdrv_create        = hdev_create,
     .create_options     = raw_create_options,
     .bdrv_has_zero_init = hdev_has_zero_init,
@@ -1629,6 +1639,9 @@ static BlockDriver bdrv_host_cdrom = {
     .bdrv_probe_device	= cdrom_probe_device,
     .bdrv_file_open     = cdrom_open,
     .bdrv_close         = raw_close,
+    .bdrv_reopen_prepare = raw_reopen_prepare,
+    .bdrv_reopen_commit  = raw_reopen_commit,
+    .bdrv_reopen_abort   = raw_reopen_abort,
     .bdrv_create        = hdev_create,
     .create_options     = raw_create_options,
     .bdrv_has_zero_init = hdev_has_zero_init,
@@ -1748,6 +1761,9 @@ static BlockDriver bdrv_host_cdrom = {
     .bdrv_probe_device	= cdrom_probe_device,
     .bdrv_file_open     = cdrom_open,
     .bdrv_close         = raw_close,
+    .bdrv_reopen_prepare = raw_reopen_prepare,
+    .bdrv_reopen_commit  = raw_reopen_commit,
+    .bdrv_reopen_abort   = raw_reopen_abort,
     .bdrv_create        = hdev_create,
     .create_options     = raw_create_options,
     .bdrv_has_zero_init = hdev_has_zero_init,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQBN-0002VK-0U; Tue, 11 Dec 2012 13:47:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBL-0002Um-GM
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:35 +0000
Received: from [85.158.139.211:44460] by server-11.bemta-5.messagelabs.com id
	76/10-31624-67937C05; Tue, 11 Dec 2012 13:47:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355233642!19896329!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22975 invoked from network); 11 Dec 2012 13:47:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQB8-0001L6-HX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQB8-0005Xk-De
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:22 +0000
Date: Tue, 11 Dec 2012 13:47:22 +0000
Message-Id: <E1TiQB8-0005Xk-De@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'stefanha/block' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a87470116a169f0c764894e46014a77f5d32a9e
Merge: f8c4382e2cfe9b28b7d652b94712d258c751627b 72bcca73c7a67c8506fa737618861ad413dabf38
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 08:18:25 2012 -0600

    Merge remote-tracking branch 'stefanha/block' into staging
    
    * stefanha/block:
      ide: Fix status register after short PRDs
      ide: Fix crash with too long PRD
      use int64_t for return values from rbd instead of int
      vdi: don't override libuuid symbols
      block: add bdrv_reopen() support for raw hdev, floppy, and cdrom
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 block/raw-posix.c |   16 ++++++++++++++++
 block/rbd.c       |    4 ++--
 block/vdi.c       |    9 +++------
 hw/ide/core.c     |   13 +++++++++++++
 4 files changed, 34 insertions(+), 8 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQBN-0002VK-0U; Tue, 11 Dec 2012 13:47:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBL-0002Um-GM
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:35 +0000
Received: from [85.158.139.211:44460] by server-11.bemta-5.messagelabs.com id
	76/10-31624-67937C05; Tue, 11 Dec 2012 13:47:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355233642!19896329!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22975 invoked from network); 11 Dec 2012 13:47:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQB8-0001L6-HX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQB8-0005Xk-De
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:22 +0000
Date: Tue, 11 Dec 2012 13:47:22 +0000
Message-Id: <E1TiQB8-0005Xk-De@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'stefanha/block' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a87470116a169f0c764894e46014a77f5d32a9e
Merge: f8c4382e2cfe9b28b7d652b94712d258c751627b 72bcca73c7a67c8506fa737618861ad413dabf38
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 08:18:25 2012 -0600

    Merge remote-tracking branch 'stefanha/block' into staging
    
    * stefanha/block:
      ide: Fix status register after short PRDs
      ide: Fix crash with too long PRD
      use int64_t for return values from rbd instead of int
      vdi: don't override libuuid symbols
      block: add bdrv_reopen() support for raw hdev, floppy, and cdrom
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 block/raw-posix.c |   16 ++++++++++++++++
 block/rbd.c       |    4 ++--
 block/vdi.c       |    9 +++------
 hw/ide/core.c     |   13 +++++++++++++
 4 files changed, 34 insertions(+), 8 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQBX-0002XR-3N; Tue, 11 Dec 2012 13:47:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBV-0002X0-KB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:45 +0000
Received: from [85.158.143.35:21163] by server-1.bemta-4.messagelabs.com id
	DF/A6-28401-08937C05; Tue, 11 Dec 2012 13:47:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1355233663!15175436!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27471 invoked from network); 11 Dec 2012 13:47:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBT-0001LH-81
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBT-0005Za-5O
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:43 +0000
Date: Tue, 11 Dec 2012 13:47:43 +0000
Message-Id: <E1TiQBT-0005Za-5O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] spice: add new
	spice-server callbacks to ui/spice-display.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21a50d0b1a0745e485eff3e5aa393cdc4a1980b6
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Wed Nov 21 14:41:48 2012 +0100

    spice: add new spice-server callbacks to ui/spice-display.c
    
    Otherwise qemu crashes with non-qxl graphics cards.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-display.c |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/ui/spice-display.c b/ui/spice-display.c
index 0cc0116..6aff336 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -525,6 +525,37 @@ static int interface_flush_resources(QXLInstance *sin)
     return 0;
 }
 
+static void interface_update_area_complete(QXLInstance *sin,
+        uint32_t surface_id,
+        QXLRect *dirty, uint32_t num_updated_rects)
+{
+    /* should never be called, used in qxl native mode only */
+    fprintf(stderr, "%s: abort()\n", __func__);
+    abort();
+}
+
+/* called from spice server thread context only */
+static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token)
+{
+    /* should never be called, used in qxl native mode only */
+    fprintf(stderr, "%s: abort()\n", __func__);
+    abort();
+}
+
+static void interface_set_client_capabilities(QXLInstance *sin,
+                                              uint8_t client_present,
+                                              uint8_t caps[58])
+{
+    dprint(3, "%s:\n", __func__);
+}
+
+static int interface_client_monitors_config(QXLInstance *sin,
+                                        VDAgentMonitorsConfig *monitors_config)
+{
+    dprint(3, "%s:\n", __func__);
+    return 0; /* == not supported by guest */
+}
+
 static const QXLInterface dpy_interface = {
     .base.type               = SPICE_INTERFACE_QXL,
     .base.description        = "qemu simple display",
@@ -544,6 +575,10 @@ static const QXLInterface dpy_interface = {
     .req_cursor_notification = interface_req_cursor_notification,
     .notify_update           = interface_notify_update,
     .flush_resources         = interface_flush_resources,
+    .async_complete          = interface_async_complete,
+    .update_area_complete    = interface_update_area_complete,
+    .set_client_capabilities = interface_set_client_capabilities,
+    .client_monitors_config  = interface_client_monitors_config,
 };
 
 static SimpleSpiceDisplay sdpy;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQBX-0002XR-3N; Tue, 11 Dec 2012 13:47:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBV-0002X0-KB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:45 +0000
Received: from [85.158.143.35:21163] by server-1.bemta-4.messagelabs.com id
	DF/A6-28401-08937C05; Tue, 11 Dec 2012 13:47:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1355233663!15175436!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27471 invoked from network); 11 Dec 2012 13:47:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBT-0001LH-81
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBT-0005Za-5O
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:43 +0000
Date: Tue, 11 Dec 2012 13:47:43 +0000
Message-Id: <E1TiQBT-0005Za-5O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] spice: add new
	spice-server callbacks to ui/spice-display.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21a50d0b1a0745e485eff3e5aa393cdc4a1980b6
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Wed Nov 21 14:41:48 2012 +0100

    spice: add new spice-server callbacks to ui/spice-display.c
    
    Otherwise qemu crashes with non-qxl graphics cards.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-display.c |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/ui/spice-display.c b/ui/spice-display.c
index 0cc0116..6aff336 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -525,6 +525,37 @@ static int interface_flush_resources(QXLInstance *sin)
     return 0;
 }
 
+static void interface_update_area_complete(QXLInstance *sin,
+        uint32_t surface_id,
+        QXLRect *dirty, uint32_t num_updated_rects)
+{
+    /* should never be called, used in qxl native mode only */
+    fprintf(stderr, "%s: abort()\n", __func__);
+    abort();
+}
+
+/* called from spice server thread context only */
+static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token)
+{
+    /* should never be called, used in qxl native mode only */
+    fprintf(stderr, "%s: abort()\n", __func__);
+    abort();
+}
+
+static void interface_set_client_capabilities(QXLInstance *sin,
+                                              uint8_t client_present,
+                                              uint8_t caps[58])
+{
+    dprint(3, "%s:\n", __func__);
+}
+
+static int interface_client_monitors_config(QXLInstance *sin,
+                                        VDAgentMonitorsConfig *monitors_config)
+{
+    dprint(3, "%s:\n", __func__);
+    return 0; /* == not supported by guest */
+}
+
 static const QXLInterface dpy_interface = {
     .base.type               = SPICE_INTERFACE_QXL,
     .base.description        = "qemu simple display",
@@ -544,6 +575,10 @@ static const QXLInterface dpy_interface = {
     .req_cursor_notification = interface_req_cursor_notification,
     .notify_update           = interface_notify_update,
     .flush_resources         = interface_flush_resources,
+    .async_complete          = interface_async_complete,
+    .update_area_complete    = interface_update_area_complete,
+    .set_client_capabilities = interface_set_client_capabilities,
+    .client_monitors_config  = interface_client_monitors_config,
 };
 
 static SimpleSpiceDisplay sdpy;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:59 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQBj-0002aT-6J; Tue, 11 Dec 2012 13:47:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBh-0002Zs-Kj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:57 +0000
Received: from [85.158.139.83:49166] by server-3.bemta-5.messagelabs.com id
	8A/A2-25441-C8937C05; Tue, 11 Dec 2012 13:47:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1355233581!29244487!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17082 invoked from network); 11 Dec 2012 13:46:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQA8-0001Jy-VH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQA8-0005UB-Sg
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:20 +0000
Date: Tue, 11 Dec 2012 13:46:20 +0000
Message-Id: <E1TiQA8-0005UB-Sg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'stefanha/net' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f8c4382e2cfe9b28b7d652b94712d258c751627b
Merge: 7eff57421ff31657434545104b9f91a28e7869ff 58ddcd50f30cb5c020bd4f9f36b01ee160a27cac
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 08:18:06 2012 -0600

    Merge remote-tracking branch 'stefanha/net' into staging
    
    * stefanha/net:
      tap: reset vnet header size on open
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 net/tap.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:47:59 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:47:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQBj-0002aT-6J; Tue, 11 Dec 2012 13:47:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBh-0002Zs-Kj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:57 +0000
Received: from [85.158.139.83:49166] by server-3.bemta-5.messagelabs.com id
	8A/A2-25441-C8937C05; Tue, 11 Dec 2012 13:47:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1355233581!29244487!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17082 invoked from network); 11 Dec 2012 13:46:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:46:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQA8-0001Jy-VH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQA8-0005UB-Sg
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:46:20 +0000
Date: Tue, 11 Dec 2012 13:46:20 +0000
Message-Id: <E1TiQA8-0005UB-Sg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'stefanha/net' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f8c4382e2cfe9b28b7d652b94712d258c751627b
Merge: 7eff57421ff31657434545104b9f91a28e7869ff 58ddcd50f30cb5c020bd4f9f36b01ee160a27cac
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 08:18:06 2012 -0600

    Merge remote-tracking branch 'stefanha/net' into staging
    
    * stefanha/net:
      tap: reset vnet header size on open
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 net/tap.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQC0-0002dj-9n; Tue, 11 Dec 2012 13:48:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBy-0002dL-Qc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:15 +0000
Received: from [193.109.254.147:30236] by server-14.bemta-14.messagelabs.com
	id 75/E4-14517-E9937C05; Tue, 11 Dec 2012 13:48:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1355233684!1791451!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12164 invoked from network); 11 Dec 2012 13:48:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:48:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBo-0001Lz-5s
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBo-0005bE-3t
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:04 +0000
Date: Tue, 11 Dec 2012 13:48:04 +0000
Message-Id: <E1TiQBo-0005bE-3t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] uhci: Add a
	completions_only flag for async completions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 887938160e5d631c56ee115b1817613a60184138
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:11:49 2012 +0100

    uhci: Add a completions_only flag for async completions
    
    Add a completions_only flag, and set this when running process_frame for async
    completion handling, this fixes 2 issues in a single patch:
    
    1) It makes sure async completed packets get written to guest mem immediately,
    even if all the bandwidth for the frame was consumed from the timer run
    process_frame. This is necessary as delaying their writeback to the next frame
    can cause the completion to get lost on migration.
    
    2) The calling of process_frame from a bh on async completion causes iso
    tds to get server more often they should, messing up usb sound class device
    timing. By only processing completed packets, the iso tds get skipped fixing
    this.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-uhci.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 2838d21..ef32633 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -152,6 +152,7 @@ struct UHCIState {
     QEMUBH *bh;
     uint32_t frame_bytes;
     uint32_t frame_bandwidth;
+    bool completions_only;
     UHCIPort ports[NB_PORTS];
 
     /* Interrupts that should be raised at the end of the current frame.  */
@@ -891,6 +892,10 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr,
         goto done;
     }
 
+    if (s->completions_only) {
+        return TD_RESULT_ASYNC_CONT;
+    }
+
     /* Allocate new packet */
     if (q == NULL) {
         USBDevice *dev = uhci_find_device(s, (td->token >> 8) & 0x7f);
@@ -960,9 +965,9 @@ static void uhci_async_complete(USBPort *port, USBPacket *packet)
     }
 
     async->done = 1;
-    if (s->frame_bytes < s->frame_bandwidth) {
-        qemu_bh_schedule(s->bh);
-    }
+    /* Force processing of this packet *now*, needed for migration */
+    s->completions_only = true;
+    qemu_bh_schedule(s->bh);
 }
 
 static int is_valid(uint32_t link)
@@ -1054,7 +1059,7 @@ static void uhci_process_frame(UHCIState *s)
     qhdb_reset(&qhdb);
 
     for (cnt = FRAME_MAX_LOOPS; is_valid(link) && cnt; cnt--) {
-        if (s->frame_bytes >= s->frame_bandwidth) {
+        if (!s->completions_only && s->frame_bytes >= s->frame_bandwidth) {
             /* We've reached the usb 1.1 bandwidth, which is
                1280 bytes/frame, stop processing */
             trace_usb_uhci_frame_stop_bandwidth();
@@ -1170,6 +1175,7 @@ static void uhci_frame_timer(void *opaque)
     /* prepare the timer for the next frame */
     s->expire_time += (get_ticks_per_sec() / FRAME_TIMER_FREQ);
     s->frame_bytes = 0;
+    s->completions_only = false;
     qemu_bh_cancel(s->bh);
 
     if (!(s->cmd & UHCI_CMD_RS)) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQC0-0002dj-9n; Tue, 11 Dec 2012 13:48:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBy-0002dL-Qc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:15 +0000
Received: from [193.109.254.147:30236] by server-14.bemta-14.messagelabs.com
	id 75/E4-14517-E9937C05; Tue, 11 Dec 2012 13:48:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1355233684!1791451!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12164 invoked from network); 11 Dec 2012 13:48:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:48:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBo-0001Lz-5s
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBo-0005bE-3t
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:04 +0000
Date: Tue, 11 Dec 2012 13:48:04 +0000
Message-Id: <E1TiQBo-0005bE-3t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] uhci: Add a
	completions_only flag for async completions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 887938160e5d631c56ee115b1817613a60184138
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:11:49 2012 +0100

    uhci: Add a completions_only flag for async completions
    
    Add a completions_only flag, and set this when running process_frame for async
    completion handling, this fixes 2 issues in a single patch:
    
    1) It makes sure async completed packets get written to guest mem immediately,
    even if all the bandwidth for the frame was consumed from the timer run
    process_frame. This is necessary as delaying their writeback to the next frame
    can cause the completion to get lost on migration.
    
    2) The calling of process_frame from a bh on async completion causes iso
    tds to get server more often they should, messing up usb sound class device
    timing. By only processing completed packets, the iso tds get skipped fixing
    this.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-uhci.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 2838d21..ef32633 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -152,6 +152,7 @@ struct UHCIState {
     QEMUBH *bh;
     uint32_t frame_bytes;
     uint32_t frame_bandwidth;
+    bool completions_only;
     UHCIPort ports[NB_PORTS];
 
     /* Interrupts that should be raised at the end of the current frame.  */
@@ -891,6 +892,10 @@ static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr,
         goto done;
     }
 
+    if (s->completions_only) {
+        return TD_RESULT_ASYNC_CONT;
+    }
+
     /* Allocate new packet */
     if (q == NULL) {
         USBDevice *dev = uhci_find_device(s, (td->token >> 8) & 0x7f);
@@ -960,9 +965,9 @@ static void uhci_async_complete(USBPort *port, USBPacket *packet)
     }
 
     async->done = 1;
-    if (s->frame_bytes < s->frame_bandwidth) {
-        qemu_bh_schedule(s->bh);
-    }
+    /* Force processing of this packet *now*, needed for migration */
+    s->completions_only = true;
+    qemu_bh_schedule(s->bh);
 }
 
 static int is_valid(uint32_t link)
@@ -1054,7 +1059,7 @@ static void uhci_process_frame(UHCIState *s)
     qhdb_reset(&qhdb);
 
     for (cnt = FRAME_MAX_LOOPS; is_valid(link) && cnt; cnt--) {
-        if (s->frame_bytes >= s->frame_bandwidth) {
+        if (!s->completions_only && s->frame_bytes >= s->frame_bandwidth) {
             /* We've reached the usb 1.1 bandwidth, which is
                1280 bytes/frame, stop processing */
             trace_usb_uhci_frame_stop_bandwidth();
@@ -1170,6 +1175,7 @@ static void uhci_frame_timer(void *opaque)
     /* prepare the timer for the next frame */
     s->expire_time += (get_ticks_per_sec() / FRAME_TIMER_FREQ);
     s->frame_bytes = 0;
+    s->completions_only = false;
     qemu_bh_cancel(s->bh);
 
     if (!(s->cmd & UHCI_CMD_RS)) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQC5-0002ek-Cl; Tue, 11 Dec 2012 13:48:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQC3-0002eP-QH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:19 +0000
Received: from [193.109.254.147:56551] by server-15.bemta-14.messagelabs.com
	id 68/99-12105-3A937C05; Tue, 11 Dec 2012 13:48:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1355233694!4489353!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24481 invoked from network); 11 Dec 2012 13:48:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:48:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBy-0001M6-DD
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBy-0005be-AP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:14 +0000
Date: Tue, 11 Dec 2012 13:48:14 +0000
Message-Id: <E1TiQBy-0005be-AP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] uhci: Don't allow the
	guest to set port-enabled when there is no dev connected
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1cbdde909f70fd15ff85f068a6318b73865c7fa3
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:11:50 2012 +0100

    uhci: Don't allow the guest to set port-enabled when there is no dev connected
    
    It is possible for device disconnect and the guest trying to reset the port
    (because of USB xact errors prior to the disconnect getting signaled) to race,
    when we hit this race, the guest will write the port-control register with its
    pre-disconnect value + the reset bit set, after which we have a disconnected
    device with its port-enabled bit set in its port-control register, which
    is no good :)
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-uhci.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index ef32633..078be2a 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -556,6 +556,10 @@ static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
                 }
             }
             port->ctrl &= UHCI_PORT_READ_ONLY;
+            /* enabled may only be set if a device is connected */
+            if (!(port->ctrl & UHCI_PORT_CCS)) {
+                val &= ~UHCI_PORT_EN;
+            }
             port->ctrl |= (val & ~UHCI_PORT_READ_ONLY);
             /* some bits are reset when a '1' is written to them */
             port->ctrl &= ~(val & UHCI_PORT_WRITE_CLEAR);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQC5-0002ek-Cl; Tue, 11 Dec 2012 13:48:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQC3-0002eP-QH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:19 +0000
Received: from [193.109.254.147:56551] by server-15.bemta-14.messagelabs.com
	id 68/99-12105-3A937C05; Tue, 11 Dec 2012 13:48:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1355233694!4489353!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24481 invoked from network); 11 Dec 2012 13:48:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:48:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBy-0001M6-DD
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBy-0005be-AP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:14 +0000
Date: Tue, 11 Dec 2012 13:48:14 +0000
Message-Id: <E1TiQBy-0005be-AP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] uhci: Don't allow the
	guest to set port-enabled when there is no dev connected
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1cbdde909f70fd15ff85f068a6318b73865c7fa3
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:11:50 2012 +0100

    uhci: Don't allow the guest to set port-enabled when there is no dev connected
    
    It is possible for device disconnect and the guest trying to reset the port
    (because of USB xact errors prior to the disconnect getting signaled) to race,
    when we hit this race, the guest will write the port-control register with its
    pre-disconnect value + the reset bit set, after which we have a disconnected
    device with its port-enabled bit set in its port-control register, which
    is no good :)
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-uhci.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index ef32633..078be2a 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -556,6 +556,10 @@ static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
                 }
             }
             port->ctrl &= UHCI_PORT_READ_ONLY;
+            /* enabled may only be set if a device is connected */
+            if (!(port->ctrl & UHCI_PORT_CCS)) {
+                val &= ~UHCI_PORT_EN;
+            }
             port->ctrl |= (val & ~UHCI_PORT_READ_ONLY);
             /* some bits are reset when a '1' is written to them */
             port->ctrl &= ~(val & UHCI_PORT_WRITE_CLEAR);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCA-0002gE-Hd; Tue, 11 Dec 2012 13:48:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQC9-0002fq-HC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:25 +0000
Received: from [85.158.143.99:33215] by server-1.bemta-4.messagelabs.com id
	0A/A7-28401-8A937C05; Tue, 11 Dec 2012 13:48:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1355233653!25629356!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8327 invoked from network); 11 Dec 2012 13:47:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBJ-0001LB-1Y
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBI-0005ZA-Ur
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:32 +0000
Date: Tue, 11 Dec 2012 13:47:32 +0000
Message-Id: <E1TiQBI-0005ZA-Ur@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Fix the inconsistency in
	x509-dh-key-file parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9995c0b706a2270a49c5bebbcda0b62263a31aa3
Author: Lei Li <lilei@linux.vnet.ibm.com>
Date:   Mon Nov 19 17:15:08 2012 +0800

    Fix the inconsistency in x509-dh-key-file parameter
    
    Commit c448e8552b0f6135dabddf944a7110f929c08320 (spice: tls
    support) added options to the -spice command line. But there
    is an inconsistency between the declaration of the option
    'x509-dh-key-file' to -spice command line and its parameter
    parsing 'x509-dh-file' in function qemu_spice_init.
    
    https://bugs.launchpad.net/qemu/+bug/1035042
    
    Reported-by: Alon Bar-Lev <alon.barlev@gmail.com>
    Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 5147365..261c6f2 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -610,7 +610,7 @@ void qemu_spice_init(void)
         }
 
         x509_key_password = qemu_opt_get(opts, "x509-key-password");
-        x509_dh_file = qemu_opt_get(opts, "x509-dh-file");
+        x509_dh_file = qemu_opt_get(opts, "x509-dh-key-file");
         tls_ciphers = qemu_opt_get(opts, "tls-ciphers");
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCA-0002gE-Hd; Tue, 11 Dec 2012 13:48:26 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQC9-0002fq-HC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:25 +0000
Received: from [85.158.143.99:33215] by server-1.bemta-4.messagelabs.com id
	0A/A7-28401-8A937C05; Tue, 11 Dec 2012 13:48:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1355233653!25629356!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8327 invoked from network); 11 Dec 2012 13:47:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBJ-0001LB-1Y
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBI-0005ZA-Ur
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:32 +0000
Date: Tue, 11 Dec 2012 13:47:32 +0000
Message-Id: <E1TiQBI-0005ZA-Ur@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Fix the inconsistency in
	x509-dh-key-file parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9995c0b706a2270a49c5bebbcda0b62263a31aa3
Author: Lei Li <lilei@linux.vnet.ibm.com>
Date:   Mon Nov 19 17:15:08 2012 +0800

    Fix the inconsistency in x509-dh-key-file parameter
    
    Commit c448e8552b0f6135dabddf944a7110f929c08320 (spice: tls
    support) added options to the -spice command line. But there
    is an inconsistency between the declaration of the option
    'x509-dh-key-file' to -spice command line and its parameter
    parsing 'x509-dh-file' in function qemu_spice_init.
    
    https://bugs.launchpad.net/qemu/+bug/1035042
    
    Reported-by: Alon Bar-Lev <alon.barlev@gmail.com>
    Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/spice-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 5147365..261c6f2 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -610,7 +610,7 @@ void qemu_spice_init(void)
         }
 
         x509_key_password = qemu_opt_get(opts, "x509-key-password");
-        x509_dh_file = qemu_opt_get(opts, "x509-dh-file");
+        x509_dh_file = qemu_opt_get(opts, "x509-dh-key-file");
         tls_ciphers = qemu_opt_get(opts, "tls-ciphers");
     }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCC-0002hC-KR; Tue, 11 Dec 2012 13:48:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCA-0002gF-Vu
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:27 +0000
Received: from [85.158.143.99:64323] by server-3.bemta-4.messagelabs.com id
	51/AE-18211-AA937C05; Tue, 11 Dec 2012 13:48:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1355233704!28854950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15039 invoked from network); 11 Dec 2012 13:48:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:48:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQC8-0001MC-J8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQC8-0005c0-Ho
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:24 +0000
Date: Tue, 11 Dec 2012 13:48:24 +0000
Message-Id: <E1TiQC8-0005c0-Ho@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] uhci: Fix double unlink
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71d2c9cf656cb8b55a71057c1943ade197c1bb5b
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:11:51 2012 +0100

    uhci: Fix double unlink
    
    uhci_async_cancel() already does a uhci_async_unlink().
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-uhci.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 078be2a..8e47803 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -963,7 +963,6 @@ static void uhci_async_complete(USBPort *port, USBPacket *packet)
     UHCIState *s = async->queue->uhci;
 
     if (packet->status == USB_RET_REMOVE_FROM_QUEUE) {
-        uhci_async_unlink(async);
         uhci_async_cancel(async);
         return;
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCC-0002hC-KR; Tue, 11 Dec 2012 13:48:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCA-0002gF-Vu
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:27 +0000
Received: from [85.158.143.99:64323] by server-3.bemta-4.messagelabs.com id
	51/AE-18211-AA937C05; Tue, 11 Dec 2012 13:48:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1355233704!28854950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15039 invoked from network); 11 Dec 2012 13:48:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:48:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQC8-0001MC-J8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQC8-0005c0-Ho
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:24 +0000
Date: Tue, 11 Dec 2012 13:48:24 +0000
Message-Id: <E1TiQC8-0005c0-Ho@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] uhci: Fix double unlink
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71d2c9cf656cb8b55a71057c1943ade197c1bb5b
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:11:51 2012 +0100

    uhci: Fix double unlink
    
    uhci_async_cancel() already does a uhci_async_unlink().
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-uhci.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 078be2a..8e47803 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -963,7 +963,6 @@ static void uhci_async_complete(USBPort *port, USBPacket *packet)
     UHCIState *s = async->queue->uhci;
 
     if (packet->status == USB_RET_REMOVE_FROM_QUEUE) {
-        uhci_async_unlink(async);
         uhci_async_cancel(async);
         return;
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCN-0002kS-NT; Tue, 11 Dec 2012 13:48:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCM-0002jy-Jh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:38 +0000
Received: from [193.109.254.147:36151] by server-16.bemta-14.messagelabs.com
	id B9/F5-09215-5B937C05; Tue, 11 Dec 2012 13:48:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1355233714!2496828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4977 invoked from network); 11 Dec 2012 13:48:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:48:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCI-0001MN-Oy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCI-0005cy-N9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:34 +0000
Date: Tue, 11 Dec 2012 13:48:34 +0000
Message-Id: <E1TiQCI-0005cy-N9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb-bt: Return NAK instead
	of STALL when interrupt ep has no data
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33c1a6856f06fccd7cbfe53e06f9ebbe95bd565f
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:15:01 2012 +0100

    usb-bt: Return NAK instead of STALL when interrupt ep has no data
    
    I noticed this while making all devices with interrupt endpoints properly
    do wakeup. While at it also add wakeup support.
    
    Note that I've not tested this, but returning STALL for an interrupt ep
    which has no data is cleary the wrong thing to do.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/dev-bluetooth.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c
index bfb96bf..39984f5 100644
--- a/hw/usb/dev-bluetooth.c
+++ b/hw/usb/dev-bluetooth.c
@@ -27,6 +27,7 @@
 struct USBBtState {
     USBDevice dev;
     struct HCIInfo *hci;
+    USBEndpoint *intr;
 
     int config;
 
@@ -290,10 +291,7 @@ static inline void usb_bt_fifo_dequeue(struct usb_hci_in_fifo_s *fifo,
 {
     int len;
 
-    if (likely(!fifo->len)) {
-        p->status = USB_RET_STALL;
-        return;
-    }
+    assert(fifo->len != 0);
 
     len = MIN(p->iov.size, fifo->fifo[fifo->start].len);
     usb_packet_copy(p, fifo->fifo[fifo->start].data, len);
@@ -422,14 +420,26 @@ static void usb_bt_handle_data(USBDevice *dev, USBPacket *p)
     case USB_TOKEN_IN:
         switch (p->ep->nr) {
         case USB_EVT_EP:
+            if (s->evt.len == 0) {
+                p->status = USB_RET_NAK;
+                break;
+            }
             usb_bt_fifo_dequeue(&s->evt, p);
             break;
 
         case USB_ACL_EP:
+            if (s->evt.len == 0) {
+                p->status = USB_RET_STALL;
+                break;
+            }
             usb_bt_fifo_dequeue(&s->acl, p);
             break;
 
         case USB_SCO_EP:
+            if (s->evt.len == 0) {
+                p->status = USB_RET_STALL;
+                break;
+            }
             usb_bt_fifo_dequeue(&s->sco, p);
             break;
 
@@ -467,6 +477,9 @@ static void usb_bt_out_hci_packet_event(void *opaque,
 {
     struct USBBtState *s = (struct USBBtState *) opaque;
 
+    if (s->evt.len == 0) {
+        usb_wakeup(s->intr);
+    }
     usb_bt_fifo_enqueue(&s->evt, data, len);
 }
 
@@ -489,8 +502,12 @@ static void usb_bt_handle_destroy(USBDevice *dev)
 
 static int usb_bt_initfn(USBDevice *dev)
 {
+    struct USBBtState *s = DO_UPCAST(struct USBBtState, dev, dev);
+
     usb_desc_create_serial(dev);
     usb_desc_init(dev);
+    s->intr = usb_ep_get(dev, USB_TOKEN_IN, USB_EVT_EP);
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCN-0002kS-NT; Tue, 11 Dec 2012 13:48:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCM-0002jy-Jh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:38 +0000
Received: from [193.109.254.147:36151] by server-16.bemta-14.messagelabs.com
	id B9/F5-09215-5B937C05; Tue, 11 Dec 2012 13:48:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1355233714!2496828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4977 invoked from network); 11 Dec 2012 13:48:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:48:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCI-0001MN-Oy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCI-0005cy-N9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:34 +0000
Date: Tue, 11 Dec 2012 13:48:34 +0000
Message-Id: <E1TiQCI-0005cy-N9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb-bt: Return NAK instead
	of STALL when interrupt ep has no data
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33c1a6856f06fccd7cbfe53e06f9ebbe95bd565f
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:15:01 2012 +0100

    usb-bt: Return NAK instead of STALL when interrupt ep has no data
    
    I noticed this while making all devices with interrupt endpoints properly
    do wakeup. While at it also add wakeup support.
    
    Note that I've not tested this, but returning STALL for an interrupt ep
    which has no data is cleary the wrong thing to do.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/dev-bluetooth.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c
index bfb96bf..39984f5 100644
--- a/hw/usb/dev-bluetooth.c
+++ b/hw/usb/dev-bluetooth.c
@@ -27,6 +27,7 @@
 struct USBBtState {
     USBDevice dev;
     struct HCIInfo *hci;
+    USBEndpoint *intr;
 
     int config;
 
@@ -290,10 +291,7 @@ static inline void usb_bt_fifo_dequeue(struct usb_hci_in_fifo_s *fifo,
 {
     int len;
 
-    if (likely(!fifo->len)) {
-        p->status = USB_RET_STALL;
-        return;
-    }
+    assert(fifo->len != 0);
 
     len = MIN(p->iov.size, fifo->fifo[fifo->start].len);
     usb_packet_copy(p, fifo->fifo[fifo->start].data, len);
@@ -422,14 +420,26 @@ static void usb_bt_handle_data(USBDevice *dev, USBPacket *p)
     case USB_TOKEN_IN:
         switch (p->ep->nr) {
         case USB_EVT_EP:
+            if (s->evt.len == 0) {
+                p->status = USB_RET_NAK;
+                break;
+            }
             usb_bt_fifo_dequeue(&s->evt, p);
             break;
 
         case USB_ACL_EP:
+            if (s->evt.len == 0) {
+                p->status = USB_RET_STALL;
+                break;
+            }
             usb_bt_fifo_dequeue(&s->acl, p);
             break;
 
         case USB_SCO_EP:
+            if (s->evt.len == 0) {
+                p->status = USB_RET_STALL;
+                break;
+            }
             usb_bt_fifo_dequeue(&s->sco, p);
             break;
 
@@ -467,6 +477,9 @@ static void usb_bt_out_hci_packet_event(void *opaque,
 {
     struct USBBtState *s = (struct USBBtState *) opaque;
 
+    if (s->evt.len == 0) {
+        usb_wakeup(s->intr);
+    }
     usb_bt_fifo_enqueue(&s->evt, data, len);
 }
 
@@ -489,8 +502,12 @@ static void usb_bt_handle_destroy(USBDevice *dev)
 
 static int usb_bt_initfn(USBDevice *dev)
 {
+    struct USBBtState *s = DO_UPCAST(struct USBBtState, dev, dev);
+
     usb_desc_create_serial(dev);
     usb_desc_init(dev);
+    s->intr = usb_ep_get(dev, USB_TOKEN_IN, USB_EVT_EP);
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCX-0002nB-Qi; Tue, 11 Dec 2012 13:48:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCW-0002me-DD
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:48 +0000
Received: from [85.158.137.99:15423] by server-14.bemta-3.messagelabs.com id
	64/B4-27443-FB937C05; Tue, 11 Dec 2012 13:48:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1355233725!18581984!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22849 invoked from network); 11 Dec 2012 13:48:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:48:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCS-0001MW-VA
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCS-0005dK-Ta
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:44 +0000
Date: Tue, 11 Dec 2012 13:48:44 +0000
Message-Id: <E1TiQCS-0005dK-Ta@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb-smartcard-reader:
	Properly NAK interrupt eps when we've no events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4020746ff49b2156b4f98672c077d1a3b86fa8b
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:15:02 2012 +0100

    usb-smartcard-reader: Properly NAK interrupt eps when we've no events
    
    When we've no data to return from the interrupt endpoint, return NAK rather
    then a 0 length packet.
    
    CC: Alon Levy <alevy@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/dev-smartcard-reader.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index 190fcd6..de955b7 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -1002,6 +1002,8 @@ static void ccid_handle_data(USBDevice *dev, USBPacket *p)
                         "handle_data: int_in: notify_slot_change %X, "
                         "requested len %zd\n",
                         s->bmSlotICCState, p->iov.size);
+            } else {
+                p->status = USB_RET_NAK;
             }
             break;
         default:
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:48:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:48:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCX-0002nB-Qi; Tue, 11 Dec 2012 13:48:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCW-0002me-DD
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:48 +0000
Received: from [85.158.137.99:15423] by server-14.bemta-3.messagelabs.com id
	64/B4-27443-FB937C05; Tue, 11 Dec 2012 13:48:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1355233725!18581984!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22849 invoked from network); 11 Dec 2012 13:48:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:48:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCS-0001MW-VA
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCS-0005dK-Ta
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:44 +0000
Date: Tue, 11 Dec 2012 13:48:44 +0000
Message-Id: <E1TiQCS-0005dK-Ta@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb-smartcard-reader:
	Properly NAK interrupt eps when we've no events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4020746ff49b2156b4f98672c077d1a3b86fa8b
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:15:02 2012 +0100

    usb-smartcard-reader: Properly NAK interrupt eps when we've no events
    
    When we've no data to return from the interrupt endpoint, return NAK rather
    then a 0 length packet.
    
    CC: Alon Levy <alevy@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/dev-smartcard-reader.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index 190fcd6..de955b7 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -1002,6 +1002,8 @@ static void ccid_handle_data(USBDevice *dev, USBPacket *p)
                         "handle_data: int_in: notify_slot_change %X, "
                         "requested len %zd\n",
                         s->bmSlotICCState, p->iov.size);
+            } else {
+                p->status = USB_RET_NAK;
             }
             break;
         default:
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:49:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:49:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCq-0002qx-Tv; Tue, 11 Dec 2012 13:49:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCp-0002qV-4w
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:07 +0000
Received: from [85.158.143.35:65118] by server-2.bemta-4.messagelabs.com id
	D7/37-30861-2D937C05; Tue, 11 Dec 2012 13:49:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1355233735!13572024!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3978 invoked from network); 11 Dec 2012 13:49:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:49:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCd-0001Mf-5p
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCd-0005di-3T
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:55 +0000
Date: Tue, 11 Dec 2012 13:48:55 +0000
Message-Id: <E1TiQCd-0005di-3T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb-redir: Split
	usb_handle_interrupt_data into separate in/out functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 234e810cce018daf2030e04e399a17b744fa3e0d
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:26:56 2012 +0100

    usb-redir: Split usb_handle_interrupt_data into separate in/out functions
    
    No functional changes.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/redirect.c |  138 +++++++++++++++++++++++++++-------------------------
 1 files changed, 72 insertions(+), 66 deletions(-)

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 0c95e6b..66637a8 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -610,80 +610,82 @@ static void usbredir_handle_bulk_data(USBRedirDevice *dev, USBPacket *p,
     p->status = USB_RET_ASYNC;
 }
 
-static void usbredir_handle_interrupt_data(USBRedirDevice *dev,
-                                           USBPacket *p, uint8_t ep)
+static void usbredir_handle_interrupt_in_data(USBRedirDevice *dev,
+                                              USBPacket *p, uint8_t ep)
 {
-    if (ep & USB_DIR_IN) {
-        /* Input interrupt endpoint, buffered packet input */
-        struct buf_packet *intp;
-        int status, len;
-
-        if (!dev->endpoint[EP2I(ep)].interrupt_started &&
-                !dev->endpoint[EP2I(ep)].interrupt_error) {
-            struct usb_redir_start_interrupt_receiving_header start_int = {
-                .endpoint = ep,
-            };
-            /* No id, we look at the ep when receiving a status back */
-            usbredirparser_send_start_interrupt_receiving(dev->parser, 0,
-                                                          &start_int);
-            usbredirparser_do_write(dev->parser);
-            DPRINTF("interrupt recv started ep %02X\n", ep);
-            dev->endpoint[EP2I(ep)].interrupt_started = 1;
-            /* We don't really want to drop interrupt packets ever, but
-               having some upper limit to how much we buffer is good. */
-            dev->endpoint[EP2I(ep)].bufpq_target_size = 1000;
-            dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 0;
-        }
+    /* Input interrupt endpoint, buffered packet input */
+    struct buf_packet *intp;
+    int status, len;
 
-        intp = QTAILQ_FIRST(&dev->endpoint[EP2I(ep)].bufpq);
-        if (intp == NULL) {
-            DPRINTF2("interrupt-token-in ep %02X, no intp\n", ep);
-            /* Check interrupt_error for stream errors */
-            status = dev->endpoint[EP2I(ep)].interrupt_error;
-            dev->endpoint[EP2I(ep)].interrupt_error = 0;
-            if (status) {
-                usbredir_handle_status(dev, p, status);
-            } else {
-                p->status = USB_RET_NAK;
-            }
-            return;
-        }
-        DPRINTF("interrupt-token-in ep %02X status %d len %d\n", ep,
-                intp->status, intp->len);
+    if (!dev->endpoint[EP2I(ep)].interrupt_started &&
+            !dev->endpoint[EP2I(ep)].interrupt_error) {
+        struct usb_redir_start_interrupt_receiving_header start_int = {
+            .endpoint = ep,
+        };
+        /* No id, we look at the ep when receiving a status back */
+        usbredirparser_send_start_interrupt_receiving(dev->parser, 0,
+                                                      &start_int);
+        usbredirparser_do_write(dev->parser);
+        DPRINTF("interrupt recv started ep %02X\n", ep);
+        dev->endpoint[EP2I(ep)].interrupt_started = 1;
+        /* We don't really want to drop interrupt packets ever, but
+           having some upper limit to how much we buffer is good. */
+        dev->endpoint[EP2I(ep)].bufpq_target_size = 1000;
+        dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 0;
+    }
 
-        status = intp->status;
-        len = intp->len;
-        if (len > p->iov.size) {
-            ERROR("received int data is larger then packet ep %02X\n", ep);
-            len = p->iov.size;
-            status = usb_redir_babble;
+    intp = QTAILQ_FIRST(&dev->endpoint[EP2I(ep)].bufpq);
+    if (intp == NULL) {
+        DPRINTF2("interrupt-token-in ep %02X, no intp\n", ep);
+        /* Check interrupt_error for stream errors */
+        status = dev->endpoint[EP2I(ep)].interrupt_error;
+        dev->endpoint[EP2I(ep)].interrupt_error = 0;
+        if (status) {
+            usbredir_handle_status(dev, p, status);
+        } else {
+            p->status = USB_RET_NAK;
         }
-        usb_packet_copy(p, intp->data, len);
-        bufp_free(dev, intp, ep);
-        usbredir_handle_status(dev, p, status);
-    } else {
-        /* Output interrupt endpoint, normal async operation */
-        struct usb_redir_interrupt_packet_header interrupt_packet;
-        uint8_t buf[p->iov.size];
+        return;
+    }
+    DPRINTF("interrupt-token-in ep %02X status %d len %d\n", ep,
+            intp->status, intp->len);
 
-        DPRINTF("interrupt-out ep %02X len %zd id %"PRIu64"\n", ep,
-                p->iov.size, p->id);
+    status = intp->status;
+    len = intp->len;
+    if (len > p->iov.size) {
+        ERROR("received int data is larger then packet ep %02X\n", ep);
+        len = p->iov.size;
+        status = usb_redir_babble;
+    }
+    usb_packet_copy(p, intp->data, len);
+    bufp_free(dev, intp, ep);
+    usbredir_handle_status(dev, p, status);
+}
 
-        if (usbredir_already_in_flight(dev, p->id)) {
-            p->status = USB_RET_ASYNC;
-            return;
-        }
+static void usbredir_handle_interrupt_out_data(USBRedirDevice *dev,
+                                               USBPacket *p, uint8_t ep)
+{
+    /* Output interrupt endpoint, normal async operation */
+    struct usb_redir_interrupt_packet_header interrupt_packet;
+    uint8_t buf[p->iov.size];
 
-        interrupt_packet.endpoint  = ep;
-        interrupt_packet.length    = p->iov.size;
+    DPRINTF("interrupt-out ep %02X len %zd id %"PRIu64"\n", ep,
+            p->iov.size, p->id);
 
-        usb_packet_copy(p, buf, p->iov.size);
-        usbredir_log_data(dev, "interrupt data out:", buf, p->iov.size);
-        usbredirparser_send_interrupt_packet(dev->parser, p->id,
-                                        &interrupt_packet, buf, p->iov.size);
-        usbredirparser_do_write(dev->parser);
+    if (usbredir_already_in_flight(dev, p->id)) {
         p->status = USB_RET_ASYNC;
+        return;
     }
+
+    interrupt_packet.endpoint  = ep;
+    interrupt_packet.length    = p->iov.size;
+
+    usb_packet_copy(p, buf, p->iov.size);
+    usbredir_log_data(dev, "interrupt data out:", buf, p->iov.size);
+    usbredirparser_send_interrupt_packet(dev->parser, p->id,
+                                    &interrupt_packet, buf, p->iov.size);
+    usbredirparser_do_write(dev->parser);
+    p->status = USB_RET_ASYNC;
 }
 
 static void usbredir_stop_interrupt_receiving(USBRedirDevice *dev,
@@ -729,7 +731,11 @@ static void usbredir_handle_data(USBDevice *udev, USBPacket *p)
         usbredir_handle_bulk_data(dev, p, ep);
         break;
     case USB_ENDPOINT_XFER_INT:
-        usbredir_handle_interrupt_data(dev, p, ep);
+        if (ep & USB_DIR_IN) {
+            usbredir_handle_interrupt_in_data(dev, p, ep);
+        } else {
+            usbredir_handle_interrupt_out_data(dev, p, ep);
+        }
         break;
     default:
         ERROR("handle_data ep %02X has unknown type %d\n", ep,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:49:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:49:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCq-0002qx-Tv; Tue, 11 Dec 2012 13:49:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCp-0002qV-4w
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:07 +0000
Received: from [85.158.143.35:65118] by server-2.bemta-4.messagelabs.com id
	D7/37-30861-2D937C05; Tue, 11 Dec 2012 13:49:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1355233735!13572024!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3978 invoked from network); 11 Dec 2012 13:49:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:49:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCd-0001Mf-5p
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCd-0005di-3T
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:48:55 +0000
Date: Tue, 11 Dec 2012 13:48:55 +0000
Message-Id: <E1TiQCd-0005di-3T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb-redir: Split
	usb_handle_interrupt_data into separate in/out functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 234e810cce018daf2030e04e399a17b744fa3e0d
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:26:56 2012 +0100

    usb-redir: Split usb_handle_interrupt_data into separate in/out functions
    
    No functional changes.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/redirect.c |  138 +++++++++++++++++++++++++++-------------------------
 1 files changed, 72 insertions(+), 66 deletions(-)

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 0c95e6b..66637a8 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -610,80 +610,82 @@ static void usbredir_handle_bulk_data(USBRedirDevice *dev, USBPacket *p,
     p->status = USB_RET_ASYNC;
 }
 
-static void usbredir_handle_interrupt_data(USBRedirDevice *dev,
-                                           USBPacket *p, uint8_t ep)
+static void usbredir_handle_interrupt_in_data(USBRedirDevice *dev,
+                                              USBPacket *p, uint8_t ep)
 {
-    if (ep & USB_DIR_IN) {
-        /* Input interrupt endpoint, buffered packet input */
-        struct buf_packet *intp;
-        int status, len;
-
-        if (!dev->endpoint[EP2I(ep)].interrupt_started &&
-                !dev->endpoint[EP2I(ep)].interrupt_error) {
-            struct usb_redir_start_interrupt_receiving_header start_int = {
-                .endpoint = ep,
-            };
-            /* No id, we look at the ep when receiving a status back */
-            usbredirparser_send_start_interrupt_receiving(dev->parser, 0,
-                                                          &start_int);
-            usbredirparser_do_write(dev->parser);
-            DPRINTF("interrupt recv started ep %02X\n", ep);
-            dev->endpoint[EP2I(ep)].interrupt_started = 1;
-            /* We don't really want to drop interrupt packets ever, but
-               having some upper limit to how much we buffer is good. */
-            dev->endpoint[EP2I(ep)].bufpq_target_size = 1000;
-            dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 0;
-        }
+    /* Input interrupt endpoint, buffered packet input */
+    struct buf_packet *intp;
+    int status, len;
 
-        intp = QTAILQ_FIRST(&dev->endpoint[EP2I(ep)].bufpq);
-        if (intp == NULL) {
-            DPRINTF2("interrupt-token-in ep %02X, no intp\n", ep);
-            /* Check interrupt_error for stream errors */
-            status = dev->endpoint[EP2I(ep)].interrupt_error;
-            dev->endpoint[EP2I(ep)].interrupt_error = 0;
-            if (status) {
-                usbredir_handle_status(dev, p, status);
-            } else {
-                p->status = USB_RET_NAK;
-            }
-            return;
-        }
-        DPRINTF("interrupt-token-in ep %02X status %d len %d\n", ep,
-                intp->status, intp->len);
+    if (!dev->endpoint[EP2I(ep)].interrupt_started &&
+            !dev->endpoint[EP2I(ep)].interrupt_error) {
+        struct usb_redir_start_interrupt_receiving_header start_int = {
+            .endpoint = ep,
+        };
+        /* No id, we look at the ep when receiving a status back */
+        usbredirparser_send_start_interrupt_receiving(dev->parser, 0,
+                                                      &start_int);
+        usbredirparser_do_write(dev->parser);
+        DPRINTF("interrupt recv started ep %02X\n", ep);
+        dev->endpoint[EP2I(ep)].interrupt_started = 1;
+        /* We don't really want to drop interrupt packets ever, but
+           having some upper limit to how much we buffer is good. */
+        dev->endpoint[EP2I(ep)].bufpq_target_size = 1000;
+        dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 0;
+    }
 
-        status = intp->status;
-        len = intp->len;
-        if (len > p->iov.size) {
-            ERROR("received int data is larger then packet ep %02X\n", ep);
-            len = p->iov.size;
-            status = usb_redir_babble;
+    intp = QTAILQ_FIRST(&dev->endpoint[EP2I(ep)].bufpq);
+    if (intp == NULL) {
+        DPRINTF2("interrupt-token-in ep %02X, no intp\n", ep);
+        /* Check interrupt_error for stream errors */
+        status = dev->endpoint[EP2I(ep)].interrupt_error;
+        dev->endpoint[EP2I(ep)].interrupt_error = 0;
+        if (status) {
+            usbredir_handle_status(dev, p, status);
+        } else {
+            p->status = USB_RET_NAK;
         }
-        usb_packet_copy(p, intp->data, len);
-        bufp_free(dev, intp, ep);
-        usbredir_handle_status(dev, p, status);
-    } else {
-        /* Output interrupt endpoint, normal async operation */
-        struct usb_redir_interrupt_packet_header interrupt_packet;
-        uint8_t buf[p->iov.size];
+        return;
+    }
+    DPRINTF("interrupt-token-in ep %02X status %d len %d\n", ep,
+            intp->status, intp->len);
 
-        DPRINTF("interrupt-out ep %02X len %zd id %"PRIu64"\n", ep,
-                p->iov.size, p->id);
+    status = intp->status;
+    len = intp->len;
+    if (len > p->iov.size) {
+        ERROR("received int data is larger then packet ep %02X\n", ep);
+        len = p->iov.size;
+        status = usb_redir_babble;
+    }
+    usb_packet_copy(p, intp->data, len);
+    bufp_free(dev, intp, ep);
+    usbredir_handle_status(dev, p, status);
+}
 
-        if (usbredir_already_in_flight(dev, p->id)) {
-            p->status = USB_RET_ASYNC;
-            return;
-        }
+static void usbredir_handle_interrupt_out_data(USBRedirDevice *dev,
+                                               USBPacket *p, uint8_t ep)
+{
+    /* Output interrupt endpoint, normal async operation */
+    struct usb_redir_interrupt_packet_header interrupt_packet;
+    uint8_t buf[p->iov.size];
 
-        interrupt_packet.endpoint  = ep;
-        interrupt_packet.length    = p->iov.size;
+    DPRINTF("interrupt-out ep %02X len %zd id %"PRIu64"\n", ep,
+            p->iov.size, p->id);
 
-        usb_packet_copy(p, buf, p->iov.size);
-        usbredir_log_data(dev, "interrupt data out:", buf, p->iov.size);
-        usbredirparser_send_interrupt_packet(dev->parser, p->id,
-                                        &interrupt_packet, buf, p->iov.size);
-        usbredirparser_do_write(dev->parser);
+    if (usbredir_already_in_flight(dev, p->id)) {
         p->status = USB_RET_ASYNC;
+        return;
     }
+
+    interrupt_packet.endpoint  = ep;
+    interrupt_packet.length    = p->iov.size;
+
+    usb_packet_copy(p, buf, p->iov.size);
+    usbredir_log_data(dev, "interrupt data out:", buf, p->iov.size);
+    usbredirparser_send_interrupt_packet(dev->parser, p->id,
+                                    &interrupt_packet, buf, p->iov.size);
+    usbredirparser_do_write(dev->parser);
+    p->status = USB_RET_ASYNC;
 }
 
 static void usbredir_stop_interrupt_receiving(USBRedirDevice *dev,
@@ -729,7 +731,11 @@ static void usbredir_handle_data(USBDevice *udev, USBPacket *p)
         usbredir_handle_bulk_data(dev, p, ep);
         break;
     case USB_ENDPOINT_XFER_INT:
-        usbredir_handle_interrupt_data(dev, p, ep);
+        if (ep & USB_DIR_IN) {
+            usbredir_handle_interrupt_in_data(dev, p, ep);
+        } else {
+            usbredir_handle_interrupt_out_data(dev, p, ep);
+        }
         break;
     default:
         ERROR("handle_data ep %02X has unknown type %d\n", ep,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:49:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:49:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCs-0002rK-0M; Tue, 11 Dec 2012 13:49:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCq-0002qg-2q
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:08 +0000
Received: from [85.158.139.211:6779] by server-11.bemta-5.messagelabs.com id
	9A/C3-31624-3D937C05; Tue, 11 Dec 2012 13:49:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1355233745!17438112!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10590 invoked from network); 11 Dec 2012 13:49:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:49:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCn-0001NE-C2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCn-0005e9-9z
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:05 +0000
Date: Tue, 11 Dec 2012 13:49:05 +0000
Message-Id: <E1TiQCn-0005e9-9z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb-redir: Don't handle
	interrupt output packets async
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 723aedd53281cfa0997457cb156a59909a75f5a8
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:26:57 2012 +0100

    usb-redir: Don't handle interrupt output packets async
    
    Instead report them as successfully completed directly on submission, this
    has 2 advantages:
    
    1) This matches the timing of interrupt output packets on real hardware,
    with the previous async handling, if an ep has an interval of say 500 ms,
    then there would be 500+ ms between the submission and the guest seeing the
    completion, as we wont do the write back until the qh gets polled again. And
    in the mean time the guest may very well have timed out, as the guest can
    reasonable expect a much quicker completion.
    
    2) This fixes interrupt output packets potentially getting send twice
    surrounding a migration. As we delay the writeback to guest memory until
    the qh gets polled again, there is a window between completion and writeback
    where migration can happen, in this case the destination will not know
    about the completion, and it will execute the packet *again*
    
    But it does also come with a disadvantage:
    
    1) If the actual interrupt out to the real usb device fails, there is no
    way to report this back to the guest.
    
    This patch assumes however that interrupt outs in practice never fail, as
    they are only used by specialized drivers, which are unlikely to issue illegal
    requests (unlike general class drivers which often issue requests which some
    devices don't implement). And that thus the advantages outway the disadvantage.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/redirect.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 66637a8..490c90f 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -662,21 +662,22 @@ static void usbredir_handle_interrupt_in_data(USBRedirDevice *dev,
     usbredir_handle_status(dev, p, status);
 }
 
+/*
+ * Handle interrupt out data, the usbredir protocol expects us to do this
+ * async, so that it can report back a completion status. But guests will
+ * expect immediate completion for an interrupt endpoint, and handling this
+ * async causes migration issues. So we report success directly, counting
+ * on the fact that output interrupt packets normally always succeed.
+ */
 static void usbredir_handle_interrupt_out_data(USBRedirDevice *dev,
                                                USBPacket *p, uint8_t ep)
 {
-    /* Output interrupt endpoint, normal async operation */
     struct usb_redir_interrupt_packet_header interrupt_packet;
     uint8_t buf[p->iov.size];
 
     DPRINTF("interrupt-out ep %02X len %zd id %"PRIu64"\n", ep,
             p->iov.size, p->id);
 
-    if (usbredir_already_in_flight(dev, p->id)) {
-        p->status = USB_RET_ASYNC;
-        return;
-    }
-
     interrupt_packet.endpoint  = ep;
     interrupt_packet.length    = p->iov.size;
 
@@ -685,7 +686,6 @@ static void usbredir_handle_interrupt_out_data(USBRedirDevice *dev,
     usbredirparser_send_interrupt_packet(dev->parser, p->id,
                                     &interrupt_packet, buf, p->iov.size);
     usbredirparser_do_write(dev->parser);
-    p->status = USB_RET_ASYNC;
 }
 
 static void usbredir_stop_interrupt_receiving(USBRedirDevice *dev,
@@ -1647,11 +1647,13 @@ static void usbredir_interrupt_packet(void *priv, uint64_t id,
         /* bufp_alloc also adds the packet to the ep queue */
         bufp_alloc(dev, data, data_len, interrupt_packet->status, ep);
     } else {
-        USBPacket *p = usbredir_find_packet_by_id(dev, ep, id);
-        if (p) {
-            usbredir_handle_status(dev, p, interrupt_packet->status);
-            p->actual_length = interrupt_packet->length;
-            usb_packet_complete(&dev->dev, p);
+        /*
+         * We report output interrupt packets as completed directly upon
+         * submission, so all we can do here if one failed is warn.
+         */
+        if (interrupt_packet->status) {
+            WARNING("interrupt output failed status %d ep %02X id %"PRIu64"\n",
+                    interrupt_packet->status, ep, id);
         }
     }
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:49:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:49:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCs-0002rK-0M; Tue, 11 Dec 2012 13:49:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCq-0002qg-2q
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:08 +0000
Received: from [85.158.139.211:6779] by server-11.bemta-5.messagelabs.com id
	9A/C3-31624-3D937C05; Tue, 11 Dec 2012 13:49:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1355233745!17438112!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10590 invoked from network); 11 Dec 2012 13:49:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:49:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCn-0001NE-C2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCn-0005e9-9z
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:05 +0000
Date: Tue, 11 Dec 2012 13:49:05 +0000
Message-Id: <E1TiQCn-0005e9-9z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb-redir: Don't handle
	interrupt output packets async
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 723aedd53281cfa0997457cb156a59909a75f5a8
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Sat Nov 17 12:26:57 2012 +0100

    usb-redir: Don't handle interrupt output packets async
    
    Instead report them as successfully completed directly on submission, this
    has 2 advantages:
    
    1) This matches the timing of interrupt output packets on real hardware,
    with the previous async handling, if an ep has an interval of say 500 ms,
    then there would be 500+ ms between the submission and the guest seeing the
    completion, as we wont do the write back until the qh gets polled again. And
    in the mean time the guest may very well have timed out, as the guest can
    reasonable expect a much quicker completion.
    
    2) This fixes interrupt output packets potentially getting send twice
    surrounding a migration. As we delay the writeback to guest memory until
    the qh gets polled again, there is a window between completion and writeback
    where migration can happen, in this case the destination will not know
    about the completion, and it will execute the packet *again*
    
    But it does also come with a disadvantage:
    
    1) If the actual interrupt out to the real usb device fails, there is no
    way to report this back to the guest.
    
    This patch assumes however that interrupt outs in practice never fail, as
    they are only used by specialized drivers, which are unlikely to issue illegal
    requests (unlike general class drivers which often issue requests which some
    devices don't implement). And that thus the advantages outway the disadvantage.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/redirect.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 66637a8..490c90f 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -662,21 +662,22 @@ static void usbredir_handle_interrupt_in_data(USBRedirDevice *dev,
     usbredir_handle_status(dev, p, status);
 }
 
+/*
+ * Handle interrupt out data, the usbredir protocol expects us to do this
+ * async, so that it can report back a completion status. But guests will
+ * expect immediate completion for an interrupt endpoint, and handling this
+ * async causes migration issues. So we report success directly, counting
+ * on the fact that output interrupt packets normally always succeed.
+ */
 static void usbredir_handle_interrupt_out_data(USBRedirDevice *dev,
                                                USBPacket *p, uint8_t ep)
 {
-    /* Output interrupt endpoint, normal async operation */
     struct usb_redir_interrupt_packet_header interrupt_packet;
     uint8_t buf[p->iov.size];
 
     DPRINTF("interrupt-out ep %02X len %zd id %"PRIu64"\n", ep,
             p->iov.size, p->id);
 
-    if (usbredir_already_in_flight(dev, p->id)) {
-        p->status = USB_RET_ASYNC;
-        return;
-    }
-
     interrupt_packet.endpoint  = ep;
     interrupt_packet.length    = p->iov.size;
 
@@ -685,7 +686,6 @@ static void usbredir_handle_interrupt_out_data(USBRedirDevice *dev,
     usbredirparser_send_interrupt_packet(dev->parser, p->id,
                                     &interrupt_packet, buf, p->iov.size);
     usbredirparser_do_write(dev->parser);
-    p->status = USB_RET_ASYNC;
 }
 
 static void usbredir_stop_interrupt_receiving(USBRedirDevice *dev,
@@ -1647,11 +1647,13 @@ static void usbredir_interrupt_packet(void *priv, uint64_t id,
         /* bufp_alloc also adds the packet to the ep queue */
         bufp_alloc(dev, data, data_len, interrupt_packet->status, ep);
     } else {
-        USBPacket *p = usbredir_find_packet_by_id(dev, ep, id);
-        if (p) {
-            usbredir_handle_status(dev, p, interrupt_packet->status);
-            p->actual_length = interrupt_packet->length;
-            usb_packet_complete(&dev->dev, p);
+        /*
+         * We report output interrupt packets as completed directly upon
+         * submission, so all we can do here if one failed is warn.
+         */
+        if (interrupt_packet->status) {
+            WARNING("interrupt output failed status %d ep %02X id %"PRIu64"\n",
+                    interrupt_packet->status, ep, id);
         }
     }
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:49:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:49:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCy-0002tF-5y; Tue, 11 Dec 2012 13:49:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCx-0002sz-Oq
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:15 +0000
Received: from [85.158.143.35:6103] by server-2.bemta-4.messagelabs.com id
	DC/77-30861-BD937C05; Tue, 11 Dec 2012 13:49:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1355233673!14357386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26490 invoked from network); 11 Dec 2012 13:47:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBd-0001LQ-Ib
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBd-0005Zw-DA
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:53 +0000
Date: Tue, 11 Dec 2012 13:47:53 +0000
Message-Id: <E1TiQBd-0005Zw-DA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'spice/spice.v64' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb43a4807ec06307048018d93a7f9e0828308bb5
Merge: 0a87470116a169f0c764894e46014a77f5d32a9e 21a50d0b1a0745e485eff3e5aa393cdc4a1980b6
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 08:19:07 2012 -0600

    Merge remote-tracking branch 'spice/spice.v64' into staging
    
    * spice/spice.v64:
      spice: add new spice-server callbacks to ui/spice-display.c
      Fix the inconsistency in x509-dh-key-file parameter
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 ui/spice-core.c    |    2 +-
 ui/spice-display.c |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:49:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:49:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQCy-0002tF-5y; Tue, 11 Dec 2012 13:49:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCx-0002sz-Oq
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:15 +0000
Received: from [85.158.143.35:6103] by server-2.bemta-4.messagelabs.com id
	DC/77-30861-BD937C05; Tue, 11 Dec 2012 13:49:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1355233673!14357386!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26490 invoked from network); 11 Dec 2012 13:47:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:47:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBd-0001LQ-Ib
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQBd-0005Zw-DA
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:47:53 +0000
Date: Tue, 11 Dec 2012 13:47:53 +0000
Message-Id: <E1TiQBd-0005Zw-DA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'spice/spice.v64' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb43a4807ec06307048018d93a7f9e0828308bb5
Merge: 0a87470116a169f0c764894e46014a77f5d32a9e 21a50d0b1a0745e485eff3e5aa393cdc4a1980b6
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 08:19:07 2012 -0600

    Merge remote-tracking branch 'spice/spice.v64' into staging
    
    * spice/spice.v64:
      spice: add new spice-server callbacks to ui/spice-display.c
      Fix the inconsistency in x509-dh-key-file parameter
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 ui/spice-core.c    |    2 +-
 ui/spice-display.c |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:07 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQDn-00031x-BS; Tue, 11 Dec 2012 13:50:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDm-00031g-Bb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:06 +0000
Received: from [85.158.139.211:15763] by server-4.bemta-5.messagelabs.com id
	1B/97-14693-D0A37C05; Tue, 11 Dec 2012 13:50:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355233800!19896748!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1086 invoked from network); 11 Dec 2012 13:50:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDc-0001Nf-E7
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDZ-0005gp-AF
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:53 +0000
Date: Tue, 11 Dec 2012 13:49:53 +0000
Message-Id: <E1TiQDZ-0005gp-AF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] pc,
	pc_piix: split out pc nic initialization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9011a1a7bbf00deeada3447143bbde7e0a685297
Author: Isaku Yamahata <yamahata@valinux.co.jp>
Date:   Wed Nov 14 15:54:01 2012 -0500

    pc, pc_piix: split out pc nic initialization
    
    Factor out pc nic initialization.
    This simplifies the pc initialization and will reduce the code
    duplication of q35 pc initialization.
    
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/pc.c      |   15 +++++++++++++++
 hw/pc.h      |    1 +
 hw/pc_piix.c |    9 +--------
 3 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 4aca498..04553f8 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1058,6 +1058,21 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
     *floppy = fdctrl_init_isa(isa_bus, fd);
 }
 
+void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus)
+{
+    int i;
+
+    for (i = 0; i < nb_nics; i++) {
+        NICInfo *nd = &nd_table[i];
+
+        if (!pci_bus || (nd->model && strcmp(nd->model, "ne2k_isa") == 0)) {
+            pc_init_ne2k_isa(isa_bus, nd);
+        } else {
+            pci_nic_init_nofail(nd, "e1000", NULL);
+        }
+    }
+}
+
 void pc_pci_device_init(PCIBus *pci_bus)
 {
     int max_bus;
diff --git a/hw/pc.h b/hw/pc.h
index e7993ca..d6639a6 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -98,6 +98,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
                   const char *boot_device,
                   ISADevice *floppy, BusState *ide0, BusState *ide1,
                   ISADevice *s);
+void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus);
 void pc_pci_device_init(PCIBus *pci_bus);
 
 typedef void (*cpu_set_smm_t)(int smm, void *arg);
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index cfa839c..910d417 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -234,14 +234,7 @@ static void pc_init1(MemoryRegion *system_memory,
     /* init basic PC hardware */
     pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled());
 
-    for(i = 0; i < nb_nics; i++) {
-        NICInfo *nd = &nd_table[i];
-
-        if (!pci_enabled || (nd->model && strcmp(nd->model, "ne2k_isa") == 0))
-            pc_init_ne2k_isa(isa_bus, nd);
-        else
-            pci_nic_init_nofail(nd, "e1000", NULL);
-    }
+    pc_nic_init(isa_bus, pci_bus);
 
     ide_drive_get(hd, MAX_IDE_BUS);
     if (pci_enabled) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:07 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQDn-00031x-BS; Tue, 11 Dec 2012 13:50:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDm-00031g-Bb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:06 +0000
Received: from [85.158.139.211:15763] by server-4.bemta-5.messagelabs.com id
	1B/97-14693-D0A37C05; Tue, 11 Dec 2012 13:50:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355233800!19896748!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1086 invoked from network); 11 Dec 2012 13:50:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDc-0001Nf-E7
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDZ-0005gp-AF
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:53 +0000
Date: Tue, 11 Dec 2012 13:49:53 +0000
Message-Id: <E1TiQDZ-0005gp-AF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] pc,
	pc_piix: split out pc nic initialization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9011a1a7bbf00deeada3447143bbde7e0a685297
Author: Isaku Yamahata <yamahata@valinux.co.jp>
Date:   Wed Nov 14 15:54:01 2012 -0500

    pc, pc_piix: split out pc nic initialization
    
    Factor out pc nic initialization.
    This simplifies the pc initialization and will reduce the code
    duplication of q35 pc initialization.
    
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/pc.c      |   15 +++++++++++++++
 hw/pc.h      |    1 +
 hw/pc_piix.c |    9 +--------
 3 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 4aca498..04553f8 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1058,6 +1058,21 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
     *floppy = fdctrl_init_isa(isa_bus, fd);
 }
 
+void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus)
+{
+    int i;
+
+    for (i = 0; i < nb_nics; i++) {
+        NICInfo *nd = &nd_table[i];
+
+        if (!pci_bus || (nd->model && strcmp(nd->model, "ne2k_isa") == 0)) {
+            pc_init_ne2k_isa(isa_bus, nd);
+        } else {
+            pci_nic_init_nofail(nd, "e1000", NULL);
+        }
+    }
+}
+
 void pc_pci_device_init(PCIBus *pci_bus)
 {
     int max_bus;
diff --git a/hw/pc.h b/hw/pc.h
index e7993ca..d6639a6 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -98,6 +98,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
                   const char *boot_device,
                   ISADevice *floppy, BusState *ide0, BusState *ide1,
                   ISADevice *s);
+void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus);
 void pc_pci_device_init(PCIBus *pci_bus);
 
 typedef void (*cpu_set_smm_t)(int smm, void *arg);
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index cfa839c..910d417 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -234,14 +234,7 @@ static void pc_init1(MemoryRegion *system_memory,
     /* init basic PC hardware */
     pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled());
 
-    for(i = 0; i < nb_nics; i++) {
-        NICInfo *nd = &nd_table[i];
-
-        if (!pci_enabled || (nd->model && strcmp(nd->model, "ne2k_isa") == 0))
-            pc_init_ne2k_isa(isa_bus, nd);
-        else
-            pci_nic_init_nofail(nd, "e1000", NULL);
-    }
+    pc_nic_init(isa_bus, pci_bus);
 
     ide_drive_get(hd, MAX_IDE_BUS);
     if (pci_enabled) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQDz-00033X-ER; Tue, 11 Dec 2012 13:50:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDy-00033K-7I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:18 +0000
Received: from [85.158.139.211:49110] by server-6.bemta-5.messagelabs.com id
	63/6E-30498-91A37C05; Tue, 11 Dec 2012 13:50:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355233812!19896796!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2452 invoked from network); 11 Dec 2012 13:50:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDp-0001OH-JI
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDn-0005hE-Bk
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:07 +0000
Date: Tue, 11 Dec 2012 13:50:07 +0000
Message-Id: <E1TiQDn-0005hE-Bk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] pc: Move ioapic_init()
	from pc_piix.c to pc.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a39e356458335418973ca7d388c02712145cd177
Author: Jason Baron <jbaron@redhat.com>
Date:   Wed Nov 14 15:54:01 2012 -0500

    pc: Move ioapic_init() from pc_piix.c to pc.c
    
    Move ioapic_init() from pc_piix.c to pc.c, to make it a common function.
    Rename ioapic_init() -> ioapic_init_gsi().
    Move to pc.h so q35 can use them as well.
    
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/pc.c      |   24 ++++++++++++++++++++++++
 hw/pc.h      |    2 ++
 hw/pc_piix.c |   25 +------------------------
 3 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 04553f8..2b5bbbf 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1083,3 +1083,27 @@ void pc_pci_device_init(PCIBus *pci_bus)
         pci_create_simple(pci_bus, -1, "lsi53c895a");
     }
 }
+
+void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name)
+{
+    DeviceState *dev;
+    SysBusDevice *d;
+    unsigned int i;
+
+    if (kvm_irqchip_in_kernel()) {
+        dev = qdev_create(NULL, "kvm-ioapic");
+    } else {
+        dev = qdev_create(NULL, "ioapic");
+    }
+    if (parent_name) {
+        object_property_add_child(object_resolve_path(parent_name, NULL),
+                                  "ioapic", OBJECT(dev), NULL);
+    }
+    qdev_init_nofail(dev);
+    d = sysbus_from_qdev(dev);
+    sysbus_mmio_map(d, 0, 0xfec00000);
+
+    for (i = 0; i < IOAPIC_NUM_PINS; i++) {
+        gsi_state->ioapic_irq[i] = qdev_get_gpio_in(dev, i);
+    }
+}
diff --git a/hw/pc.h b/hw/pc.h
index d6639a6..2237e86 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -104,6 +104,8 @@ void pc_pci_device_init(PCIBus *pci_bus);
 typedef void (*cpu_set_smm_t)(int smm, void *arg);
 void cpu_smm_register(cpu_set_smm_t callback, void *arg);
 
+void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name);
+
 /* acpi.c */
 extern int acpi_enabled;
 extern char *acpi_tables;
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 910d417..e460799 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -95,29 +95,6 @@ static void kvm_piix3_gsi_handler(void *opaque, int n, int level)
     }
 }
 
-static void ioapic_init(GSIState *gsi_state)
-{
-    DeviceState *dev;
-    SysBusDevice *d;
-    unsigned int i;
-
-    if (kvm_irqchip_in_kernel()) {
-        dev = qdev_create(NULL, "kvm-ioapic");
-    } else {
-        dev = qdev_create(NULL, "ioapic");
-    }
-    /* FIXME: this should be under the piix3.  */
-    object_property_add_child(object_resolve_path("i440fx", NULL),
-                              "ioapic", OBJECT(dev), NULL);
-    qdev_init_nofail(dev);
-    d = sysbus_from_qdev(dev);
-    sysbus_mmio_map(d, 0, 0xfec00000);
-
-    for (i = 0; i < IOAPIC_NUM_PINS; i++) {
-        gsi_state->ioapic_irq[i] = qdev_get_gpio_in(dev, i);
-    }
-}
-
 /* PC hardware initialisation */
 static void pc_init1(MemoryRegion *system_memory,
                      MemoryRegion *system_io,
@@ -221,7 +198,7 @@ static void pc_init1(MemoryRegion *system_memory,
         gsi_state->i8259_irq[i] = i8259[i];
     }
     if (pci_enabled) {
-        ioapic_init(gsi_state);
+        ioapic_init_gsi(gsi_state, "i440fx");
     }
 
     pc_register_ferr_irq(gsi[13]);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQDz-00033X-ER; Tue, 11 Dec 2012 13:50:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDy-00033K-7I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:18 +0000
Received: from [85.158.139.211:49110] by server-6.bemta-5.messagelabs.com id
	63/6E-30498-91A37C05; Tue, 11 Dec 2012 13:50:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355233812!19896796!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2452 invoked from network); 11 Dec 2012 13:50:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDp-0001OH-JI
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDn-0005hE-Bk
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:07 +0000
Date: Tue, 11 Dec 2012 13:50:07 +0000
Message-Id: <E1TiQDn-0005hE-Bk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] pc: Move ioapic_init()
	from pc_piix.c to pc.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a39e356458335418973ca7d388c02712145cd177
Author: Jason Baron <jbaron@redhat.com>
Date:   Wed Nov 14 15:54:01 2012 -0500

    pc: Move ioapic_init() from pc_piix.c to pc.c
    
    Move ioapic_init() from pc_piix.c to pc.c, to make it a common function.
    Rename ioapic_init() -> ioapic_init_gsi().
    Move to pc.h so q35 can use them as well.
    
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/pc.c      |   24 ++++++++++++++++++++++++
 hw/pc.h      |    2 ++
 hw/pc_piix.c |   25 +------------------------
 3 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 04553f8..2b5bbbf 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1083,3 +1083,27 @@ void pc_pci_device_init(PCIBus *pci_bus)
         pci_create_simple(pci_bus, -1, "lsi53c895a");
     }
 }
+
+void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name)
+{
+    DeviceState *dev;
+    SysBusDevice *d;
+    unsigned int i;
+
+    if (kvm_irqchip_in_kernel()) {
+        dev = qdev_create(NULL, "kvm-ioapic");
+    } else {
+        dev = qdev_create(NULL, "ioapic");
+    }
+    if (parent_name) {
+        object_property_add_child(object_resolve_path(parent_name, NULL),
+                                  "ioapic", OBJECT(dev), NULL);
+    }
+    qdev_init_nofail(dev);
+    d = sysbus_from_qdev(dev);
+    sysbus_mmio_map(d, 0, 0xfec00000);
+
+    for (i = 0; i < IOAPIC_NUM_PINS; i++) {
+        gsi_state->ioapic_irq[i] = qdev_get_gpio_in(dev, i);
+    }
+}
diff --git a/hw/pc.h b/hw/pc.h
index d6639a6..2237e86 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -104,6 +104,8 @@ void pc_pci_device_init(PCIBus *pci_bus);
 typedef void (*cpu_set_smm_t)(int smm, void *arg);
 void cpu_smm_register(cpu_set_smm_t callback, void *arg);
 
+void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name);
+
 /* acpi.c */
 extern int acpi_enabled;
 extern char *acpi_tables;
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 910d417..e460799 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -95,29 +95,6 @@ static void kvm_piix3_gsi_handler(void *opaque, int n, int level)
     }
 }
 
-static void ioapic_init(GSIState *gsi_state)
-{
-    DeviceState *dev;
-    SysBusDevice *d;
-    unsigned int i;
-
-    if (kvm_irqchip_in_kernel()) {
-        dev = qdev_create(NULL, "kvm-ioapic");
-    } else {
-        dev = qdev_create(NULL, "ioapic");
-    }
-    /* FIXME: this should be under the piix3.  */
-    object_property_add_child(object_resolve_path("i440fx", NULL),
-                              "ioapic", OBJECT(dev), NULL);
-    qdev_init_nofail(dev);
-    d = sysbus_from_qdev(dev);
-    sysbus_mmio_map(d, 0, 0xfec00000);
-
-    for (i = 0; i < IOAPIC_NUM_PINS; i++) {
-        gsi_state->ioapic_irq[i] = qdev_get_gpio_in(dev, i);
-    }
-}
-
 /* PC hardware initialisation */
 static void pc_init1(MemoryRegion *system_memory,
                      MemoryRegion *system_io,
@@ -221,7 +198,7 @@ static void pc_init1(MemoryRegion *system_memory,
         gsi_state->i8259_irq[i] = i8259[i];
     }
     if (pci_enabled) {
-        ioapic_init(gsi_state);
+        ioapic_init_gsi(gsi_state, "i440fx");
     }
 
     pc_register_ferr_irq(gsi[13]);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEB-00035N-Hq; Tue, 11 Dec 2012 13:50:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEA-000358-Qb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:31 +0000
Received: from [85.158.139.211:22067] by server-10.bemta-5.messagelabs.com id
	83/53-13383-62A37C05; Tue, 11 Dec 2012 13:50:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1355233824!18210818!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3131 invoked from network); 11 Dec 2012 13:50:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQE1-0001OQ-E8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQE0-0005he-74
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:20 +0000
Date: Tue, 11 Dec 2012 13:50:20 +0000
Message-Id: <E1TiQE0-0005he-74@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] pc_piix: Move kvm irq
	routing functions out of pc_piix.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8ee03843fcacfb70c0260af74f20ba9808d4f2e
Author: Jason Baron <jbaron@redhat.com>
Date:   Wed Nov 14 15:54:02 2012 -0500

    pc_piix: Move kvm irq routing functions out of pc_piix.c
    
    Rename: kvm_piix3_gsi_handlei() -> kvm_pc_gsi_handler()
            kvm_piix3_setup_irq_routing() -> kvm_pc_setup_irq_routing()
    
    This is in preparation for other users, namely q35 at this time.
    
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/kvm/ioapic.c |   40 ++++++++++++++++++++++++++++++++++++++++
 hw/pc_piix.c    |   45 ++-------------------------------------------
 kvm.h           |    2 ++
 3 files changed, 44 insertions(+), 43 deletions(-)

diff --git a/hw/kvm/ioapic.c b/hw/kvm/ioapic.c
index 6c3b8fe..f95c157 100644
--- a/hw/kvm/ioapic.c
+++ b/hw/kvm/ioapic.c
@@ -15,6 +15,46 @@
 #include "hw/apic_internal.h"
 #include "kvm.h"
 
+/* PC Utility function */
+void kvm_pc_setup_irq_routing(bool pci_enabled)
+{
+    KVMState *s = kvm_state;
+    int i;
+
+    if (kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) {
+        for (i = 0; i < 8; ++i) {
+            if (i == 2) {
+                continue;
+            }
+            kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_MASTER, i);
+        }
+        for (i = 8; i < 16; ++i) {
+            kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8);
+        }
+        if (pci_enabled) {
+            for (i = 0; i < 24; ++i) {
+                if (i == 0) {
+                    kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2);
+                } else if (i != 2) {
+                    kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, i);
+                }
+            }
+        }
+    }
+}
+
+void kvm_pc_gsi_handler(void *opaque, int n, int level)
+{
+    GSIState *s = opaque;
+
+    if (n < ISA_NUM_IRQS) {
+        /* Kernel will forward to both PIC and IOAPIC */
+        qemu_set_irq(s->i8259_irq[n], level);
+    } else {
+        qemu_set_irq(s->ioapic_irq[n], level);
+    }
+}
+
 typedef struct KVMIOAPICState KVMIOAPICState;
 
 struct KVMIOAPICState {
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index e460799..aa3e7f4 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -54,47 +54,6 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
 static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
 static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
-static void kvm_piix3_setup_irq_routing(bool pci_enabled)
-{
-#ifdef CONFIG_KVM
-    KVMState *s = kvm_state;
-    int i;
-
-    if (kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) {
-        for (i = 0; i < 8; ++i) {
-            if (i == 2) {
-                continue;
-            }
-            kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_MASTER, i);
-        }
-        for (i = 8; i < 16; ++i) {
-            kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8);
-        }
-        if (pci_enabled) {
-            for (i = 0; i < 24; ++i) {
-                if (i == 0) {
-                    kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2);
-                } else if (i != 2) {
-                    kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, i);
-                }
-            }
-        }
-    }
-#endif /* CONFIG_KVM */
-}
-
-static void kvm_piix3_gsi_handler(void *opaque, int n, int level)
-{
-    GSIState *s = opaque;
-
-    if (n < ISA_NUM_IRQS) {
-        /* Kernel will forward to both PIC and IOAPIC */
-        qemu_set_irq(s->i8259_irq[n], level);
-    } else {
-        qemu_set_irq(s->ioapic_irq[n], level);
-    }
-}
-
 /* PC hardware initialisation */
 static void pc_init1(MemoryRegion *system_memory,
                      MemoryRegion *system_io,
@@ -160,8 +119,8 @@ static void pc_init1(MemoryRegion *system_memory,
 
     gsi_state = g_malloc0(sizeof(*gsi_state));
     if (kvm_irqchip_in_kernel()) {
-        kvm_piix3_setup_irq_routing(pci_enabled);
-        gsi = qemu_allocate_irqs(kvm_piix3_gsi_handler, gsi_state,
+        kvm_pc_setup_irq_routing(pci_enabled);
+        gsi = qemu_allocate_irqs(kvm_pc_gsi_handler, gsi_state,
                                  GSI_NUM_PINS);
     } else {
         gsi = qemu_allocate_irqs(gsi_handler, gsi_state, GSI_NUM_PINS);
diff --git a/kvm.h b/kvm.h
index 1e7f244..72d866a 100644
--- a/kvm.h
+++ b/kvm.h
@@ -275,4 +275,6 @@ void kvm_irqchip_release_virq(KVMState *s, int virq);
 
 int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, int virq);
 int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, int virq);
+void kvm_pc_gsi_handler(void *opaque, int n, int level);
+void kvm_pc_setup_irq_routing(bool pci_enabled);
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEB-00035N-Hq; Tue, 11 Dec 2012 13:50:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEA-000358-Qb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:31 +0000
Received: from [85.158.139.211:22067] by server-10.bemta-5.messagelabs.com id
	83/53-13383-62A37C05; Tue, 11 Dec 2012 13:50:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1355233824!18210818!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3131 invoked from network); 11 Dec 2012 13:50:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQE1-0001OQ-E8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQE0-0005he-74
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:20 +0000
Date: Tue, 11 Dec 2012 13:50:20 +0000
Message-Id: <E1TiQE0-0005he-74@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] pc_piix: Move kvm irq
	routing functions out of pc_piix.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8ee03843fcacfb70c0260af74f20ba9808d4f2e
Author: Jason Baron <jbaron@redhat.com>
Date:   Wed Nov 14 15:54:02 2012 -0500

    pc_piix: Move kvm irq routing functions out of pc_piix.c
    
    Rename: kvm_piix3_gsi_handlei() -> kvm_pc_gsi_handler()
            kvm_piix3_setup_irq_routing() -> kvm_pc_setup_irq_routing()
    
    This is in preparation for other users, namely q35 at this time.
    
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/kvm/ioapic.c |   40 ++++++++++++++++++++++++++++++++++++++++
 hw/pc_piix.c    |   45 ++-------------------------------------------
 kvm.h           |    2 ++
 3 files changed, 44 insertions(+), 43 deletions(-)

diff --git a/hw/kvm/ioapic.c b/hw/kvm/ioapic.c
index 6c3b8fe..f95c157 100644
--- a/hw/kvm/ioapic.c
+++ b/hw/kvm/ioapic.c
@@ -15,6 +15,46 @@
 #include "hw/apic_internal.h"
 #include "kvm.h"
 
+/* PC Utility function */
+void kvm_pc_setup_irq_routing(bool pci_enabled)
+{
+    KVMState *s = kvm_state;
+    int i;
+
+    if (kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) {
+        for (i = 0; i < 8; ++i) {
+            if (i == 2) {
+                continue;
+            }
+            kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_MASTER, i);
+        }
+        for (i = 8; i < 16; ++i) {
+            kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8);
+        }
+        if (pci_enabled) {
+            for (i = 0; i < 24; ++i) {
+                if (i == 0) {
+                    kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2);
+                } else if (i != 2) {
+                    kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, i);
+                }
+            }
+        }
+    }
+}
+
+void kvm_pc_gsi_handler(void *opaque, int n, int level)
+{
+    GSIState *s = opaque;
+
+    if (n < ISA_NUM_IRQS) {
+        /* Kernel will forward to both PIC and IOAPIC */
+        qemu_set_irq(s->i8259_irq[n], level);
+    } else {
+        qemu_set_irq(s->ioapic_irq[n], level);
+    }
+}
+
 typedef struct KVMIOAPICState KVMIOAPICState;
 
 struct KVMIOAPICState {
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index e460799..aa3e7f4 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -54,47 +54,6 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
 static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
 static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
-static void kvm_piix3_setup_irq_routing(bool pci_enabled)
-{
-#ifdef CONFIG_KVM
-    KVMState *s = kvm_state;
-    int i;
-
-    if (kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) {
-        for (i = 0; i < 8; ++i) {
-            if (i == 2) {
-                continue;
-            }
-            kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_MASTER, i);
-        }
-        for (i = 8; i < 16; ++i) {
-            kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8);
-        }
-        if (pci_enabled) {
-            for (i = 0; i < 24; ++i) {
-                if (i == 0) {
-                    kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2);
-                } else if (i != 2) {
-                    kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, i);
-                }
-            }
-        }
-    }
-#endif /* CONFIG_KVM */
-}
-
-static void kvm_piix3_gsi_handler(void *opaque, int n, int level)
-{
-    GSIState *s = opaque;
-
-    if (n < ISA_NUM_IRQS) {
-        /* Kernel will forward to both PIC and IOAPIC */
-        qemu_set_irq(s->i8259_irq[n], level);
-    } else {
-        qemu_set_irq(s->ioapic_irq[n], level);
-    }
-}
-
 /* PC hardware initialisation */
 static void pc_init1(MemoryRegion *system_memory,
                      MemoryRegion *system_io,
@@ -160,8 +119,8 @@ static void pc_init1(MemoryRegion *system_memory,
 
     gsi_state = g_malloc0(sizeof(*gsi_state));
     if (kvm_irqchip_in_kernel()) {
-        kvm_piix3_setup_irq_routing(pci_enabled);
-        gsi = qemu_allocate_irqs(kvm_piix3_gsi_handler, gsi_state,
+        kvm_pc_setup_irq_routing(pci_enabled);
+        gsi = qemu_allocate_irqs(kvm_pc_gsi_handler, gsi_state,
                                  GSI_NUM_PINS);
     } else {
         gsi = qemu_allocate_irqs(gsi_handler, gsi_state, GSI_NUM_PINS);
diff --git a/kvm.h b/kvm.h
index 1e7f244..72d866a 100644
--- a/kvm.h
+++ b/kvm.h
@@ -275,4 +275,6 @@ void kvm_irqchip_release_virq(KVMState *s, int virq);
 
 int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, int virq);
 int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, int virq);
+void kvm_pc_gsi_handler(void *opaque, int n, int level);
+void kvm_pc_setup_irq_routing(bool pci_enabled);
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEG-00036J-Kg; Tue, 11 Dec 2012 13:50:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEF-000362-7C
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:35 +0000
Received: from [85.158.139.83:12924] by server-9.bemta-5.messagelabs.com id
	60/84-10690-A2A37C05; Tue, 11 Dec 2012 13:50:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1355233832!27624317!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25863 invoked from network); 11 Dec 2012 13:50:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEC-0001OV-5p
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEC-0005iZ-2h
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:32 +0000
Date: Tue, 11 Dec 2012 13:50:32 +0000
Message-Id: <E1TiQEC-0005iZ-2h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] pc/piix_pci: factor out
	smram/pam logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 410edd922d2a90c79cd92b086c0e53650ea52c02
Author: Isaku Yamahata <yamahata@valinux.co.jp>
Date:   Wed Nov 14 15:54:02 2012 -0500

    pc/piix_pci: factor out smram/pam logic
    
    Factor out smram/pam logic for use by other chipsets, namely q35
    at this point.
    
    Note: Should be factored out into a generic North Bridge Class.
    
    [jbaron@redhat.com: changes for updated memory API]
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/Makefile.objs |    1 +
 hw/pam.c         |   87 ++++++++++++++++++++++++++++++++++++++++++++++++
 hw/pam.h         |   97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/piix_pci.c    |   68 ++++++++-----------------------------
 4 files changed, 200 insertions(+), 53 deletions(-)

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index ea46f81..5ebe6af 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -38,6 +38,7 @@ common-obj-$(CONFIG_SMARTCARD) += ccid-card-passthru.o
 common-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o
 common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
 common-obj-y += fifo.o
+common-obj-y += pam.o
 
 # PPC devices
 common-obj-$(CONFIG_PREP_PCI) += prep_pci.o
diff --git a/hw/pam.c b/hw/pam.c
new file mode 100644
index 0000000..a95e2cf
--- /dev/null
+++ b/hw/pam.c
@@ -0,0 +1,87 @@
+/*
+ * QEMU i440FX/PIIX3 PCI Bridge Emulation
+ *
+ * Copyright (c) 2006 Fabrice Bellard
+ * Copyright (c) 2011 Isaku Yamahata <yamahata at valinux co jp>
+ *                    VA Linux Systems Japan K.K.
+ * Copyright (c) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * Split out from piix_pci.c
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#include "sysemu.h"
+#include "pam.h"
+
+void smram_update(MemoryRegion *smram_region, uint8_t smram,
+                  uint8_t smm_enabled)
+{
+    bool smram_enabled;
+
+    smram_enabled = ((smm_enabled && (smram & SMRAM_G_SMRAME)) ||
+                        (smram & SMRAM_D_OPEN));
+    memory_region_set_enabled(smram_region, !smram_enabled);
+}
+
+void smram_set_smm(uint8_t *host_smm_enabled, int smm, uint8_t smram,
+                   MemoryRegion *smram_region)
+{
+    uint8_t smm_enabled = (smm != 0);
+    if (*host_smm_enabled != smm_enabled) {
+        *host_smm_enabled = smm_enabled;
+        smram_update(smram_region, smram, *host_smm_enabled);
+    }
+}
+
+void init_pam(MemoryRegion *ram_memory, MemoryRegion *system_memory,
+              MemoryRegion *pci_address_space, PAMMemoryRegion *mem,
+              uint32_t start, uint32_t size)
+{
+    int i;
+
+    /* RAM */
+    memory_region_init_alias(&mem->alias[3], "pam-ram", ram_memory,
+                             start, size);
+    /* ROM (XXX: not quite correct) */
+    memory_region_init_alias(&mem->alias[1], "pam-rom", ram_memory,
+                             start, size);
+    memory_region_set_readonly(&mem->alias[1], true);
+
+    /* XXX: should distinguish read/write cases */
+    memory_region_init_alias(&mem->alias[0], "pam-pci", pci_address_space,
+                             start, size);
+    memory_region_init_alias(&mem->alias[2], "pam-pci", pci_address_space,
+                             start, size);
+
+    for (i = 0; i < 4; ++i) {
+        memory_region_set_enabled(&mem->alias[i], false);
+        memory_region_add_subregion_overlap(system_memory, start,
+                                            &mem->alias[i], 1);
+    }
+    mem->current = 0;
+}
+
+void pam_update(PAMMemoryRegion *pam, int idx, uint8_t val)
+{
+    assert(0 <= idx && idx <= 12);
+
+    memory_region_set_enabled(&pam->alias[pam->current], false);
+    pam->current = (val >> ((!(idx & 1)) * 4)) & PAM_ATTR_MASK;
+    memory_region_set_enabled(&pam->alias[pam->current], true);
+}
diff --git a/hw/pam.h b/hw/pam.h
new file mode 100644
index 0000000..2d77ebe
--- /dev/null
+++ b/hw/pam.h
@@ -0,0 +1,97 @@
+#ifndef QEMU_PAM_H
+#define QEMU_PAM_H
+
+/*
+ * Copyright (c) 2006 Fabrice Bellard
+ * Copyright (c) 2011 Isaku Yamahata <yamahata at valinux co jp>
+ *               VA Linux Systems Japan K.K.
+ * Copyright (c) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * Split out from piix_pci.c
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/*
+ * SMRAM memory area and PAM memory area in Legacy address range for PC.
+ * PAM: Programmable Attribute Map registers
+ *
+ * 0xa0000 - 0xbffff compatible SMRAM
+ *
+ * 0xc0000 - 0xc3fff Expansion area memory segments
+ * 0xc4000 - 0xc7fff
+ * 0xc8000 - 0xcbfff
+ * 0xcc000 - 0xcffff
+ * 0xd0000 - 0xd3fff
+ * 0xd4000 - 0xd7fff
+ * 0xd8000 - 0xdbfff
+ * 0xdc000 - 0xdffff
+ * 0xe0000 - 0xe3fff Extended System BIOS Area Memory Segments
+ * 0xe4000 - 0xe7fff
+ * 0xe8000 - 0xebfff
+ * 0xec000 - 0xeffff
+ *
+ * 0xf0000 - 0xfffff System BIOS Area Memory Segments
+ */
+
+#include "qemu-common.h"
+#include "memory.h"
+
+#define SMRAM_C_BASE    0xa0000
+#define SMRAM_C_END     0xc0000
+#define SMRAM_C_SIZE    0x20000
+
+#define PAM_EXPAN_BASE  0xc0000
+#define PAM_EXPAN_SIZE  0x04000
+
+#define PAM_EXBIOS_BASE 0xe0000
+#define PAM_EXBIOS_SIZE 0x04000
+
+#define PAM_BIOS_BASE   0xf0000
+#define PAM_BIOS_END    0xfffff
+/* 64KB: Intel 3 series express chipset family p. 58*/
+#define PAM_BIOS_SIZE   0x10000
+
+/* PAM registers: log nibble and high nibble*/
+#define PAM_ATTR_WE     ((uint8_t)2)
+#define PAM_ATTR_RE     ((uint8_t)1)
+#define PAM_ATTR_MASK   ((uint8_t)3)
+
+/* SMRAM register */
+#define SMRAM_D_OPEN           ((uint8_t)(1 << 6))
+#define SMRAM_D_CLS            ((uint8_t)(1 << 5))
+#define SMRAM_D_LCK            ((uint8_t)(1 << 4))
+#define SMRAM_G_SMRAME         ((uint8_t)(1 << 3))
+#define SMRAM_C_BASE_SEG_MASK  ((uint8_t)0x7)
+#define SMRAM_C_BASE_SEG       ((uint8_t)0x2)  /* hardwired to b010 */
+
+typedef struct PAMMemoryRegion {
+    MemoryRegion alias[4];  /* index = PAM value */
+    unsigned current;
+} PAMMemoryRegion;
+
+void smram_update(MemoryRegion *smram_region, uint8_t smram,
+                  uint8_t smm_enabled);
+void smram_set_smm(uint8_t *host_smm_enabled, int smm, uint8_t smram,
+                   MemoryRegion *smram_region);
+void init_pam(MemoryRegion *ram, MemoryRegion *system, MemoryRegion *pci,
+              PAMMemoryRegion *mem, uint32_t start, uint32_t size);
+void pam_update(PAMMemoryRegion *mem, int idx, uint8_t val);
+
+#endif /* QEMU_PAM_H */
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 9af5847..ba1b3de 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -30,6 +30,7 @@
 #include "sysbus.h"
 #include "range.h"
 #include "xen.h"
+#include "pam.h"
 
 /*
  * I440FX chipset data sheet.
@@ -68,11 +69,6 @@ typedef struct PIIX3State {
     int32_t pci_irq_levels_vmstate[PIIX_NUM_PIRQS];
 } PIIX3State;
 
-typedef struct PAMMemoryRegion {
-    MemoryRegion alias[4];  /* index = PAM value */
-    unsigned current;
-} PAMMemoryRegion;
-
 struct PCII440FXState {
     PCIDevice dev;
     MemoryRegion *system_memory;
@@ -105,52 +101,16 @@ static int pci_slot_get_pirq(PCIDevice *pci_dev, int pci_intx)
     return (pci_intx + slot_addend) & 3;
 }
 
-static void init_pam(PCII440FXState *d, PAMMemoryRegion *mem,
-                     uint32_t start, uint32_t size)
-{
-    int i;
-
-    /* RAM */
-    memory_region_init_alias(&mem->alias[3], "pam-ram", d->ram_memory, start, size);
-    /* ROM (XXX: not quite correct) */
-    memory_region_init_alias(&mem->alias[1], "pam-rom", d->ram_memory, start, size);
-    memory_region_set_readonly(&mem->alias[1], true);
-
-    /* XXX: should distinguish read/write cases */
-    memory_region_init_alias(&mem->alias[0], "pam-pci", d->pci_address_space,
-                             start, size);
-    memory_region_init_alias(&mem->alias[2], "pam-pci", d->pci_address_space,
-                             start, size);
-
-    for (i = 0; i < 4; ++i) {
-        memory_region_set_enabled(&mem->alias[i], false);
-        memory_region_add_subregion_overlap(d->system_memory, start, &mem->alias[i], 1);
-    }
-    mem->current = 0;
-}
-
-static void update_pam(PAMMemoryRegion *pam, unsigned r)
-{
-    memory_region_set_enabled(&pam->alias[pam->current], false);
-    pam->current = r;
-    memory_region_set_enabled(&pam->alias[pam->current], true);
-}
-
 static void i440fx_update_memory_mappings(PCII440FXState *d)
 {
-    int i, r;
-    uint32_t smram;
-    bool smram_enabled;
+    int i;
 
     memory_region_transaction_begin();
-    update_pam(&d->pam_regions[0], (d->dev.config[I440FX_PAM] >> 4) & 3);
-    for(i = 0; i < 12; i++) {
-        r = (d->dev.config[(i >> 1) + (I440FX_PAM + 1)] >> ((i & 1) * 4)) & 3;
-        update_pam(&d->pam_regions[i+1], r);
+    for (i = 0; i < 13; i++) {
+        pam_update(&d->pam_regions[i], i,
+                   d->dev.config[I440FX_PAM + ((i + 1) / 2)]);
     }
-    smram = d->dev.config[I440FX_SMRAM];
-    smram_enabled = (d->smm_enabled && (smram & 0x08)) || (smram & 0x40);
-    memory_region_set_enabled(&d->smram_region, !smram_enabled);
+    smram_update(&d->smram_region, d->dev.config[I440FX_SMRAM], d->smm_enabled);
     memory_region_transaction_commit();
 }
 
@@ -158,11 +118,10 @@ static void i440fx_set_smm(int val, void *arg)
 {
     PCII440FXState *d = arg;
 
-    val = (val != 0);
-    if (d->smm_enabled != val) {
-        d->smm_enabled = val;
-        i440fx_update_memory_mappings(d);
-    }
+    memory_region_transaction_begin();
+    smram_set_smm(&d->smm_enabled, val, d->dev.config[I440FX_SMRAM],
+                  &d->smram_region);
+    memory_region_transaction_commit();
 }
 
 
@@ -300,9 +259,12 @@ static PCIBus *i440fx_common_init(const char *device_name,
     memory_region_add_subregion_overlap(f->system_memory, 0xa0000,
                                         &f->smram_region, 1);
     memory_region_set_enabled(&f->smram_region, false);
-    init_pam(f, &f->pam_regions[0], 0xf0000, 0x10000);
+    init_pam(f->ram_memory, f->system_memory, f->pci_address_space,
+             &f->pam_regions[0], PAM_BIOS_BASE, PAM_BIOS_SIZE);
     for (i = 0; i < 12; ++i) {
-        init_pam(f, &f->pam_regions[i+1], 0xc0000 + i * 0x4000, 0x4000);
+        init_pam(f->ram_memory, f->system_memory, f->pci_address_space,
+                 &f->pam_regions[i+1], PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE,
+                 PAM_EXPAN_SIZE);
     }
 
     /* Xen supports additional interrupt routes from the PCI devices to
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEG-00036J-Kg; Tue, 11 Dec 2012 13:50:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEF-000362-7C
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:35 +0000
Received: from [85.158.139.83:12924] by server-9.bemta-5.messagelabs.com id
	60/84-10690-A2A37C05; Tue, 11 Dec 2012 13:50:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1355233832!27624317!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25863 invoked from network); 11 Dec 2012 13:50:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEC-0001OV-5p
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEC-0005iZ-2h
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:32 +0000
Date: Tue, 11 Dec 2012 13:50:32 +0000
Message-Id: <E1TiQEC-0005iZ-2h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] pc/piix_pci: factor out
	smram/pam logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 410edd922d2a90c79cd92b086c0e53650ea52c02
Author: Isaku Yamahata <yamahata@valinux.co.jp>
Date:   Wed Nov 14 15:54:02 2012 -0500

    pc/piix_pci: factor out smram/pam logic
    
    Factor out smram/pam logic for use by other chipsets, namely q35
    at this point.
    
    Note: Should be factored out into a generic North Bridge Class.
    
    [jbaron@redhat.com: changes for updated memory API]
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/Makefile.objs |    1 +
 hw/pam.c         |   87 ++++++++++++++++++++++++++++++++++++++++++++++++
 hw/pam.h         |   97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/piix_pci.c    |   68 ++++++++-----------------------------
 4 files changed, 200 insertions(+), 53 deletions(-)

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index ea46f81..5ebe6af 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -38,6 +38,7 @@ common-obj-$(CONFIG_SMARTCARD) += ccid-card-passthru.o
 common-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o
 common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
 common-obj-y += fifo.o
+common-obj-y += pam.o
 
 # PPC devices
 common-obj-$(CONFIG_PREP_PCI) += prep_pci.o
diff --git a/hw/pam.c b/hw/pam.c
new file mode 100644
index 0000000..a95e2cf
--- /dev/null
+++ b/hw/pam.c
@@ -0,0 +1,87 @@
+/*
+ * QEMU i440FX/PIIX3 PCI Bridge Emulation
+ *
+ * Copyright (c) 2006 Fabrice Bellard
+ * Copyright (c) 2011 Isaku Yamahata <yamahata at valinux co jp>
+ *                    VA Linux Systems Japan K.K.
+ * Copyright (c) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * Split out from piix_pci.c
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#include "sysemu.h"
+#include "pam.h"
+
+void smram_update(MemoryRegion *smram_region, uint8_t smram,
+                  uint8_t smm_enabled)
+{
+    bool smram_enabled;
+
+    smram_enabled = ((smm_enabled && (smram & SMRAM_G_SMRAME)) ||
+                        (smram & SMRAM_D_OPEN));
+    memory_region_set_enabled(smram_region, !smram_enabled);
+}
+
+void smram_set_smm(uint8_t *host_smm_enabled, int smm, uint8_t smram,
+                   MemoryRegion *smram_region)
+{
+    uint8_t smm_enabled = (smm != 0);
+    if (*host_smm_enabled != smm_enabled) {
+        *host_smm_enabled = smm_enabled;
+        smram_update(smram_region, smram, *host_smm_enabled);
+    }
+}
+
+void init_pam(MemoryRegion *ram_memory, MemoryRegion *system_memory,
+              MemoryRegion *pci_address_space, PAMMemoryRegion *mem,
+              uint32_t start, uint32_t size)
+{
+    int i;
+
+    /* RAM */
+    memory_region_init_alias(&mem->alias[3], "pam-ram", ram_memory,
+                             start, size);
+    /* ROM (XXX: not quite correct) */
+    memory_region_init_alias(&mem->alias[1], "pam-rom", ram_memory,
+                             start, size);
+    memory_region_set_readonly(&mem->alias[1], true);
+
+    /* XXX: should distinguish read/write cases */
+    memory_region_init_alias(&mem->alias[0], "pam-pci", pci_address_space,
+                             start, size);
+    memory_region_init_alias(&mem->alias[2], "pam-pci", pci_address_space,
+                             start, size);
+
+    for (i = 0; i < 4; ++i) {
+        memory_region_set_enabled(&mem->alias[i], false);
+        memory_region_add_subregion_overlap(system_memory, start,
+                                            &mem->alias[i], 1);
+    }
+    mem->current = 0;
+}
+
+void pam_update(PAMMemoryRegion *pam, int idx, uint8_t val)
+{
+    assert(0 <= idx && idx <= 12);
+
+    memory_region_set_enabled(&pam->alias[pam->current], false);
+    pam->current = (val >> ((!(idx & 1)) * 4)) & PAM_ATTR_MASK;
+    memory_region_set_enabled(&pam->alias[pam->current], true);
+}
diff --git a/hw/pam.h b/hw/pam.h
new file mode 100644
index 0000000..2d77ebe
--- /dev/null
+++ b/hw/pam.h
@@ -0,0 +1,97 @@
+#ifndef QEMU_PAM_H
+#define QEMU_PAM_H
+
+/*
+ * Copyright (c) 2006 Fabrice Bellard
+ * Copyright (c) 2011 Isaku Yamahata <yamahata at valinux co jp>
+ *               VA Linux Systems Japan K.K.
+ * Copyright (c) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * Split out from piix_pci.c
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/*
+ * SMRAM memory area and PAM memory area in Legacy address range for PC.
+ * PAM: Programmable Attribute Map registers
+ *
+ * 0xa0000 - 0xbffff compatible SMRAM
+ *
+ * 0xc0000 - 0xc3fff Expansion area memory segments
+ * 0xc4000 - 0xc7fff
+ * 0xc8000 - 0xcbfff
+ * 0xcc000 - 0xcffff
+ * 0xd0000 - 0xd3fff
+ * 0xd4000 - 0xd7fff
+ * 0xd8000 - 0xdbfff
+ * 0xdc000 - 0xdffff
+ * 0xe0000 - 0xe3fff Extended System BIOS Area Memory Segments
+ * 0xe4000 - 0xe7fff
+ * 0xe8000 - 0xebfff
+ * 0xec000 - 0xeffff
+ *
+ * 0xf0000 - 0xfffff System BIOS Area Memory Segments
+ */
+
+#include "qemu-common.h"
+#include "memory.h"
+
+#define SMRAM_C_BASE    0xa0000
+#define SMRAM_C_END     0xc0000
+#define SMRAM_C_SIZE    0x20000
+
+#define PAM_EXPAN_BASE  0xc0000
+#define PAM_EXPAN_SIZE  0x04000
+
+#define PAM_EXBIOS_BASE 0xe0000
+#define PAM_EXBIOS_SIZE 0x04000
+
+#define PAM_BIOS_BASE   0xf0000
+#define PAM_BIOS_END    0xfffff
+/* 64KB: Intel 3 series express chipset family p. 58*/
+#define PAM_BIOS_SIZE   0x10000
+
+/* PAM registers: log nibble and high nibble*/
+#define PAM_ATTR_WE     ((uint8_t)2)
+#define PAM_ATTR_RE     ((uint8_t)1)
+#define PAM_ATTR_MASK   ((uint8_t)3)
+
+/* SMRAM register */
+#define SMRAM_D_OPEN           ((uint8_t)(1 << 6))
+#define SMRAM_D_CLS            ((uint8_t)(1 << 5))
+#define SMRAM_D_LCK            ((uint8_t)(1 << 4))
+#define SMRAM_G_SMRAME         ((uint8_t)(1 << 3))
+#define SMRAM_C_BASE_SEG_MASK  ((uint8_t)0x7)
+#define SMRAM_C_BASE_SEG       ((uint8_t)0x2)  /* hardwired to b010 */
+
+typedef struct PAMMemoryRegion {
+    MemoryRegion alias[4];  /* index = PAM value */
+    unsigned current;
+} PAMMemoryRegion;
+
+void smram_update(MemoryRegion *smram_region, uint8_t smram,
+                  uint8_t smm_enabled);
+void smram_set_smm(uint8_t *host_smm_enabled, int smm, uint8_t smram,
+                   MemoryRegion *smram_region);
+void init_pam(MemoryRegion *ram, MemoryRegion *system, MemoryRegion *pci,
+              PAMMemoryRegion *mem, uint32_t start, uint32_t size);
+void pam_update(PAMMemoryRegion *mem, int idx, uint8_t val);
+
+#endif /* QEMU_PAM_H */
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 9af5847..ba1b3de 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -30,6 +30,7 @@
 #include "sysbus.h"
 #include "range.h"
 #include "xen.h"
+#include "pam.h"
 
 /*
  * I440FX chipset data sheet.
@@ -68,11 +69,6 @@ typedef struct PIIX3State {
     int32_t pci_irq_levels_vmstate[PIIX_NUM_PIRQS];
 } PIIX3State;
 
-typedef struct PAMMemoryRegion {
-    MemoryRegion alias[4];  /* index = PAM value */
-    unsigned current;
-} PAMMemoryRegion;
-
 struct PCII440FXState {
     PCIDevice dev;
     MemoryRegion *system_memory;
@@ -105,52 +101,16 @@ static int pci_slot_get_pirq(PCIDevice *pci_dev, int pci_intx)
     return (pci_intx + slot_addend) & 3;
 }
 
-static void init_pam(PCII440FXState *d, PAMMemoryRegion *mem,
-                     uint32_t start, uint32_t size)
-{
-    int i;
-
-    /* RAM */
-    memory_region_init_alias(&mem->alias[3], "pam-ram", d->ram_memory, start, size);
-    /* ROM (XXX: not quite correct) */
-    memory_region_init_alias(&mem->alias[1], "pam-rom", d->ram_memory, start, size);
-    memory_region_set_readonly(&mem->alias[1], true);
-
-    /* XXX: should distinguish read/write cases */
-    memory_region_init_alias(&mem->alias[0], "pam-pci", d->pci_address_space,
-                             start, size);
-    memory_region_init_alias(&mem->alias[2], "pam-pci", d->pci_address_space,
-                             start, size);
-
-    for (i = 0; i < 4; ++i) {
-        memory_region_set_enabled(&mem->alias[i], false);
-        memory_region_add_subregion_overlap(d->system_memory, start, &mem->alias[i], 1);
-    }
-    mem->current = 0;
-}
-
-static void update_pam(PAMMemoryRegion *pam, unsigned r)
-{
-    memory_region_set_enabled(&pam->alias[pam->current], false);
-    pam->current = r;
-    memory_region_set_enabled(&pam->alias[pam->current], true);
-}
-
 static void i440fx_update_memory_mappings(PCII440FXState *d)
 {
-    int i, r;
-    uint32_t smram;
-    bool smram_enabled;
+    int i;
 
     memory_region_transaction_begin();
-    update_pam(&d->pam_regions[0], (d->dev.config[I440FX_PAM] >> 4) & 3);
-    for(i = 0; i < 12; i++) {
-        r = (d->dev.config[(i >> 1) + (I440FX_PAM + 1)] >> ((i & 1) * 4)) & 3;
-        update_pam(&d->pam_regions[i+1], r);
+    for (i = 0; i < 13; i++) {
+        pam_update(&d->pam_regions[i], i,
+                   d->dev.config[I440FX_PAM + ((i + 1) / 2)]);
     }
-    smram = d->dev.config[I440FX_SMRAM];
-    smram_enabled = (d->smm_enabled && (smram & 0x08)) || (smram & 0x40);
-    memory_region_set_enabled(&d->smram_region, !smram_enabled);
+    smram_update(&d->smram_region, d->dev.config[I440FX_SMRAM], d->smm_enabled);
     memory_region_transaction_commit();
 }
 
@@ -158,11 +118,10 @@ static void i440fx_set_smm(int val, void *arg)
 {
     PCII440FXState *d = arg;
 
-    val = (val != 0);
-    if (d->smm_enabled != val) {
-        d->smm_enabled = val;
-        i440fx_update_memory_mappings(d);
-    }
+    memory_region_transaction_begin();
+    smram_set_smm(&d->smm_enabled, val, d->dev.config[I440FX_SMRAM],
+                  &d->smram_region);
+    memory_region_transaction_commit();
 }
 
 
@@ -300,9 +259,12 @@ static PCIBus *i440fx_common_init(const char *device_name,
     memory_region_add_subregion_overlap(f->system_memory, 0xa0000,
                                         &f->smram_region, 1);
     memory_region_set_enabled(&f->smram_region, false);
-    init_pam(f, &f->pam_regions[0], 0xf0000, 0x10000);
+    init_pam(f->ram_memory, f->system_memory, f->pci_address_space,
+             &f->pam_regions[0], PAM_BIOS_BASE, PAM_BIOS_SIZE);
     for (i = 0; i < 12; ++i) {
-        init_pam(f, &f->pam_regions[i+1], 0xc0000 + i * 0x4000, 0x4000);
+        init_pam(f->ram_memory, f->system_memory, f->pci_address_space,
+                 &f->pam_regions[i+1], PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE,
+                 PAM_EXPAN_SIZE);
     }
 
     /* Xen supports additional interrupt routes from the PCI devices to
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEJ-00037I-Q6; Tue, 11 Dec 2012 13:50:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEI-00036f-82
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:38 +0000
Received: from [85.158.138.51:52539] by server-2.bemta-3.messagelabs.com id
	34/E4-11239-D2A37C05; Tue, 11 Dec 2012 13:50:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1355233786!28367937!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28953 invoked from network); 11 Dec 2012 13:49:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:49:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDO-0001NV-E1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDL-0005gR-10
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:39 +0000
Date: Tue, 11 Dec 2012 13:49:39 +0000
Message-Id: <E1TiQDL-0005gR-10@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'qemu-kvm/uq/master' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cab1e8f3e37d8e883c270e3afd9c7c1c18332f0e
Merge: 95a6e48d776b208d085854358313346ebdb2924d c6e88b3b27b411e3f1c924deb8b71b20f8a11107
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 08:19:45 2012 -0600

    Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
    
    * qemu-kvm/uq/master:
      Legacy qemu-kvm options have no argument
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 qemu-options.hx |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEJ-00037I-Q6; Tue, 11 Dec 2012 13:50:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEI-00036f-82
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:38 +0000
Received: from [85.158.138.51:52539] by server-2.bemta-3.messagelabs.com id
	34/E4-11239-D2A37C05; Tue, 11 Dec 2012 13:50:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1355233786!28367937!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28953 invoked from network); 11 Dec 2012 13:49:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:49:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDO-0001NV-E1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDL-0005gR-10
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:39 +0000
Date: Tue, 11 Dec 2012 13:49:39 +0000
Message-Id: <E1TiQDL-0005gR-10@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'qemu-kvm/uq/master' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cab1e8f3e37d8e883c270e3afd9c7c1c18332f0e
Merge: 95a6e48d776b208d085854358313346ebdb2924d c6e88b3b27b411e3f1c924deb8b71b20f8a11107
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 08:19:45 2012 -0600

    Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
    
    * qemu-kvm/uq/master:
      Legacy qemu-kvm options have no argument
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 qemu-options.hx |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:48 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQER-00039V-T1; Tue, 11 Dec 2012 13:50:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEQ-00038z-HH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:46 +0000
Received: from [85.158.139.211:23180] by server-13.bemta-5.messagelabs.com id
	36/D1-10716-53A37C05; Tue, 11 Dec 2012 13:50:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1355233842!18210880!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4078 invoked from network); 11 Dec 2012 13:50:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEM-0001Oe-Fl
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEM-0005iz-Ax
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:42 +0000
Date: Tue, 11 Dec 2012 13:50:42 +0000
Message-Id: <E1TiQEM-0005iz-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ich9: Add acpi support and
	definitions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e516572fdefdf1168e890d1fd79d56cd44aa2102
Author: Jason Baron <jbaron@redhat.com>
Date:   Thu Nov 22 22:05:06 2012 -0500

    ich9: Add acpi support and definitions
    
    Lay the groundwork for subsequent ich9 support.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/Makefile.objs |    2 +-
 hw/acpi_ich9.c   |  315 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/acpi_ich9.h   |   47 ++++++++
 hw/ich9.h        |  207 +++++++++++++++++++++++++++++++++++
 hw/pci_ids.h     |   12 ++
 5 files changed, 582 insertions(+), 1 deletions(-)

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 5ebe6af..b863b31 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -28,7 +28,7 @@ common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
 common-obj-$(CONFIG_PCSPK) += pcspk.o
 common-obj-$(CONFIG_PCKBD) += pckbd.o
 common-obj-$(CONFIG_FDC) += fdc.o
-common-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o
+common-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o acpi_ich9.o
 common-obj-$(CONFIG_APM) += pm_smbus.o apm.o
 common-obj-$(CONFIG_DMA) += dma.o
 common-obj-$(CONFIG_I82374) += i82374.o
diff --git a/hw/acpi_ich9.c b/hw/acpi_ich9.c
new file mode 100644
index 0000000..c45921c
--- /dev/null
+++ b/hw/acpi_ich9.c
@@ -0,0 +1,315 @@
+/*
+ * ACPI implementation
+ *
+ * Copyright (c) 2006 Fabrice Bellard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+/*
+ *  Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
+ *                     VA Linux Systems Japan K.K.
+ *  Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ *  This is based on acpi.c.
+ */
+#include "hw.h"
+#include "pc.h"
+#include "pci.h"
+#include "qemu-timer.h"
+#include "sysemu.h"
+#include "acpi.h"
+
+#include "ich9.h"
+
+//#define DEBUG
+
+#ifdef DEBUG
+#define ICH9_DEBUG(fmt, ...) \
+do { printf("%s "fmt, __func__, ## __VA_ARGS__); } while (0)
+#else
+#define ICH9_DEBUG(fmt, ...)    do { } while (0)
+#endif
+
+static void pm_ioport_write_fallback(void *opaque, uint32_t addr, int len,
+                                     uint32_t val);
+static uint32_t pm_ioport_read_fallback(void *opaque, uint32_t addr, int len);
+
+static void pm_update_sci(ICH9LPCPMRegs *pm)
+{
+    int sci_level, pm1a_sts;
+
+    pm1a_sts = acpi_pm1_evt_get_sts(&pm->acpi_regs);
+
+    sci_level = (((pm1a_sts & pm->acpi_regs.pm1.evt.en) &
+                  (ACPI_BITMASK_RT_CLOCK_ENABLE |
+                   ACPI_BITMASK_POWER_BUTTON_ENABLE |
+                   ACPI_BITMASK_GLOBAL_LOCK_ENABLE |
+                   ACPI_BITMASK_TIMER_ENABLE)) != 0);
+    qemu_set_irq(pm->irq, sci_level);
+
+    /* schedule a timer interruption if needed */
+    acpi_pm_tmr_update(&pm->acpi_regs,
+                       (pm->acpi_regs.pm1.evt.en & ACPI_BITMASK_TIMER_ENABLE) &&
+                       !(pm1a_sts & ACPI_BITMASK_TIMER_STATUS));
+}
+
+static void ich9_pm_update_sci_fn(ACPIREGS *regs)
+{
+    ICH9LPCPMRegs *pm = container_of(regs, ICH9LPCPMRegs, acpi_regs);
+    pm_update_sci(pm);
+}
+
+static void pm_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
+{
+    ICH9LPCPMRegs *pm = opaque;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_GPE0_STS ... (ICH9_PMIO_GPE0_STS + ICH9_PMIO_GPE0_LEN - 1):
+        acpi_gpe_ioport_writeb(&pm->acpi_regs, addr, val);
+        break;
+    default:
+        break;
+    }
+
+    ICH9_DEBUG("port=0x%04x val=0x%04x\n", addr, val);
+}
+
+static uint32_t pm_ioport_readb(void *opaque, uint32_t addr)
+{
+    ICH9LPCPMRegs *pm = opaque;
+    uint32_t val = 0;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_GPE0_STS ... (ICH9_PMIO_GPE0_STS + ICH9_PMIO_GPE0_LEN - 1):
+        val = acpi_gpe_ioport_readb(&pm->acpi_regs, addr);
+        break;
+    default:
+        val = 0;
+        break;
+    }
+    ICH9_DEBUG("port=0x%04x val=0x%04x\n", addr, val);
+    return val;
+}
+
+static void pm_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
+{
+    ICH9LPCPMRegs *pm = opaque;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_PM1_STS:
+        acpi_pm1_evt_write_sts(&pm->acpi_regs, val);
+        pm_update_sci(pm);
+        break;
+    case ICH9_PMIO_PM1_EN:
+        pm->acpi_regs.pm1.evt.en = val;
+        pm_update_sci(pm);
+        break;
+    case ICH9_PMIO_PM1_CNT:
+        acpi_pm1_cnt_write(&pm->acpi_regs, val, 0);
+        break;
+    default:
+        pm_ioport_write_fallback(opaque, addr, 2, val);
+        break;
+    }
+    ICH9_DEBUG("port=0x%04x val=0x%04x\n", addr, val);
+}
+
+static uint32_t pm_ioport_readw(void *opaque, uint32_t addr)
+{
+    ICH9LPCPMRegs *pm = opaque;
+    uint32_t val;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_PM1_STS:
+        val = acpi_pm1_evt_get_sts(&pm->acpi_regs);
+        break;
+    case ICH9_PMIO_PM1_EN:
+        val = pm->acpi_regs.pm1.evt.en;
+        break;
+    case ICH9_PMIO_PM1_CNT:
+        val = pm->acpi_regs.pm1.cnt.cnt;
+        break;
+    default:
+        val = pm_ioport_read_fallback(opaque, addr, 2);
+        break;
+    }
+    ICH9_DEBUG("port=0x%04x val=0x%04x\n", addr, val);
+    return val;
+}
+
+static void pm_ioport_writel(void *opaque, uint32_t addr, uint32_t val)
+{
+    ICH9LPCPMRegs *pm = opaque;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_SMI_EN:
+        pm->smi_en = val;
+        break;
+    default:
+        pm_ioport_write_fallback(opaque, addr, 4, val);
+        break;
+    }
+    ICH9_DEBUG("port=0x%04x val=0x%08x\n", addr, val);
+}
+
+static uint32_t pm_ioport_readl(void *opaque, uint32_t addr)
+{
+    ICH9LPCPMRegs *pm = opaque;
+    uint32_t val;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_PM1_TMR:
+        val = acpi_pm_tmr_get(&pm->acpi_regs);
+        break;
+    case ICH9_PMIO_SMI_EN:
+        val = pm->smi_en;
+        break;
+
+    default:
+        val = pm_ioport_read_fallback(opaque, addr, 4);
+        break;
+    }
+    ICH9_DEBUG("port=0x%04x val=0x%08x\n", addr, val);
+    return val;
+}
+
+static void pm_ioport_write_fallback(void *opaque, uint32_t addr, int len,
+                                     uint32_t val)
+ {
+    int subsize = (len == 4) ? 2 : 1;
+    IOPortWriteFunc *ioport_write =
+        (subsize == 2) ? pm_ioport_writew : pm_ioport_writeb;
+
+    int i;
+
+    for (i = 0; i < len; i += subsize) {
+        ioport_write(opaque, addr, val);
+        val >>= 8 * subsize;
+    }
+}
+
+static uint32_t pm_ioport_read_fallback(void *opaque, uint32_t addr, int len)
+{
+    int subsize = (len == 4) ? 2 : 1;
+    IOPortReadFunc *ioport_read =
+        (subsize == 2) ? pm_ioport_readw : pm_ioport_readb;
+
+    uint32_t val;
+    int i;
+
+    val = 0;
+    for (i = 0; i < len; i += subsize) {
+        val <<= 8 * subsize;
+        val |= ioport_read(opaque, addr);
+    }
+
+    return val;
+}
+
+void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base)
+{
+    ICH9_DEBUG("to 0x%x\n", pm_io_base);
+
+    assert((pm_io_base & ICH9_PMIO_MASK) == 0);
+
+    if (pm->pm_io_base != 0) {
+        isa_unassign_ioport(pm->pm_io_base, ICH9_PMIO_SIZE);
+    }
+
+    /* don't map at 0 */
+    if (pm_io_base == 0) {
+        return;
+    }
+
+    register_ioport_write(pm_io_base, ICH9_PMIO_SIZE, 1, pm_ioport_writeb, pm);
+    register_ioport_read(pm_io_base, ICH9_PMIO_SIZE, 1, pm_ioport_readb, pm);
+    register_ioport_write(pm_io_base, ICH9_PMIO_SIZE, 2, pm_ioport_writew, pm);
+    register_ioport_read(pm_io_base, ICH9_PMIO_SIZE, 2, pm_ioport_readw, pm);
+    register_ioport_write(pm_io_base, ICH9_PMIO_SIZE, 4, pm_ioport_writel, pm);
+    register_ioport_read(pm_io_base, ICH9_PMIO_SIZE, 4, pm_ioport_readl, pm);
+
+    pm->pm_io_base = pm_io_base;
+    acpi_gpe_blk(&pm->acpi_regs, pm_io_base + ICH9_PMIO_GPE0_STS);
+}
+
+static int ich9_pm_post_load(void *opaque, int version_id)
+{
+    ICH9LPCPMRegs *pm = opaque;
+    uint32_t pm_io_base = pm->pm_io_base;
+    pm->pm_io_base = 0;
+    ich9_pm_iospace_update(pm, pm_io_base);
+    return 0;
+}
+
+#define VMSTATE_GPE_ARRAY(_field, _state)                            \
+ {                                                                   \
+     .name       = (stringify(_field)),                              \
+     .version_id = 0,                                                \
+     .num        = ICH9_PMIO_GPE0_LEN,                               \
+     .info       = &vmstate_info_uint8,                              \
+     .size       = sizeof(uint8_t),                                  \
+     .flags      = VMS_ARRAY | VMS_POINTER,                          \
+     .offset     = vmstate_offset_pointer(_state, _field, uint8_t),  \
+ }
+
+const VMStateDescription vmstate_ich9_pm = {
+    .name = "ich9_pm",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .post_load = ich9_pm_post_load,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT16(acpi_regs.pm1.evt.sts, ICH9LPCPMRegs),
+        VMSTATE_UINT16(acpi_regs.pm1.evt.en, ICH9LPCPMRegs),
+        VMSTATE_UINT16(acpi_regs.pm1.cnt.cnt, ICH9LPCPMRegs),
+        VMSTATE_TIMER(acpi_regs.tmr.timer, ICH9LPCPMRegs),
+        VMSTATE_INT64(acpi_regs.tmr.overflow_time, ICH9LPCPMRegs),
+        VMSTATE_GPE_ARRAY(acpi_regs.gpe.sts, ICH9LPCPMRegs),
+        VMSTATE_GPE_ARRAY(acpi_regs.gpe.en, ICH9LPCPMRegs),
+        VMSTATE_UINT32(smi_en, ICH9LPCPMRegs),
+        VMSTATE_UINT32(smi_sts, ICH9LPCPMRegs),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static void pm_reset(void *opaque)
+{
+    ICH9LPCPMRegs *pm = opaque;
+    ich9_pm_iospace_update(pm, 0);
+
+    acpi_pm1_evt_reset(&pm->acpi_regs);
+    acpi_pm1_cnt_reset(&pm->acpi_regs);
+    acpi_pm_tmr_reset(&pm->acpi_regs);
+    acpi_gpe_reset(&pm->acpi_regs);
+
+    pm_update_sci(pm);
+}
+
+static void pm_powerdown_req(Notifier *n, void *opaque)
+{
+    ICH9LPCPMRegs *pm = container_of(n, ICH9LPCPMRegs, powerdown_notifier);
+
+    acpi_pm1_evt_power_down(&pm->acpi_regs);
+}
+
+void ich9_pm_init(ICH9LPCPMRegs *pm, qemu_irq sci_irq, qemu_irq cmos_s3)
+{
+    acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn);
+    acpi_pm1_cnt_init(&pm->acpi_regs);
+    acpi_gpe_init(&pm->acpi_regs, ICH9_PMIO_GPE0_LEN);
+
+    pm->irq = sci_irq;
+    qemu_register_reset(pm_reset, pm);
+    pm->powerdown_notifier.notify = pm_powerdown_req;
+    qemu_register_powerdown_notifier(&pm->powerdown_notifier);
+}
diff --git a/hw/acpi_ich9.h b/hw/acpi_ich9.h
new file mode 100644
index 0000000..180c406
--- /dev/null
+++ b/hw/acpi_ich9.h
@@ -0,0 +1,47 @@
+/*
+ * QEMU GMCH/ICH9 LPC PM Emulation
+ *
+ *  Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
+ *                     VA Linux Systems Japan K.K.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#ifndef HW_ACPI_ICH9_H
+#define HW_ACPI_ICH9_H
+
+#include "acpi.h"
+
+typedef struct ICH9LPCPMRegs {
+    /*
+     * In ich9 spec says that pm1_cnt register is 32bit width and
+     * that the upper 16bits are reserved and unused.
+     * PM1a_CNT_BLK = 2 in FADT so it is defined as uint16_t.
+     */
+    ACPIREGS acpi_regs;
+    uint32_t smi_en;
+    uint32_t smi_sts;
+
+    qemu_irq irq;      /* SCI */
+
+    uint32_t pm_io_base;
+    Notifier powerdown_notifier;
+} ICH9LPCPMRegs;
+
+void ich9_pm_init(ICH9LPCPMRegs *pm,
+                  qemu_irq sci_irq, qemu_irq cmos_s3_resume);
+void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base);
+extern const VMStateDescription vmstate_ich9_pm;
+
+#endif /* HW_ACPI_ICH9_H */
diff --git a/hw/ich9.h b/hw/ich9.h
new file mode 100644
index 0000000..de49135
--- /dev/null
+++ b/hw/ich9.h
@@ -0,0 +1,207 @@
+#ifndef HW_ICH9_H
+#define HW_ICH9_H
+
+#include "hw.h"
+#include "range.h"
+#include "isa.h"
+#include "sysbus.h"
+#include "pc.h"
+#include "apm.h"
+#include "ioapic.h"
+#include "pci.h"
+#include "pcie_host.h"
+#include "pci_bridge.h"
+#include "acpi.h"
+#include "acpi_ich9.h"
+#include "pam.h"
+#include "pci_internals.h"
+
+void ich9_lpc_set_irq(void *opaque, int irq_num, int level);
+int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx);
+void ich9_lpc_pm_init(PCIDevice *pci_lpc, qemu_irq cmos_s3);
+PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus);
+i2c_bus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base);
+
+#define ICH9_CC_SIZE                            (16 * 1024)     /* 16KB */
+
+#define TYPE_ICH9_LPC_DEVICE "ICH9 LPC"
+#define ICH9_LPC_DEVICE(obj) \
+     OBJECT_CHECK(ICH9LPCState, (obj), TYPE_ICH9_LPC_DEVICE)
+
+typedef struct ICH9LPCState {
+    /* ICH9 LPC PCI to ISA bridge */
+    PCIDevice d;
+
+    /* (pci device, intx) -> pirq
+     * In real chipset case, the unused slots are never used
+     * as ICH9 supports only D25-D32 irq routing.
+     * On the other hand in qemu case, any slot/function can be populated
+     * via command line option.
+     * So fallback interrupt routing for any devices in any slots is necessary.
+    */
+    uint8_t irr[PCI_SLOT_MAX][PCI_NUM_PINS];
+
+    APMState apm;
+    ICH9LPCPMRegs pm;
+    uint32_t sci_level; /* track sci level */
+
+    /* 10.1 Chipset Configuration registers(Memory Space)
+     which is pointed by RCBA */
+    uint8_t chip_config[ICH9_CC_SIZE];
+    /* isa bus */
+    ISABus *isa_bus;
+    MemoryRegion rbca_mem;
+
+    qemu_irq *pic;
+    qemu_irq *ioapic;
+} ICH9LPCState;
+
+#define Q35_MASK(bit, ms_bit, ls_bit) \
+((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1)))
+
+/* ICH9: Chipset Configuration Registers */
+#define ICH9_CC_ADDR_MASK                       (ICH9_CC_SIZE - 1)
+
+#define ICH9_CC
+#define ICH9_CC_D28IP                           0x310C
+#define ICH9_CC_D28IP_SHIFT                     4
+#define ICH9_CC_D28IP_MASK                      0xf
+#define ICH9_CC_D28IP_DEFAULT                   0x00214321
+#define ICH9_CC_D31IR                           0x3140
+#define ICH9_CC_D30IR                           0x3142
+#define ICH9_CC_D29IR                           0x3144
+#define ICH9_CC_D28IR                           0x3146
+#define ICH9_CC_D27IR                           0x3148
+#define ICH9_CC_D26IR                           0x314C
+#define ICH9_CC_D25IR                           0x3150
+#define ICH9_CC_DIR_DEFAULT                     0x3210
+#define ICH9_CC_D30IR_DEFAULT                   0x0
+#define ICH9_CC_DIR_SHIFT                       4
+#define ICH9_CC_DIR_MASK                        0x7
+#define ICH9_CC_OIC                             0x31FF
+#define ICH9_CC_OIC_AEN                         0x1
+
+/* D28:F[0-5] */
+#define ICH9_PCIE_DEV                           28
+#define ICH9_PCIE_FUNC_MAX                      6
+
+
+/* D29:F0 USB UHCI Controller #1 */
+#define ICH9_USB_UHCI1_DEV                      29
+#define ICH9_USB_UHCI1_FUNC                     0
+
+/* D30:F0 DMI-to-PCI brdige */
+#define ICH9_D2P_BRIDGE                         "ICH9 D2P BRIDGE"
+#define ICH9_D2P_BRIDGE_SAVEVM_VERSION          0
+
+#define ICH9_D2P_BRIDGE_DEV                     30
+#define ICH9_D2P_BRIDGE_FUNC                    0
+
+#define ICH9_D2P_SECONDARY_DEFAULT              (256 - 8)
+
+#define ICH9_D2P_A2_REVISION                    0x92
+
+
+/* D31:F1 LPC controller */
+#define ICH9_A2_LPC                             "ICH9 A2 LPC"
+#define ICH9_A2_LPC_SAVEVM_VERSION              0
+
+#define ICH9_LPC_DEV                            31
+#define ICH9_LPC_FUNC                           0
+
+#define ICH9_A2_LPC_REVISION                    0x2
+#define ICH9_LPC_NB_PIRQS                       8       /* PCI A-H */
+
+#define ICH9_LPC_PMBASE                         0x40
+#define ICH9_LPC_PMBASE_BASE_ADDRESS_MASK       Q35_MASK(32, 15, 7)
+#define ICH9_LPC_PMBASE_RTE                     0x1
+#define ICH9_LPC_PMBASE_DEFAULT                 0x1
+#define ICH9_LPC_ACPI_CTRL                      0x44
+#define ICH9_LPC_ACPI_CTRL_ACPI_EN              0x80
+#define ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK     Q35_MASK(8, 2, 0)
+#define ICH9_LPC_ACPI_CTRL_9                    0x0
+#define ICH9_LPC_ACPI_CTRL_10                   0x1
+#define ICH9_LPC_ACPI_CTRL_11                   0x2
+#define ICH9_LPC_ACPI_CTRL_20                   0x4
+#define ICH9_LPC_ACPI_CTRL_21                   0x5
+#define ICH9_LPC_ACPI_CTRL_DEFAULT              0x0
+
+#define ICH9_LPC_PIRQA_ROUT                     0x60
+#define ICH9_LPC_PIRQB_ROUT                     0x61
+#define ICH9_LPC_PIRQC_ROUT                     0x62
+#define ICH9_LPC_PIRQD_ROUT                     0x63
+
+#define ICH9_LPC_PIRQE_ROUT                     0x68
+#define ICH9_LPC_PIRQF_ROUT                     0x69
+#define ICH9_LPC_PIRQG_ROUT                     0x6a
+#define ICH9_LPC_PIRQH_ROUT                     0x6b
+
+#define ICH9_LPC_PIRQ_ROUT_IRQEN                0x80
+#define ICH9_LPC_PIRQ_ROUT_MASK                 Q35_MASK(8, 3, 0)
+#define ICH9_LPC_PIRQ_ROUT_DEFAULT              0x80
+
+#define ICH9_LPC_RCBA                           0xf0
+#define ICH9_LPC_RCBA_BA_MASK                   Q35_MASK(32, 31, 14)
+#define ICH9_LPC_RCBA_EN                        0x1
+#define ICH9_LPC_RCBA_DEFAULT                   0x0
+
+#define ICH9_LPC_PIC_NUM_PINS                   16
+#define ICH9_LPC_IOAPIC_NUM_PINS                24
+
+/* D31:F2 SATA Controller #1 */
+#define ICH9_SATA1_DEV                          31
+#define ICH9_SATA1_FUNC                         2
+
+/* D30:F1 power management I/O registers
+   offset from the address ICH9_LPC_PMBASE */
+
+/* ICH9 LPC PM I/O registers are 128 ports and 128-aligned */
+#define ICH9_PMIO_SIZE                          128
+#define ICH9_PMIO_MASK                          (ICH9_PMIO_SIZE - 1)
+
+#define ICH9_PMIO_PM1_STS                       0x00
+#define ICH9_PMIO_PM1_EN                        0x02
+#define ICH9_PMIO_PM1_CNT                       0x04
+#define ICH9_PMIO_PM1_TMR                       0x08
+#define ICH9_PMIO_GPE0_STS                      0x20
+#define ICH9_PMIO_GPE0_EN                       0x28
+#define ICH9_PMIO_GPE0_LEN                      16
+#define ICH9_PMIO_SMI_EN                        0x30
+#define ICH9_PMIO_SMI_EN_APMC_EN                (1 << 5)
+#define ICH9_PMIO_SMI_STS                       0x34
+
+/* FADT ACPI_ENABLE/ACPI_DISABLE */
+#define ICH9_APM_ACPI_ENABLE                    0x2
+#define ICH9_APM_ACPI_DISABLE                   0x3
+
+
+/* D31:F3 SMBus controller */
+#define ICH9_A2_SMB_REVISION                    0x02
+#define ICH9_SMB_PI                             0x00
+
+#define ICH9_SMB_SMBMBAR0                       0x10
+#define ICH9_SMB_SMBMBAR1                       0x14
+#define ICH9_SMB_SMBM_BAR                       0
+#define ICH9_SMB_SMBM_SIZE                      (1 << 8)
+#define ICH9_SMB_SMB_BASE                       0x20
+#define ICH9_SMB_SMB_BASE_BAR                   4
+#define ICH9_SMB_SMB_BASE_SIZE                  (1 << 5)
+#define ICH9_SMB_HOSTC                          0x40
+#define ICH9_SMB_HOSTC_SSRESET                  ((uint8_t)(1 << 3))
+#define ICH9_SMB_HOSTC_I2C_EN                   ((uint8_t)(1 << 2))
+#define ICH9_SMB_HOSTC_SMB_SMI_EN               ((uint8_t)(1 << 1))
+#define ICH9_SMB_HOSTC_HST_EN                   ((uint8_t)(1 << 0))
+
+/* D31:F3 SMBus I/O and memory mapped I/O registers */
+#define ICH9_SMB_DEV                            31
+#define ICH9_SMB_FUNC                           3
+
+#define ICH9_SMB_HST_STS                        0x00
+#define ICH9_SMB_HST_CNT                        0x02
+#define ICH9_SMB_HST_CMD                        0x03
+#define ICH9_SMB_XMIT_SLVA                      0x04
+#define ICH9_SMB_HST_D0                         0x05
+#define ICH9_SMB_HST_D1                         0x06
+#define ICH9_SMB_HOST_BLOCK_DB                  0x07
+
+#endif /* HW_ICH9_H */
diff --git a/hw/pci_ids.h b/hw/pci_ids.h
index 41f3570..d1e83dd 100644
--- a/hw/pci_ids.h
+++ b/hw/pci_ids.h
@@ -36,6 +36,7 @@
 #define PCI_CLASS_BRIDGE_HOST            0x0600
 #define PCI_CLASS_BRIDGE_ISA             0x0601
 #define PCI_CLASS_BRIDGE_PCI             0x0604
+#define PCI_CLASS_BRDIGE_PCI_INF_SUB     0x01
 #define PCI_CLASS_BRIDGE_OTHER           0x0680
 
 #define PCI_CLASS_COMMUNICATION_SERIAL   0x0700
@@ -116,6 +117,17 @@
 #define PCI_DEVICE_ID_INTEL_82371AB      0x7111
 #define PCI_DEVICE_ID_INTEL_82371AB_2    0x7112
 #define PCI_DEVICE_ID_INTEL_82371AB_3    0x7113
+
+#define PCI_DEVICE_ID_INTEL_ICH9_0       0x2910
+#define PCI_DEVICE_ID_INTEL_ICH9_1       0x2917
+#define PCI_DEVICE_ID_INTEL_ICH9_2       0x2912
+#define PCI_DEVICE_ID_INTEL_ICH9_3       0x2913
+#define PCI_DEVICE_ID_INTEL_ICH9_4       0x2914
+#define PCI_DEVICE_ID_INTEL_ICH9_5       0x2919
+#define PCI_DEVICE_ID_INTEL_ICH9_6       0x2930
+#define PCI_DEVICE_ID_INTEL_ICH9_7       0x2916
+#define PCI_DEVICE_ID_INTEL_ICH9_8       0x2918
+
 #define PCI_DEVICE_ID_INTEL_82801I_UHCI1 0x2934
 #define PCI_DEVICE_ID_INTEL_82801I_UHCI2 0x2935
 #define PCI_DEVICE_ID_INTEL_82801I_UHCI3 0x2936
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:48 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQER-00039V-T1; Tue, 11 Dec 2012 13:50:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEQ-00038z-HH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:46 +0000
Received: from [85.158.139.211:23180] by server-13.bemta-5.messagelabs.com id
	36/D1-10716-53A37C05; Tue, 11 Dec 2012 13:50:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1355233842!18210880!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4078 invoked from network); 11 Dec 2012 13:50:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEM-0001Oe-Fl
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEM-0005iz-Ax
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:42 +0000
Date: Tue, 11 Dec 2012 13:50:42 +0000
Message-Id: <E1TiQEM-0005iz-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ich9: Add acpi support and
	definitions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e516572fdefdf1168e890d1fd79d56cd44aa2102
Author: Jason Baron <jbaron@redhat.com>
Date:   Thu Nov 22 22:05:06 2012 -0500

    ich9: Add acpi support and definitions
    
    Lay the groundwork for subsequent ich9 support.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/Makefile.objs |    2 +-
 hw/acpi_ich9.c   |  315 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/acpi_ich9.h   |   47 ++++++++
 hw/ich9.h        |  207 +++++++++++++++++++++++++++++++++++
 hw/pci_ids.h     |   12 ++
 5 files changed, 582 insertions(+), 1 deletions(-)

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 5ebe6af..b863b31 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -28,7 +28,7 @@ common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
 common-obj-$(CONFIG_PCSPK) += pcspk.o
 common-obj-$(CONFIG_PCKBD) += pckbd.o
 common-obj-$(CONFIG_FDC) += fdc.o
-common-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o
+common-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o acpi_ich9.o
 common-obj-$(CONFIG_APM) += pm_smbus.o apm.o
 common-obj-$(CONFIG_DMA) += dma.o
 common-obj-$(CONFIG_I82374) += i82374.o
diff --git a/hw/acpi_ich9.c b/hw/acpi_ich9.c
new file mode 100644
index 0000000..c45921c
--- /dev/null
+++ b/hw/acpi_ich9.c
@@ -0,0 +1,315 @@
+/*
+ * ACPI implementation
+ *
+ * Copyright (c) 2006 Fabrice Bellard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+/*
+ *  Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
+ *                     VA Linux Systems Japan K.K.
+ *  Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ *  This is based on acpi.c.
+ */
+#include "hw.h"
+#include "pc.h"
+#include "pci.h"
+#include "qemu-timer.h"
+#include "sysemu.h"
+#include "acpi.h"
+
+#include "ich9.h"
+
+//#define DEBUG
+
+#ifdef DEBUG
+#define ICH9_DEBUG(fmt, ...) \
+do { printf("%s "fmt, __func__, ## __VA_ARGS__); } while (0)
+#else
+#define ICH9_DEBUG(fmt, ...)    do { } while (0)
+#endif
+
+static void pm_ioport_write_fallback(void *opaque, uint32_t addr, int len,
+                                     uint32_t val);
+static uint32_t pm_ioport_read_fallback(void *opaque, uint32_t addr, int len);
+
+static void pm_update_sci(ICH9LPCPMRegs *pm)
+{
+    int sci_level, pm1a_sts;
+
+    pm1a_sts = acpi_pm1_evt_get_sts(&pm->acpi_regs);
+
+    sci_level = (((pm1a_sts & pm->acpi_regs.pm1.evt.en) &
+                  (ACPI_BITMASK_RT_CLOCK_ENABLE |
+                   ACPI_BITMASK_POWER_BUTTON_ENABLE |
+                   ACPI_BITMASK_GLOBAL_LOCK_ENABLE |
+                   ACPI_BITMASK_TIMER_ENABLE)) != 0);
+    qemu_set_irq(pm->irq, sci_level);
+
+    /* schedule a timer interruption if needed */
+    acpi_pm_tmr_update(&pm->acpi_regs,
+                       (pm->acpi_regs.pm1.evt.en & ACPI_BITMASK_TIMER_ENABLE) &&
+                       !(pm1a_sts & ACPI_BITMASK_TIMER_STATUS));
+}
+
+static void ich9_pm_update_sci_fn(ACPIREGS *regs)
+{
+    ICH9LPCPMRegs *pm = container_of(regs, ICH9LPCPMRegs, acpi_regs);
+    pm_update_sci(pm);
+}
+
+static void pm_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
+{
+    ICH9LPCPMRegs *pm = opaque;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_GPE0_STS ... (ICH9_PMIO_GPE0_STS + ICH9_PMIO_GPE0_LEN - 1):
+        acpi_gpe_ioport_writeb(&pm->acpi_regs, addr, val);
+        break;
+    default:
+        break;
+    }
+
+    ICH9_DEBUG("port=0x%04x val=0x%04x\n", addr, val);
+}
+
+static uint32_t pm_ioport_readb(void *opaque, uint32_t addr)
+{
+    ICH9LPCPMRegs *pm = opaque;
+    uint32_t val = 0;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_GPE0_STS ... (ICH9_PMIO_GPE0_STS + ICH9_PMIO_GPE0_LEN - 1):
+        val = acpi_gpe_ioport_readb(&pm->acpi_regs, addr);
+        break;
+    default:
+        val = 0;
+        break;
+    }
+    ICH9_DEBUG("port=0x%04x val=0x%04x\n", addr, val);
+    return val;
+}
+
+static void pm_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
+{
+    ICH9LPCPMRegs *pm = opaque;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_PM1_STS:
+        acpi_pm1_evt_write_sts(&pm->acpi_regs, val);
+        pm_update_sci(pm);
+        break;
+    case ICH9_PMIO_PM1_EN:
+        pm->acpi_regs.pm1.evt.en = val;
+        pm_update_sci(pm);
+        break;
+    case ICH9_PMIO_PM1_CNT:
+        acpi_pm1_cnt_write(&pm->acpi_regs, val, 0);
+        break;
+    default:
+        pm_ioport_write_fallback(opaque, addr, 2, val);
+        break;
+    }
+    ICH9_DEBUG("port=0x%04x val=0x%04x\n", addr, val);
+}
+
+static uint32_t pm_ioport_readw(void *opaque, uint32_t addr)
+{
+    ICH9LPCPMRegs *pm = opaque;
+    uint32_t val;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_PM1_STS:
+        val = acpi_pm1_evt_get_sts(&pm->acpi_regs);
+        break;
+    case ICH9_PMIO_PM1_EN:
+        val = pm->acpi_regs.pm1.evt.en;
+        break;
+    case ICH9_PMIO_PM1_CNT:
+        val = pm->acpi_regs.pm1.cnt.cnt;
+        break;
+    default:
+        val = pm_ioport_read_fallback(opaque, addr, 2);
+        break;
+    }
+    ICH9_DEBUG("port=0x%04x val=0x%04x\n", addr, val);
+    return val;
+}
+
+static void pm_ioport_writel(void *opaque, uint32_t addr, uint32_t val)
+{
+    ICH9LPCPMRegs *pm = opaque;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_SMI_EN:
+        pm->smi_en = val;
+        break;
+    default:
+        pm_ioport_write_fallback(opaque, addr, 4, val);
+        break;
+    }
+    ICH9_DEBUG("port=0x%04x val=0x%08x\n", addr, val);
+}
+
+static uint32_t pm_ioport_readl(void *opaque, uint32_t addr)
+{
+    ICH9LPCPMRegs *pm = opaque;
+    uint32_t val;
+
+    switch (addr & ICH9_PMIO_MASK) {
+    case ICH9_PMIO_PM1_TMR:
+        val = acpi_pm_tmr_get(&pm->acpi_regs);
+        break;
+    case ICH9_PMIO_SMI_EN:
+        val = pm->smi_en;
+        break;
+
+    default:
+        val = pm_ioport_read_fallback(opaque, addr, 4);
+        break;
+    }
+    ICH9_DEBUG("port=0x%04x val=0x%08x\n", addr, val);
+    return val;
+}
+
+static void pm_ioport_write_fallback(void *opaque, uint32_t addr, int len,
+                                     uint32_t val)
+ {
+    int subsize = (len == 4) ? 2 : 1;
+    IOPortWriteFunc *ioport_write =
+        (subsize == 2) ? pm_ioport_writew : pm_ioport_writeb;
+
+    int i;
+
+    for (i = 0; i < len; i += subsize) {
+        ioport_write(opaque, addr, val);
+        val >>= 8 * subsize;
+    }
+}
+
+static uint32_t pm_ioport_read_fallback(void *opaque, uint32_t addr, int len)
+{
+    int subsize = (len == 4) ? 2 : 1;
+    IOPortReadFunc *ioport_read =
+        (subsize == 2) ? pm_ioport_readw : pm_ioport_readb;
+
+    uint32_t val;
+    int i;
+
+    val = 0;
+    for (i = 0; i < len; i += subsize) {
+        val <<= 8 * subsize;
+        val |= ioport_read(opaque, addr);
+    }
+
+    return val;
+}
+
+void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base)
+{
+    ICH9_DEBUG("to 0x%x\n", pm_io_base);
+
+    assert((pm_io_base & ICH9_PMIO_MASK) == 0);
+
+    if (pm->pm_io_base != 0) {
+        isa_unassign_ioport(pm->pm_io_base, ICH9_PMIO_SIZE);
+    }
+
+    /* don't map at 0 */
+    if (pm_io_base == 0) {
+        return;
+    }
+
+    register_ioport_write(pm_io_base, ICH9_PMIO_SIZE, 1, pm_ioport_writeb, pm);
+    register_ioport_read(pm_io_base, ICH9_PMIO_SIZE, 1, pm_ioport_readb, pm);
+    register_ioport_write(pm_io_base, ICH9_PMIO_SIZE, 2, pm_ioport_writew, pm);
+    register_ioport_read(pm_io_base, ICH9_PMIO_SIZE, 2, pm_ioport_readw, pm);
+    register_ioport_write(pm_io_base, ICH9_PMIO_SIZE, 4, pm_ioport_writel, pm);
+    register_ioport_read(pm_io_base, ICH9_PMIO_SIZE, 4, pm_ioport_readl, pm);
+
+    pm->pm_io_base = pm_io_base;
+    acpi_gpe_blk(&pm->acpi_regs, pm_io_base + ICH9_PMIO_GPE0_STS);
+}
+
+static int ich9_pm_post_load(void *opaque, int version_id)
+{
+    ICH9LPCPMRegs *pm = opaque;
+    uint32_t pm_io_base = pm->pm_io_base;
+    pm->pm_io_base = 0;
+    ich9_pm_iospace_update(pm, pm_io_base);
+    return 0;
+}
+
+#define VMSTATE_GPE_ARRAY(_field, _state)                            \
+ {                                                                   \
+     .name       = (stringify(_field)),                              \
+     .version_id = 0,                                                \
+     .num        = ICH9_PMIO_GPE0_LEN,                               \
+     .info       = &vmstate_info_uint8,                              \
+     .size       = sizeof(uint8_t),                                  \
+     .flags      = VMS_ARRAY | VMS_POINTER,                          \
+     .offset     = vmstate_offset_pointer(_state, _field, uint8_t),  \
+ }
+
+const VMStateDescription vmstate_ich9_pm = {
+    .name = "ich9_pm",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .post_load = ich9_pm_post_load,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT16(acpi_regs.pm1.evt.sts, ICH9LPCPMRegs),
+        VMSTATE_UINT16(acpi_regs.pm1.evt.en, ICH9LPCPMRegs),
+        VMSTATE_UINT16(acpi_regs.pm1.cnt.cnt, ICH9LPCPMRegs),
+        VMSTATE_TIMER(acpi_regs.tmr.timer, ICH9LPCPMRegs),
+        VMSTATE_INT64(acpi_regs.tmr.overflow_time, ICH9LPCPMRegs),
+        VMSTATE_GPE_ARRAY(acpi_regs.gpe.sts, ICH9LPCPMRegs),
+        VMSTATE_GPE_ARRAY(acpi_regs.gpe.en, ICH9LPCPMRegs),
+        VMSTATE_UINT32(smi_en, ICH9LPCPMRegs),
+        VMSTATE_UINT32(smi_sts, ICH9LPCPMRegs),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static void pm_reset(void *opaque)
+{
+    ICH9LPCPMRegs *pm = opaque;
+    ich9_pm_iospace_update(pm, 0);
+
+    acpi_pm1_evt_reset(&pm->acpi_regs);
+    acpi_pm1_cnt_reset(&pm->acpi_regs);
+    acpi_pm_tmr_reset(&pm->acpi_regs);
+    acpi_gpe_reset(&pm->acpi_regs);
+
+    pm_update_sci(pm);
+}
+
+static void pm_powerdown_req(Notifier *n, void *opaque)
+{
+    ICH9LPCPMRegs *pm = container_of(n, ICH9LPCPMRegs, powerdown_notifier);
+
+    acpi_pm1_evt_power_down(&pm->acpi_regs);
+}
+
+void ich9_pm_init(ICH9LPCPMRegs *pm, qemu_irq sci_irq, qemu_irq cmos_s3)
+{
+    acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn);
+    acpi_pm1_cnt_init(&pm->acpi_regs);
+    acpi_gpe_init(&pm->acpi_regs, ICH9_PMIO_GPE0_LEN);
+
+    pm->irq = sci_irq;
+    qemu_register_reset(pm_reset, pm);
+    pm->powerdown_notifier.notify = pm_powerdown_req;
+    qemu_register_powerdown_notifier(&pm->powerdown_notifier);
+}
diff --git a/hw/acpi_ich9.h b/hw/acpi_ich9.h
new file mode 100644
index 0000000..180c406
--- /dev/null
+++ b/hw/acpi_ich9.h
@@ -0,0 +1,47 @@
+/*
+ * QEMU GMCH/ICH9 LPC PM Emulation
+ *
+ *  Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
+ *                     VA Linux Systems Japan K.K.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#ifndef HW_ACPI_ICH9_H
+#define HW_ACPI_ICH9_H
+
+#include "acpi.h"
+
+typedef struct ICH9LPCPMRegs {
+    /*
+     * In ich9 spec says that pm1_cnt register is 32bit width and
+     * that the upper 16bits are reserved and unused.
+     * PM1a_CNT_BLK = 2 in FADT so it is defined as uint16_t.
+     */
+    ACPIREGS acpi_regs;
+    uint32_t smi_en;
+    uint32_t smi_sts;
+
+    qemu_irq irq;      /* SCI */
+
+    uint32_t pm_io_base;
+    Notifier powerdown_notifier;
+} ICH9LPCPMRegs;
+
+void ich9_pm_init(ICH9LPCPMRegs *pm,
+                  qemu_irq sci_irq, qemu_irq cmos_s3_resume);
+void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base);
+extern const VMStateDescription vmstate_ich9_pm;
+
+#endif /* HW_ACPI_ICH9_H */
diff --git a/hw/ich9.h b/hw/ich9.h
new file mode 100644
index 0000000..de49135
--- /dev/null
+++ b/hw/ich9.h
@@ -0,0 +1,207 @@
+#ifndef HW_ICH9_H
+#define HW_ICH9_H
+
+#include "hw.h"
+#include "range.h"
+#include "isa.h"
+#include "sysbus.h"
+#include "pc.h"
+#include "apm.h"
+#include "ioapic.h"
+#include "pci.h"
+#include "pcie_host.h"
+#include "pci_bridge.h"
+#include "acpi.h"
+#include "acpi_ich9.h"
+#include "pam.h"
+#include "pci_internals.h"
+
+void ich9_lpc_set_irq(void *opaque, int irq_num, int level);
+int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx);
+void ich9_lpc_pm_init(PCIDevice *pci_lpc, qemu_irq cmos_s3);
+PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus);
+i2c_bus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base);
+
+#define ICH9_CC_SIZE                            (16 * 1024)     /* 16KB */
+
+#define TYPE_ICH9_LPC_DEVICE "ICH9 LPC"
+#define ICH9_LPC_DEVICE(obj) \
+     OBJECT_CHECK(ICH9LPCState, (obj), TYPE_ICH9_LPC_DEVICE)
+
+typedef struct ICH9LPCState {
+    /* ICH9 LPC PCI to ISA bridge */
+    PCIDevice d;
+
+    /* (pci device, intx) -> pirq
+     * In real chipset case, the unused slots are never used
+     * as ICH9 supports only D25-D32 irq routing.
+     * On the other hand in qemu case, any slot/function can be populated
+     * via command line option.
+     * So fallback interrupt routing for any devices in any slots is necessary.
+    */
+    uint8_t irr[PCI_SLOT_MAX][PCI_NUM_PINS];
+
+    APMState apm;
+    ICH9LPCPMRegs pm;
+    uint32_t sci_level; /* track sci level */
+
+    /* 10.1 Chipset Configuration registers(Memory Space)
+     which is pointed by RCBA */
+    uint8_t chip_config[ICH9_CC_SIZE];
+    /* isa bus */
+    ISABus *isa_bus;
+    MemoryRegion rbca_mem;
+
+    qemu_irq *pic;
+    qemu_irq *ioapic;
+} ICH9LPCState;
+
+#define Q35_MASK(bit, ms_bit, ls_bit) \
+((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1)))
+
+/* ICH9: Chipset Configuration Registers */
+#define ICH9_CC_ADDR_MASK                       (ICH9_CC_SIZE - 1)
+
+#define ICH9_CC
+#define ICH9_CC_D28IP                           0x310C
+#define ICH9_CC_D28IP_SHIFT                     4
+#define ICH9_CC_D28IP_MASK                      0xf
+#define ICH9_CC_D28IP_DEFAULT                   0x00214321
+#define ICH9_CC_D31IR                           0x3140
+#define ICH9_CC_D30IR                           0x3142
+#define ICH9_CC_D29IR                           0x3144
+#define ICH9_CC_D28IR                           0x3146
+#define ICH9_CC_D27IR                           0x3148
+#define ICH9_CC_D26IR                           0x314C
+#define ICH9_CC_D25IR                           0x3150
+#define ICH9_CC_DIR_DEFAULT                     0x3210
+#define ICH9_CC_D30IR_DEFAULT                   0x0
+#define ICH9_CC_DIR_SHIFT                       4
+#define ICH9_CC_DIR_MASK                        0x7
+#define ICH9_CC_OIC                             0x31FF
+#define ICH9_CC_OIC_AEN                         0x1
+
+/* D28:F[0-5] */
+#define ICH9_PCIE_DEV                           28
+#define ICH9_PCIE_FUNC_MAX                      6
+
+
+/* D29:F0 USB UHCI Controller #1 */
+#define ICH9_USB_UHCI1_DEV                      29
+#define ICH9_USB_UHCI1_FUNC                     0
+
+/* D30:F0 DMI-to-PCI brdige */
+#define ICH9_D2P_BRIDGE                         "ICH9 D2P BRIDGE"
+#define ICH9_D2P_BRIDGE_SAVEVM_VERSION          0
+
+#define ICH9_D2P_BRIDGE_DEV                     30
+#define ICH9_D2P_BRIDGE_FUNC                    0
+
+#define ICH9_D2P_SECONDARY_DEFAULT              (256 - 8)
+
+#define ICH9_D2P_A2_REVISION                    0x92
+
+
+/* D31:F1 LPC controller */
+#define ICH9_A2_LPC                             "ICH9 A2 LPC"
+#define ICH9_A2_LPC_SAVEVM_VERSION              0
+
+#define ICH9_LPC_DEV                            31
+#define ICH9_LPC_FUNC                           0
+
+#define ICH9_A2_LPC_REVISION                    0x2
+#define ICH9_LPC_NB_PIRQS                       8       /* PCI A-H */
+
+#define ICH9_LPC_PMBASE                         0x40
+#define ICH9_LPC_PMBASE_BASE_ADDRESS_MASK       Q35_MASK(32, 15, 7)
+#define ICH9_LPC_PMBASE_RTE                     0x1
+#define ICH9_LPC_PMBASE_DEFAULT                 0x1
+#define ICH9_LPC_ACPI_CTRL                      0x44
+#define ICH9_LPC_ACPI_CTRL_ACPI_EN              0x80
+#define ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK     Q35_MASK(8, 2, 0)
+#define ICH9_LPC_ACPI_CTRL_9                    0x0
+#define ICH9_LPC_ACPI_CTRL_10                   0x1
+#define ICH9_LPC_ACPI_CTRL_11                   0x2
+#define ICH9_LPC_ACPI_CTRL_20                   0x4
+#define ICH9_LPC_ACPI_CTRL_21                   0x5
+#define ICH9_LPC_ACPI_CTRL_DEFAULT              0x0
+
+#define ICH9_LPC_PIRQA_ROUT                     0x60
+#define ICH9_LPC_PIRQB_ROUT                     0x61
+#define ICH9_LPC_PIRQC_ROUT                     0x62
+#define ICH9_LPC_PIRQD_ROUT                     0x63
+
+#define ICH9_LPC_PIRQE_ROUT                     0x68
+#define ICH9_LPC_PIRQF_ROUT                     0x69
+#define ICH9_LPC_PIRQG_ROUT                     0x6a
+#define ICH9_LPC_PIRQH_ROUT                     0x6b
+
+#define ICH9_LPC_PIRQ_ROUT_IRQEN                0x80
+#define ICH9_LPC_PIRQ_ROUT_MASK                 Q35_MASK(8, 3, 0)
+#define ICH9_LPC_PIRQ_ROUT_DEFAULT              0x80
+
+#define ICH9_LPC_RCBA                           0xf0
+#define ICH9_LPC_RCBA_BA_MASK                   Q35_MASK(32, 31, 14)
+#define ICH9_LPC_RCBA_EN                        0x1
+#define ICH9_LPC_RCBA_DEFAULT                   0x0
+
+#define ICH9_LPC_PIC_NUM_PINS                   16
+#define ICH9_LPC_IOAPIC_NUM_PINS                24
+
+/* D31:F2 SATA Controller #1 */
+#define ICH9_SATA1_DEV                          31
+#define ICH9_SATA1_FUNC                         2
+
+/* D30:F1 power management I/O registers
+   offset from the address ICH9_LPC_PMBASE */
+
+/* ICH9 LPC PM I/O registers are 128 ports and 128-aligned */
+#define ICH9_PMIO_SIZE                          128
+#define ICH9_PMIO_MASK                          (ICH9_PMIO_SIZE - 1)
+
+#define ICH9_PMIO_PM1_STS                       0x00
+#define ICH9_PMIO_PM1_EN                        0x02
+#define ICH9_PMIO_PM1_CNT                       0x04
+#define ICH9_PMIO_PM1_TMR                       0x08
+#define ICH9_PMIO_GPE0_STS                      0x20
+#define ICH9_PMIO_GPE0_EN                       0x28
+#define ICH9_PMIO_GPE0_LEN                      16
+#define ICH9_PMIO_SMI_EN                        0x30
+#define ICH9_PMIO_SMI_EN_APMC_EN                (1 << 5)
+#define ICH9_PMIO_SMI_STS                       0x34
+
+/* FADT ACPI_ENABLE/ACPI_DISABLE */
+#define ICH9_APM_ACPI_ENABLE                    0x2
+#define ICH9_APM_ACPI_DISABLE                   0x3
+
+
+/* D31:F3 SMBus controller */
+#define ICH9_A2_SMB_REVISION                    0x02
+#define ICH9_SMB_PI                             0x00
+
+#define ICH9_SMB_SMBMBAR0                       0x10
+#define ICH9_SMB_SMBMBAR1                       0x14
+#define ICH9_SMB_SMBM_BAR                       0
+#define ICH9_SMB_SMBM_SIZE                      (1 << 8)
+#define ICH9_SMB_SMB_BASE                       0x20
+#define ICH9_SMB_SMB_BASE_BAR                   4
+#define ICH9_SMB_SMB_BASE_SIZE                  (1 << 5)
+#define ICH9_SMB_HOSTC                          0x40
+#define ICH9_SMB_HOSTC_SSRESET                  ((uint8_t)(1 << 3))
+#define ICH9_SMB_HOSTC_I2C_EN                   ((uint8_t)(1 << 2))
+#define ICH9_SMB_HOSTC_SMB_SMI_EN               ((uint8_t)(1 << 1))
+#define ICH9_SMB_HOSTC_HST_EN                   ((uint8_t)(1 << 0))
+
+/* D31:F3 SMBus I/O and memory mapped I/O registers */
+#define ICH9_SMB_DEV                            31
+#define ICH9_SMB_FUNC                           3
+
+#define ICH9_SMB_HST_STS                        0x00
+#define ICH9_SMB_HST_CNT                        0x02
+#define ICH9_SMB_HST_CMD                        0x03
+#define ICH9_SMB_XMIT_SLVA                      0x04
+#define ICH9_SMB_HST_D0                         0x05
+#define ICH9_SMB_HST_D1                         0x06
+#define ICH9_SMB_HOST_BLOCK_DB                  0x07
+
+#endif /* HW_ICH9_H */
diff --git a/hw/pci_ids.h b/hw/pci_ids.h
index 41f3570..d1e83dd 100644
--- a/hw/pci_ids.h
+++ b/hw/pci_ids.h
@@ -36,6 +36,7 @@
 #define PCI_CLASS_BRIDGE_HOST            0x0600
 #define PCI_CLASS_BRIDGE_ISA             0x0601
 #define PCI_CLASS_BRIDGE_PCI             0x0604
+#define PCI_CLASS_BRDIGE_PCI_INF_SUB     0x01
 #define PCI_CLASS_BRIDGE_OTHER           0x0680
 
 #define PCI_CLASS_COMMUNICATION_SERIAL   0x0700
@@ -116,6 +117,17 @@
 #define PCI_DEVICE_ID_INTEL_82371AB      0x7111
 #define PCI_DEVICE_ID_INTEL_82371AB_2    0x7112
 #define PCI_DEVICE_ID_INTEL_82371AB_3    0x7113
+
+#define PCI_DEVICE_ID_INTEL_ICH9_0       0x2910
+#define PCI_DEVICE_ID_INTEL_ICH9_1       0x2917
+#define PCI_DEVICE_ID_INTEL_ICH9_2       0x2912
+#define PCI_DEVICE_ID_INTEL_ICH9_3       0x2913
+#define PCI_DEVICE_ID_INTEL_ICH9_4       0x2914
+#define PCI_DEVICE_ID_INTEL_ICH9_5       0x2919
+#define PCI_DEVICE_ID_INTEL_ICH9_6       0x2930
+#define PCI_DEVICE_ID_INTEL_ICH9_7       0x2916
+#define PCI_DEVICE_ID_INTEL_ICH9_8       0x2918
+
 #define PCI_DEVICE_ID_INTEL_82801I_UHCI1 0x2934
 #define PCI_DEVICE_ID_INTEL_82801I_UHCI2 0x2935
 #define PCI_DEVICE_ID_INTEL_82801I_UHCI3 0x2936
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEU-0003AH-0T; Tue, 11 Dec 2012 13:50:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQES-00039O-4s
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:48 +0000
Received: from [85.158.139.83:16995] by server-12.bemta-5.messagelabs.com id
	4E/77-02275-73A37C05; Tue, 11 Dec 2012 13:50:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1355233830!25478949!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21943 invoked from network); 11 Dec 2012 13:50:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDA-0001NQ-9e
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQD7-0005f9-UK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:25 +0000
Date: Tue, 11 Dec 2012 13:49:25 +0000
Message-Id: <E1TiQD7-0005f9-UK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Legacy qemu-kvm options
	have no argument
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6e88b3b27b411e3f1c924deb8b71b20f8a11107
Author: Bruce Rogers <brogers@suse.com>
Date:   Tue Nov 20 07:11:21 2012 -0700

    Legacy qemu-kvm options have no argument
    
    The options no-kvm, no-kvm-pit, no-kvm-pit-reinjection, and no-kvm-irqchip
    should be marked as having no argument.
    
    Signed-off-by: Bruce Rogers <brogers@suse.com>
    Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
 qemu-options.hx |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 9bb29d3..fbcf079 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2918,17 +2918,17 @@ Enable FIPS 140-2 compliance mode.
 ETEXI
 
 HXCOMM Deprecated by -machine accel=tcg property
-DEF("no-kvm", HAS_ARG, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
+DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
 
 HXCOMM Deprecated by kvm-pit driver properties
-DEF("no-kvm-pit-reinjection", HAS_ARG, QEMU_OPTION_no_kvm_pit_reinjection,
+DEF("no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection,
     "", QEMU_ARCH_I386)
 
 HXCOMM Deprecated (ignored)
-DEF("no-kvm-pit", HAS_ARG, QEMU_OPTION_no_kvm_pit, "", QEMU_ARCH_I386)
+DEF("no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit, "", QEMU_ARCH_I386)
 
 HXCOMM Deprecated by -machine kernel_irqchip=on|off property
-DEF("no-kvm-irqchip", HAS_ARG, QEMU_OPTION_no_kvm_irqchip, "", QEMU_ARCH_I386)
+DEF("no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip, "", QEMU_ARCH_I386)
 
 HXCOMM Deprecated (ignored)
 DEF("tdf", 0, QEMU_OPTION_tdf,"", QEMU_ARCH_ALL)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEU-0003AH-0T; Tue, 11 Dec 2012 13:50:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQES-00039O-4s
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:48 +0000
Received: from [85.158.139.83:16995] by server-12.bemta-5.messagelabs.com id
	4E/77-02275-73A37C05; Tue, 11 Dec 2012 13:50:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1355233830!25478949!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21943 invoked from network); 11 Dec 2012 13:50:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQDA-0001NQ-9e
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQD7-0005f9-UK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:25 +0000
Date: Tue, 11 Dec 2012 13:49:25 +0000
Message-Id: <E1TiQD7-0005f9-UK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Legacy qemu-kvm options
	have no argument
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6e88b3b27b411e3f1c924deb8b71b20f8a11107
Author: Bruce Rogers <brogers@suse.com>
Date:   Tue Nov 20 07:11:21 2012 -0700

    Legacy qemu-kvm options have no argument
    
    The options no-kvm, no-kvm-pit, no-kvm-pit-reinjection, and no-kvm-irqchip
    should be marked as having no argument.
    
    Signed-off-by: Bruce Rogers <brogers@suse.com>
    Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
 qemu-options.hx |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 9bb29d3..fbcf079 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2918,17 +2918,17 @@ Enable FIPS 140-2 compliance mode.
 ETEXI
 
 HXCOMM Deprecated by -machine accel=tcg property
-DEF("no-kvm", HAS_ARG, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
+DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
 
 HXCOMM Deprecated by kvm-pit driver properties
-DEF("no-kvm-pit-reinjection", HAS_ARG, QEMU_OPTION_no_kvm_pit_reinjection,
+DEF("no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection,
     "", QEMU_ARCH_I386)
 
 HXCOMM Deprecated (ignored)
-DEF("no-kvm-pit", HAS_ARG, QEMU_OPTION_no_kvm_pit, "", QEMU_ARCH_I386)
+DEF("no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit, "", QEMU_ARCH_I386)
 
 HXCOMM Deprecated by -machine kernel_irqchip=on|off property
-DEF("no-kvm-irqchip", HAS_ARG, QEMU_OPTION_no_kvm_irqchip, "", QEMU_ARCH_I386)
+DEF("no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip, "", QEMU_ARCH_I386)
 
 HXCOMM Deprecated (ignored)
 DEF("tdf", 0, QEMU_OPTION_tdf,"", QEMU_ARCH_ALL)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:58 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEc-0003E9-5q; Tue, 11 Dec 2012 13:50:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEa-0003Df-Ix
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:56 +0000
Received: from [85.158.139.83:18281] by server-11.bemta-5.messagelabs.com id
	B8/28-31624-F3A37C05; Tue, 11 Dec 2012 13:50:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1355233853!25046140!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17998 invoked from network); 11 Dec 2012 13:50:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEW-0001PG-Ur
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEW-0005jN-ME
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:52 +0000
Date: Tue, 11 Dec 2012 13:50:52 +0000
Message-Id: <E1TiQEW-0005jN-ME@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ich9: Add the lpc chip
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d00636e97b7f55810ff7faccff594159175e24e
Author: Jason Baron <jbaron@redhat.com>
Date:   Wed Nov 14 15:54:05 2012 -0500

    ich9: Add the lpc chip
    
    Add support for the ICH9 LPC chip.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/i386/Makefile.objs |    1 +
 hw/lpc_ich9.c         |  523 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 524 insertions(+), 0 deletions(-)

diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 8c764bb..9543a69 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -6,6 +6,7 @@ obj-y += pci-hotplug.o smbios.o wdt_ib700.o
 obj-y += debugcon.o multiboot.o
 obj-y += pc_piix.o
 obj-y += pc_sysfw.o
+obj-y += lpc_ich9.o
 obj-$(CONFIG_XEN) += xen_platform.o xen_apic.o
 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o
 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_msi.o
diff --git a/hw/lpc_ich9.c b/hw/lpc_ich9.c
new file mode 100644
index 0000000..f8f06b3
--- /dev/null
+++ b/hw/lpc_ich9.c
@@ -0,0 +1,523 @@
+/*
+ * Copyright (c) 2006 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+/*
+ * QEMU ICH9 Emulation
+ *
+ *  Copyright (c) 2009, 2010, 2011
+ *                Isaku Yamahata <yamahata at valinux co jp>
+ *                VA Linux Systems Japan K.K.
+ *  Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ *  This is based on piix_pci.c, but heavily modified.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "qemu-common.h"
+#include "hw.h"
+#include "range.h"
+#include "isa.h"
+#include "sysbus.h"
+#include "pc.h"
+#include "apm.h"
+#include "ioapic.h"
+#include "pci.h"
+#include "pcie_host.h"
+#include "pci_bridge.h"
+#include "ich9.h"
+#include "acpi.h"
+#include "acpi_ich9.h"
+#include "pam.h"
+#include "pci_internals.h"
+#include "exec-memory.h"
+
+static int ich9_lpc_sci_irq(ICH9LPCState *lpc);
+
+/*****************************************************************************/
+/* ICH9 LPC PCI to ISA bridge */
+
+static void ich9_lpc_reset(DeviceState *qdev);
+
+/* chipset configuration register
+ * to access chipset configuration registers, pci_[sg]et_{byte, word, long}
+ * are used.
+ * Although it's not pci configuration space, it's little endian as Intel.
+ */
+
+static void ich9_cc_update_ir(uint8_t irr[PCI_NUM_PINS], uint16_t ir)
+{
+    int intx;
+    for (intx = 0; intx < PCI_NUM_PINS; intx++) {
+        irr[intx] = (ir >> (intx * ICH9_CC_DIR_SHIFT)) & ICH9_CC_DIR_MASK;
+    }
+}
+
+static void ich9_cc_update(ICH9LPCState *lpc)
+{
+    int slot;
+    int pci_intx;
+
+    const int reg_offsets[] = {
+        ICH9_CC_D25IR,
+        ICH9_CC_D26IR,
+        ICH9_CC_D27IR,
+        ICH9_CC_D28IR,
+        ICH9_CC_D29IR,
+        ICH9_CC_D30IR,
+        ICH9_CC_D31IR,
+    };
+    const int *offset;
+
+    /* D{25 - 31}IR, but D30IR is read only to 0. */
+    for (slot = 25, offset = reg_offsets; slot < 32; slot++, offset++) {
+        if (slot == 30) {
+            continue;
+        }
+        ich9_cc_update_ir(lpc->irr[slot],
+                          pci_get_word(lpc->chip_config + *offset));
+    }
+
+    /*
+     * D30: DMI2PCI bridge
+     * It is arbitrarily decided how INTx lines of PCI devicesbehind the bridge
+     * are connected to pirq lines. Our choice is PIRQ[E-H].
+     * INT[A-D] are connected to PIRQ[E-H]
+     */
+    for (pci_intx = 0; pci_intx < PCI_NUM_PINS; pci_intx++) {
+        lpc->irr[30][pci_intx] = pci_intx + 4;
+    }
+}
+
+static void ich9_cc_init(ICH9LPCState *lpc)
+{
+    int slot;
+    int intx;
+
+    /* the default irq routing is arbitrary as long as it matches with
+     * acpi irq routing table.
+     * The one that is incompatible with piix_pci(= bochs) one is
+     * intentionally chosen to let the users know that the different
+     * board is used.
+     *
+     * int[A-D] -> pirq[E-F]
+     * avoid pirq A-D because they are used for pci express port
+     */
+    for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
+        for (intx = 0; intx < PCI_NUM_PINS; intx++) {
+            lpc->irr[slot][intx] = (slot + intx) % 4 + 4;
+        }
+    }
+    ich9_cc_update(lpc);
+}
+
+static void ich9_cc_reset(ICH9LPCState *lpc)
+{
+    uint8_t *c = lpc->chip_config;
+
+    memset(lpc->chip_config, 0, sizeof(lpc->chip_config));
+
+    pci_set_long(c + ICH9_CC_D31IR, ICH9_CC_DIR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D30IR, ICH9_CC_D30IR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D29IR, ICH9_CC_DIR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D28IR, ICH9_CC_DIR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D27IR, ICH9_CC_DIR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D26IR, ICH9_CC_DIR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D25IR, ICH9_CC_DIR_DEFAULT);
+
+    ich9_cc_update(lpc);
+}
+
+static void ich9_cc_addr_len(uint64_t *addr, unsigned *len)
+{
+    *addr &= ICH9_CC_ADDR_MASK;
+    if (*addr + *len >= ICH9_CC_SIZE) {
+        *len = ICH9_CC_SIZE - *addr;
+    }
+}
+
+/* val: little endian */
+static void ich9_cc_write(void *opaque, hwaddr addr,
+                          uint64_t val, unsigned len)
+{
+    ICH9LPCState *lpc = (ICH9LPCState *)opaque;
+
+    ich9_cc_addr_len(&addr, &len);
+    memcpy(lpc->chip_config + addr, &val, len);
+    ich9_cc_update(lpc);
+}
+
+/* return value: little endian */
+static uint64_t ich9_cc_read(void *opaque, hwaddr addr,
+                              unsigned len)
+{
+    ICH9LPCState *lpc = (ICH9LPCState *)opaque;
+
+    uint32_t val = 0;
+    ich9_cc_addr_len(&addr, &len);
+    memcpy(&val, lpc->chip_config + addr, len);
+    return val;
+}
+
+/* IRQ routing */
+/* */
+static void ich9_lpc_rout(uint8_t pirq_rout, int *pic_irq, int *pic_dis)
+{
+    *pic_irq = pirq_rout & ICH9_LPC_PIRQ_ROUT_MASK;
+    *pic_dis = pirq_rout & ICH9_LPC_PIRQ_ROUT_IRQEN;
+}
+
+static void ich9_lpc_pic_irq(ICH9LPCState *lpc, int pirq_num,
+                             int *pic_irq, int *pic_dis)
+{
+    switch (pirq_num) {
+    case 0 ... 3: /* A-D */
+        ich9_lpc_rout(lpc->d.config[ICH9_LPC_PIRQA_ROUT + pirq_num],
+                      pic_irq, pic_dis);
+        return;
+    case 4 ... 7: /* E-H */
+        ich9_lpc_rout(lpc->d.config[ICH9_LPC_PIRQE_ROUT + (pirq_num - 4)],
+                      pic_irq, pic_dis);
+        return;
+    default:
+        break;
+    }
+    abort();
+}
+
+/* pic_irq: i8254 irq 0-15 */
+static void ich9_lpc_update_pic(ICH9LPCState *lpc, int pic_irq)
+{
+    int i, pic_level;
+
+    /* The pic level is the logical OR of all the PCI irqs mapped to it */
+    pic_level = 0;
+    for (i = 0; i < ICH9_LPC_NB_PIRQS; i++) {
+        int tmp_irq;
+        int tmp_dis;
+        ich9_lpc_pic_irq(lpc, i, &tmp_irq, &tmp_dis);
+        if (!tmp_dis && pic_irq == tmp_irq) {
+            pic_level |= pci_bus_get_irq_level(lpc->d.bus, i);
+        }
+    }
+    if (pic_irq == ich9_lpc_sci_irq(lpc)) {
+        pic_level |= lpc->sci_level;
+    }
+
+    qemu_set_irq(lpc->pic[pic_irq], pic_level);
+}
+
+/* pirq: pirq[A-H] 0-7*/
+static void ich9_lpc_update_by_pirq(ICH9LPCState *lpc, int pirq)
+{
+    int pic_irq;
+    int pic_dis;
+
+    ich9_lpc_pic_irq(lpc, pirq, &pic_irq, &pic_dis);
+    assert(pic_irq < ICH9_LPC_PIC_NUM_PINS);
+    if (pic_dis) {
+        return;
+    }
+
+    ich9_lpc_update_pic(lpc, pic_irq);
+}
+
+/* APIC mode: GSIx: PIRQ[A-H] -> GSI 16, ... no pirq shares same APIC pins. */
+static int ich9_pirq_to_gsi(int pirq)
+{
+    return pirq + ICH9_LPC_PIC_NUM_PINS;
+}
+
+static int ich9_gsi_to_pirq(int gsi)
+{
+    return gsi - ICH9_LPC_PIC_NUM_PINS;
+}
+
+static void ich9_lpc_update_apic(ICH9LPCState *lpc, int gsi)
+{
+    int level;
+
+    level = pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));
+    if (gsi == ich9_lpc_sci_irq(lpc)) {
+        level |= lpc->sci_level;
+    }
+
+    qemu_set_irq(lpc->ioapic[gsi], level);
+}
+
+void ich9_lpc_set_irq(void *opaque, int pirq, int level)
+{
+    ICH9LPCState *lpc = opaque;
+
+    assert(0 <= pirq);
+    assert(pirq < ICH9_LPC_NB_PIRQS);
+
+    ich9_lpc_update_apic(lpc, ich9_pirq_to_gsi(pirq));
+    ich9_lpc_update_by_pirq(lpc, pirq);
+}
+
+/* return the pirq number (PIRQ[A-H]:0-7) corresponding to
+ * a given device irq pin.
+ */
+int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx)
+{
+    BusState *bus = qdev_get_parent_bus(&pci_dev->qdev);
+    PCIBus *pci_bus = PCI_BUS(bus);
+    PCIDevice *lpc_pdev =
+            pci_bus->devices[PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC)];
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(lpc_pdev);
+
+    return lpc->irr[PCI_SLOT(pci_dev->devfn)][intx];
+}
+
+static int ich9_lpc_sci_irq(ICH9LPCState *lpc)
+{
+    switch (lpc->d.config[ICH9_LPC_ACPI_CTRL] &
+            ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK) {
+    case ICH9_LPC_ACPI_CTRL_9:
+        return 9;
+    case ICH9_LPC_ACPI_CTRL_10:
+        return 10;
+    case ICH9_LPC_ACPI_CTRL_11:
+        return 11;
+    case ICH9_LPC_ACPI_CTRL_20:
+        return 20;
+    case ICH9_LPC_ACPI_CTRL_21:
+        return 21;
+    default:
+        /* reserved */
+        break;
+    }
+    return -1;
+}
+
+static void ich9_set_sci(void *opaque, int irq_num, int level)
+{
+    ICH9LPCState *lpc = opaque;
+    int irq;
+
+    assert(irq_num == 0);
+    level = !!level;
+    if (level == lpc->sci_level) {
+        return;
+    }
+    lpc->sci_level = level;
+
+    irq = ich9_lpc_sci_irq(lpc);
+    if (irq < 0) {
+        return;
+    }
+
+    ich9_lpc_update_apic(lpc, irq);
+    if (irq < ICH9_LPC_PIC_NUM_PINS) {
+        ich9_lpc_update_pic(lpc, irq);
+    }
+}
+
+void ich9_lpc_pm_init(PCIDevice *lpc_pci, qemu_irq cmos_s3)
+{
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(lpc_pci);
+    qemu_irq *sci_irq;
+
+    sci_irq = qemu_allocate_irqs(ich9_set_sci, lpc, 1);
+    ich9_pm_init(&lpc->pm, sci_irq[0], cmos_s3);
+
+    ich9_lpc_reset(&lpc->d.qdev);
+}
+
+/* APM */
+
+static void ich9_apm_ctrl_changed(uint32_t val, void *arg)
+{
+    ICH9LPCState *lpc = arg;
+
+    /* ACPI specs 3.0, 4.7.2.5 */
+    acpi_pm1_cnt_update(&lpc->pm.acpi_regs,
+                        val == ICH9_APM_ACPI_ENABLE,
+                        val == ICH9_APM_ACPI_DISABLE);
+
+    /* SMI_EN = PMBASE + 30. SMI control and enable register */
+    if (lpc->pm.smi_en & ICH9_PMIO_SMI_EN_APMC_EN) {
+        cpu_interrupt(first_cpu, CPU_INTERRUPT_SMI);
+    }
+}
+
+/* config:PMBASE */
+static void
+ich9_lpc_pmbase_update(ICH9LPCState *lpc)
+{
+    uint32_t pm_io_base = pci_get_long(lpc->d.config + ICH9_LPC_PMBASE);
+    pm_io_base &= ICH9_LPC_PMBASE_BASE_ADDRESS_MASK;
+
+    ich9_pm_iospace_update(&lpc->pm, pm_io_base);
+}
+
+/* config:RBCA */
+static void ich9_lpc_rcba_update(ICH9LPCState *lpc, uint32_t rbca_old)
+{
+    uint32_t rbca = pci_get_long(lpc->d.config + ICH9_LPC_RCBA);
+
+    if (rbca_old & ICH9_LPC_RCBA_EN) {
+            memory_region_del_subregion(get_system_memory(), &lpc->rbca_mem);
+    }
+    if (rbca & ICH9_LPC_RCBA_EN) {
+            memory_region_add_subregion_overlap(get_system_memory(),
+                                                rbca & ICH9_LPC_RCBA_BA_MASK,
+                                                &lpc->rbca_mem, 1);
+    }
+}
+
+static int ich9_lpc_post_load(void *opaque, int version_id)
+{
+    ICH9LPCState *lpc = opaque;
+
+    ich9_lpc_pmbase_update(lpc);
+    ich9_lpc_rcba_update(lpc, 0 /* disabled ICH9_LPC_RBCA_EN */);
+    return 0;
+}
+
+static void ich9_lpc_config_write(PCIDevice *d,
+                                  uint32_t addr, uint32_t val, int len)
+{
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
+    uint32_t rbca_old = pci_get_long(d->config + ICH9_LPC_RCBA);
+
+    pci_default_write_config(d, addr, val, len);
+    if (ranges_overlap(addr, len, ICH9_LPC_PMBASE, 4)) {
+        ich9_lpc_pmbase_update(lpc);
+    }
+    if (ranges_overlap(addr, len, ICH9_LPC_RCBA, 4)) {
+        ich9_lpc_rcba_update(lpc, rbca_old);
+    }
+}
+
+static void ich9_lpc_reset(DeviceState *qdev)
+{
+    PCIDevice *d = PCI_DEVICE(qdev);
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
+    uint32_t rbca_old = pci_get_long(d->config + ICH9_LPC_RCBA);
+    int i;
+
+    for (i = 0; i < 4; i++) {
+        pci_set_byte(d->config + ICH9_LPC_PIRQA_ROUT + i,
+                     ICH9_LPC_PIRQ_ROUT_DEFAULT);
+    }
+    for (i = 0; i < 4; i++) {
+        pci_set_byte(d->config + ICH9_LPC_PIRQE_ROUT + i,
+                     ICH9_LPC_PIRQ_ROUT_DEFAULT);
+    }
+    pci_set_byte(d->config + ICH9_LPC_ACPI_CTRL, ICH9_LPC_ACPI_CTRL_DEFAULT);
+
+    pci_set_long(d->config + ICH9_LPC_PMBASE, ICH9_LPC_PMBASE_DEFAULT);
+    pci_set_long(d->config + ICH9_LPC_RCBA, ICH9_LPC_RCBA_DEFAULT);
+
+    ich9_cc_reset(lpc);
+
+    ich9_lpc_pmbase_update(lpc);
+    ich9_lpc_rcba_update(lpc, rbca_old);
+
+    lpc->sci_level = 0;
+}
+
+static const MemoryRegionOps rbca_mmio_ops = {
+    .read = ich9_cc_read,
+    .write = ich9_cc_write,
+    .endianness = DEVICE_LITTLE_ENDIAN,
+};
+
+static int ich9_lpc_initfn(PCIDevice *d)
+{
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
+    ISABus *isa_bus;
+
+    isa_bus = isa_bus_new(&d->qdev, get_system_io());
+
+    pci_set_long(d->wmask + ICH9_LPC_PMBASE,
+                 ICH9_LPC_PMBASE_BASE_ADDRESS_MASK);
+
+    memory_region_init_io(&lpc->rbca_mem, &rbca_mmio_ops, lpc,
+                            "lpc-rbca-mmio", ICH9_CC_SIZE);
+
+    lpc->isa_bus = isa_bus;
+
+    ich9_cc_init(lpc);
+    apm_init(&lpc->apm, ich9_apm_ctrl_changed, lpc);
+    return 0;
+}
+
+static const VMStateDescription vmstate_ich9_lpc = {
+    .name = "ICH9LPC",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .post_load = ich9_lpc_post_load,
+    .fields = (VMStateField[]) {
+        VMSTATE_PCI_DEVICE(d, ICH9LPCState),
+        VMSTATE_STRUCT(apm, ICH9LPCState, 0, vmstate_apm, APMState),
+        VMSTATE_STRUCT(pm, ICH9LPCState, 0, vmstate_ich9_pm, ICH9LPCPMRegs),
+        VMSTATE_UINT8_ARRAY(chip_config, ICH9LPCState, ICH9_CC_SIZE),
+        VMSTATE_UINT32(sci_level, ICH9LPCState),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static void ich9_lpc_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+    dc->reset = ich9_lpc_reset;
+    k->init = ich9_lpc_initfn;
+    dc->vmsd = &vmstate_ich9_lpc;
+    dc->no_user = 1;
+    k->config_write = ich9_lpc_config_write;
+    dc->desc = "ICH9 LPC bridge";
+    k->vendor_id = PCI_VENDOR_ID_INTEL;
+    k->device_id = PCI_DEVICE_ID_INTEL_ICH9_8;
+    k->revision = ICH9_A2_LPC_REVISION;
+    k->class_id = PCI_CLASS_BRIDGE_ISA;
+
+}
+
+static const TypeInfo ich9_lpc_info = {
+    .name       = TYPE_ICH9_LPC_DEVICE,
+    .parent     = TYPE_PCI_DEVICE,
+    .instance_size = sizeof(struct ICH9LPCState),
+    .class_init  = ich9_lpc_class_init,
+};
+
+static void ich9_lpc_register(void)
+{
+    type_register_static(&ich9_lpc_info);
+}
+
+type_init(ich9_lpc_register);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:50:58 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:50:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEc-0003E9-5q; Tue, 11 Dec 2012 13:50:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEa-0003Df-Ix
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:56 +0000
Received: from [85.158.139.83:18281] by server-11.bemta-5.messagelabs.com id
	B8/28-31624-F3A37C05; Tue, 11 Dec 2012 13:50:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1355233853!25046140!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17998 invoked from network); 11 Dec 2012 13:50:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:50:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEW-0001PG-Ur
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEW-0005jN-ME
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:50:52 +0000
Date: Tue, 11 Dec 2012 13:50:52 +0000
Message-Id: <E1TiQEW-0005jN-ME@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ich9: Add the lpc chip
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d00636e97b7f55810ff7faccff594159175e24e
Author: Jason Baron <jbaron@redhat.com>
Date:   Wed Nov 14 15:54:05 2012 -0500

    ich9: Add the lpc chip
    
    Add support for the ICH9 LPC chip.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/i386/Makefile.objs |    1 +
 hw/lpc_ich9.c         |  523 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 524 insertions(+), 0 deletions(-)

diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 8c764bb..9543a69 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -6,6 +6,7 @@ obj-y += pci-hotplug.o smbios.o wdt_ib700.o
 obj-y += debugcon.o multiboot.o
 obj-y += pc_piix.o
 obj-y += pc_sysfw.o
+obj-y += lpc_ich9.o
 obj-$(CONFIG_XEN) += xen_platform.o xen_apic.o
 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o
 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_msi.o
diff --git a/hw/lpc_ich9.c b/hw/lpc_ich9.c
new file mode 100644
index 0000000..f8f06b3
--- /dev/null
+++ b/hw/lpc_ich9.c
@@ -0,0 +1,523 @@
+/*
+ * Copyright (c) 2006 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+/*
+ * QEMU ICH9 Emulation
+ *
+ *  Copyright (c) 2009, 2010, 2011
+ *                Isaku Yamahata <yamahata at valinux co jp>
+ *                VA Linux Systems Japan K.K.
+ *  Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ *  This is based on piix_pci.c, but heavily modified.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "qemu-common.h"
+#include "hw.h"
+#include "range.h"
+#include "isa.h"
+#include "sysbus.h"
+#include "pc.h"
+#include "apm.h"
+#include "ioapic.h"
+#include "pci.h"
+#include "pcie_host.h"
+#include "pci_bridge.h"
+#include "ich9.h"
+#include "acpi.h"
+#include "acpi_ich9.h"
+#include "pam.h"
+#include "pci_internals.h"
+#include "exec-memory.h"
+
+static int ich9_lpc_sci_irq(ICH9LPCState *lpc);
+
+/*****************************************************************************/
+/* ICH9 LPC PCI to ISA bridge */
+
+static void ich9_lpc_reset(DeviceState *qdev);
+
+/* chipset configuration register
+ * to access chipset configuration registers, pci_[sg]et_{byte, word, long}
+ * are used.
+ * Although it's not pci configuration space, it's little endian as Intel.
+ */
+
+static void ich9_cc_update_ir(uint8_t irr[PCI_NUM_PINS], uint16_t ir)
+{
+    int intx;
+    for (intx = 0; intx < PCI_NUM_PINS; intx++) {
+        irr[intx] = (ir >> (intx * ICH9_CC_DIR_SHIFT)) & ICH9_CC_DIR_MASK;
+    }
+}
+
+static void ich9_cc_update(ICH9LPCState *lpc)
+{
+    int slot;
+    int pci_intx;
+
+    const int reg_offsets[] = {
+        ICH9_CC_D25IR,
+        ICH9_CC_D26IR,
+        ICH9_CC_D27IR,
+        ICH9_CC_D28IR,
+        ICH9_CC_D29IR,
+        ICH9_CC_D30IR,
+        ICH9_CC_D31IR,
+    };
+    const int *offset;
+
+    /* D{25 - 31}IR, but D30IR is read only to 0. */
+    for (slot = 25, offset = reg_offsets; slot < 32; slot++, offset++) {
+        if (slot == 30) {
+            continue;
+        }
+        ich9_cc_update_ir(lpc->irr[slot],
+                          pci_get_word(lpc->chip_config + *offset));
+    }
+
+    /*
+     * D30: DMI2PCI bridge
+     * It is arbitrarily decided how INTx lines of PCI devicesbehind the bridge
+     * are connected to pirq lines. Our choice is PIRQ[E-H].
+     * INT[A-D] are connected to PIRQ[E-H]
+     */
+    for (pci_intx = 0; pci_intx < PCI_NUM_PINS; pci_intx++) {
+        lpc->irr[30][pci_intx] = pci_intx + 4;
+    }
+}
+
+static void ich9_cc_init(ICH9LPCState *lpc)
+{
+    int slot;
+    int intx;
+
+    /* the default irq routing is arbitrary as long as it matches with
+     * acpi irq routing table.
+     * The one that is incompatible with piix_pci(= bochs) one is
+     * intentionally chosen to let the users know that the different
+     * board is used.
+     *
+     * int[A-D] -> pirq[E-F]
+     * avoid pirq A-D because they are used for pci express port
+     */
+    for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
+        for (intx = 0; intx < PCI_NUM_PINS; intx++) {
+            lpc->irr[slot][intx] = (slot + intx) % 4 + 4;
+        }
+    }
+    ich9_cc_update(lpc);
+}
+
+static void ich9_cc_reset(ICH9LPCState *lpc)
+{
+    uint8_t *c = lpc->chip_config;
+
+    memset(lpc->chip_config, 0, sizeof(lpc->chip_config));
+
+    pci_set_long(c + ICH9_CC_D31IR, ICH9_CC_DIR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D30IR, ICH9_CC_D30IR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D29IR, ICH9_CC_DIR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D28IR, ICH9_CC_DIR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D27IR, ICH9_CC_DIR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D26IR, ICH9_CC_DIR_DEFAULT);
+    pci_set_long(c + ICH9_CC_D25IR, ICH9_CC_DIR_DEFAULT);
+
+    ich9_cc_update(lpc);
+}
+
+static void ich9_cc_addr_len(uint64_t *addr, unsigned *len)
+{
+    *addr &= ICH9_CC_ADDR_MASK;
+    if (*addr + *len >= ICH9_CC_SIZE) {
+        *len = ICH9_CC_SIZE - *addr;
+    }
+}
+
+/* val: little endian */
+static void ich9_cc_write(void *opaque, hwaddr addr,
+                          uint64_t val, unsigned len)
+{
+    ICH9LPCState *lpc = (ICH9LPCState *)opaque;
+
+    ich9_cc_addr_len(&addr, &len);
+    memcpy(lpc->chip_config + addr, &val, len);
+    ich9_cc_update(lpc);
+}
+
+/* return value: little endian */
+static uint64_t ich9_cc_read(void *opaque, hwaddr addr,
+                              unsigned len)
+{
+    ICH9LPCState *lpc = (ICH9LPCState *)opaque;
+
+    uint32_t val = 0;
+    ich9_cc_addr_len(&addr, &len);
+    memcpy(&val, lpc->chip_config + addr, len);
+    return val;
+}
+
+/* IRQ routing */
+/* */
+static void ich9_lpc_rout(uint8_t pirq_rout, int *pic_irq, int *pic_dis)
+{
+    *pic_irq = pirq_rout & ICH9_LPC_PIRQ_ROUT_MASK;
+    *pic_dis = pirq_rout & ICH9_LPC_PIRQ_ROUT_IRQEN;
+}
+
+static void ich9_lpc_pic_irq(ICH9LPCState *lpc, int pirq_num,
+                             int *pic_irq, int *pic_dis)
+{
+    switch (pirq_num) {
+    case 0 ... 3: /* A-D */
+        ich9_lpc_rout(lpc->d.config[ICH9_LPC_PIRQA_ROUT + pirq_num],
+                      pic_irq, pic_dis);
+        return;
+    case 4 ... 7: /* E-H */
+        ich9_lpc_rout(lpc->d.config[ICH9_LPC_PIRQE_ROUT + (pirq_num - 4)],
+                      pic_irq, pic_dis);
+        return;
+    default:
+        break;
+    }
+    abort();
+}
+
+/* pic_irq: i8254 irq 0-15 */
+static void ich9_lpc_update_pic(ICH9LPCState *lpc, int pic_irq)
+{
+    int i, pic_level;
+
+    /* The pic level is the logical OR of all the PCI irqs mapped to it */
+    pic_level = 0;
+    for (i = 0; i < ICH9_LPC_NB_PIRQS; i++) {
+        int tmp_irq;
+        int tmp_dis;
+        ich9_lpc_pic_irq(lpc, i, &tmp_irq, &tmp_dis);
+        if (!tmp_dis && pic_irq == tmp_irq) {
+            pic_level |= pci_bus_get_irq_level(lpc->d.bus, i);
+        }
+    }
+    if (pic_irq == ich9_lpc_sci_irq(lpc)) {
+        pic_level |= lpc->sci_level;
+    }
+
+    qemu_set_irq(lpc->pic[pic_irq], pic_level);
+}
+
+/* pirq: pirq[A-H] 0-7*/
+static void ich9_lpc_update_by_pirq(ICH9LPCState *lpc, int pirq)
+{
+    int pic_irq;
+    int pic_dis;
+
+    ich9_lpc_pic_irq(lpc, pirq, &pic_irq, &pic_dis);
+    assert(pic_irq < ICH9_LPC_PIC_NUM_PINS);
+    if (pic_dis) {
+        return;
+    }
+
+    ich9_lpc_update_pic(lpc, pic_irq);
+}
+
+/* APIC mode: GSIx: PIRQ[A-H] -> GSI 16, ... no pirq shares same APIC pins. */
+static int ich9_pirq_to_gsi(int pirq)
+{
+    return pirq + ICH9_LPC_PIC_NUM_PINS;
+}
+
+static int ich9_gsi_to_pirq(int gsi)
+{
+    return gsi - ICH9_LPC_PIC_NUM_PINS;
+}
+
+static void ich9_lpc_update_apic(ICH9LPCState *lpc, int gsi)
+{
+    int level;
+
+    level = pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));
+    if (gsi == ich9_lpc_sci_irq(lpc)) {
+        level |= lpc->sci_level;
+    }
+
+    qemu_set_irq(lpc->ioapic[gsi], level);
+}
+
+void ich9_lpc_set_irq(void *opaque, int pirq, int level)
+{
+    ICH9LPCState *lpc = opaque;
+
+    assert(0 <= pirq);
+    assert(pirq < ICH9_LPC_NB_PIRQS);
+
+    ich9_lpc_update_apic(lpc, ich9_pirq_to_gsi(pirq));
+    ich9_lpc_update_by_pirq(lpc, pirq);
+}
+
+/* return the pirq number (PIRQ[A-H]:0-7) corresponding to
+ * a given device irq pin.
+ */
+int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx)
+{
+    BusState *bus = qdev_get_parent_bus(&pci_dev->qdev);
+    PCIBus *pci_bus = PCI_BUS(bus);
+    PCIDevice *lpc_pdev =
+            pci_bus->devices[PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC)];
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(lpc_pdev);
+
+    return lpc->irr[PCI_SLOT(pci_dev->devfn)][intx];
+}
+
+static int ich9_lpc_sci_irq(ICH9LPCState *lpc)
+{
+    switch (lpc->d.config[ICH9_LPC_ACPI_CTRL] &
+            ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK) {
+    case ICH9_LPC_ACPI_CTRL_9:
+        return 9;
+    case ICH9_LPC_ACPI_CTRL_10:
+        return 10;
+    case ICH9_LPC_ACPI_CTRL_11:
+        return 11;
+    case ICH9_LPC_ACPI_CTRL_20:
+        return 20;
+    case ICH9_LPC_ACPI_CTRL_21:
+        return 21;
+    default:
+        /* reserved */
+        break;
+    }
+    return -1;
+}
+
+static void ich9_set_sci(void *opaque, int irq_num, int level)
+{
+    ICH9LPCState *lpc = opaque;
+    int irq;
+
+    assert(irq_num == 0);
+    level = !!level;
+    if (level == lpc->sci_level) {
+        return;
+    }
+    lpc->sci_level = level;
+
+    irq = ich9_lpc_sci_irq(lpc);
+    if (irq < 0) {
+        return;
+    }
+
+    ich9_lpc_update_apic(lpc, irq);
+    if (irq < ICH9_LPC_PIC_NUM_PINS) {
+        ich9_lpc_update_pic(lpc, irq);
+    }
+}
+
+void ich9_lpc_pm_init(PCIDevice *lpc_pci, qemu_irq cmos_s3)
+{
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(lpc_pci);
+    qemu_irq *sci_irq;
+
+    sci_irq = qemu_allocate_irqs(ich9_set_sci, lpc, 1);
+    ich9_pm_init(&lpc->pm, sci_irq[0], cmos_s3);
+
+    ich9_lpc_reset(&lpc->d.qdev);
+}
+
+/* APM */
+
+static void ich9_apm_ctrl_changed(uint32_t val, void *arg)
+{
+    ICH9LPCState *lpc = arg;
+
+    /* ACPI specs 3.0, 4.7.2.5 */
+    acpi_pm1_cnt_update(&lpc->pm.acpi_regs,
+                        val == ICH9_APM_ACPI_ENABLE,
+                        val == ICH9_APM_ACPI_DISABLE);
+
+    /* SMI_EN = PMBASE + 30. SMI control and enable register */
+    if (lpc->pm.smi_en & ICH9_PMIO_SMI_EN_APMC_EN) {
+        cpu_interrupt(first_cpu, CPU_INTERRUPT_SMI);
+    }
+}
+
+/* config:PMBASE */
+static void
+ich9_lpc_pmbase_update(ICH9LPCState *lpc)
+{
+    uint32_t pm_io_base = pci_get_long(lpc->d.config + ICH9_LPC_PMBASE);
+    pm_io_base &= ICH9_LPC_PMBASE_BASE_ADDRESS_MASK;
+
+    ich9_pm_iospace_update(&lpc->pm, pm_io_base);
+}
+
+/* config:RBCA */
+static void ich9_lpc_rcba_update(ICH9LPCState *lpc, uint32_t rbca_old)
+{
+    uint32_t rbca = pci_get_long(lpc->d.config + ICH9_LPC_RCBA);
+
+    if (rbca_old & ICH9_LPC_RCBA_EN) {
+            memory_region_del_subregion(get_system_memory(), &lpc->rbca_mem);
+    }
+    if (rbca & ICH9_LPC_RCBA_EN) {
+            memory_region_add_subregion_overlap(get_system_memory(),
+                                                rbca & ICH9_LPC_RCBA_BA_MASK,
+                                                &lpc->rbca_mem, 1);
+    }
+}
+
+static int ich9_lpc_post_load(void *opaque, int version_id)
+{
+    ICH9LPCState *lpc = opaque;
+
+    ich9_lpc_pmbase_update(lpc);
+    ich9_lpc_rcba_update(lpc, 0 /* disabled ICH9_LPC_RBCA_EN */);
+    return 0;
+}
+
+static void ich9_lpc_config_write(PCIDevice *d,
+                                  uint32_t addr, uint32_t val, int len)
+{
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
+    uint32_t rbca_old = pci_get_long(d->config + ICH9_LPC_RCBA);
+
+    pci_default_write_config(d, addr, val, len);
+    if (ranges_overlap(addr, len, ICH9_LPC_PMBASE, 4)) {
+        ich9_lpc_pmbase_update(lpc);
+    }
+    if (ranges_overlap(addr, len, ICH9_LPC_RCBA, 4)) {
+        ich9_lpc_rcba_update(lpc, rbca_old);
+    }
+}
+
+static void ich9_lpc_reset(DeviceState *qdev)
+{
+    PCIDevice *d = PCI_DEVICE(qdev);
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
+    uint32_t rbca_old = pci_get_long(d->config + ICH9_LPC_RCBA);
+    int i;
+
+    for (i = 0; i < 4; i++) {
+        pci_set_byte(d->config + ICH9_LPC_PIRQA_ROUT + i,
+                     ICH9_LPC_PIRQ_ROUT_DEFAULT);
+    }
+    for (i = 0; i < 4; i++) {
+        pci_set_byte(d->config + ICH9_LPC_PIRQE_ROUT + i,
+                     ICH9_LPC_PIRQ_ROUT_DEFAULT);
+    }
+    pci_set_byte(d->config + ICH9_LPC_ACPI_CTRL, ICH9_LPC_ACPI_CTRL_DEFAULT);
+
+    pci_set_long(d->config + ICH9_LPC_PMBASE, ICH9_LPC_PMBASE_DEFAULT);
+    pci_set_long(d->config + ICH9_LPC_RCBA, ICH9_LPC_RCBA_DEFAULT);
+
+    ich9_cc_reset(lpc);
+
+    ich9_lpc_pmbase_update(lpc);
+    ich9_lpc_rcba_update(lpc, rbca_old);
+
+    lpc->sci_level = 0;
+}
+
+static const MemoryRegionOps rbca_mmio_ops = {
+    .read = ich9_cc_read,
+    .write = ich9_cc_write,
+    .endianness = DEVICE_LITTLE_ENDIAN,
+};
+
+static int ich9_lpc_initfn(PCIDevice *d)
+{
+    ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
+    ISABus *isa_bus;
+
+    isa_bus = isa_bus_new(&d->qdev, get_system_io());
+
+    pci_set_long(d->wmask + ICH9_LPC_PMBASE,
+                 ICH9_LPC_PMBASE_BASE_ADDRESS_MASK);
+
+    memory_region_init_io(&lpc->rbca_mem, &rbca_mmio_ops, lpc,
+                            "lpc-rbca-mmio", ICH9_CC_SIZE);
+
+    lpc->isa_bus = isa_bus;
+
+    ich9_cc_init(lpc);
+    apm_init(&lpc->apm, ich9_apm_ctrl_changed, lpc);
+    return 0;
+}
+
+static const VMStateDescription vmstate_ich9_lpc = {
+    .name = "ICH9LPC",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .post_load = ich9_lpc_post_load,
+    .fields = (VMStateField[]) {
+        VMSTATE_PCI_DEVICE(d, ICH9LPCState),
+        VMSTATE_STRUCT(apm, ICH9LPCState, 0, vmstate_apm, APMState),
+        VMSTATE_STRUCT(pm, ICH9LPCState, 0, vmstate_ich9_pm, ICH9LPCPMRegs),
+        VMSTATE_UINT8_ARRAY(chip_config, ICH9LPCState, ICH9_CC_SIZE),
+        VMSTATE_UINT32(sci_level, ICH9LPCState),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static void ich9_lpc_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+    dc->reset = ich9_lpc_reset;
+    k->init = ich9_lpc_initfn;
+    dc->vmsd = &vmstate_ich9_lpc;
+    dc->no_user = 1;
+    k->config_write = ich9_lpc_config_write;
+    dc->desc = "ICH9 LPC bridge";
+    k->vendor_id = PCI_VENDOR_ID_INTEL;
+    k->device_id = PCI_DEVICE_ID_INTEL_ICH9_8;
+    k->revision = ICH9_A2_LPC_REVISION;
+    k->class_id = PCI_CLASS_BRIDGE_ISA;
+
+}
+
+static const TypeInfo ich9_lpc_info = {
+    .name       = TYPE_ICH9_LPC_DEVICE,
+    .parent     = TYPE_PCI_DEVICE,
+    .instance_size = sizeof(struct ICH9LPCState),
+    .class_init  = ich9_lpc_class_init,
+};
+
+static void ich9_lpc_register(void)
+{
+    type_register_static(&ich9_lpc_info);
+}
+
+type_init(ich9_lpc_register);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:51:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:51:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEo-0003Gt-8u; Tue, 11 Dec 2012 13:51:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEm-0003GW-61
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:08 +0000
Received: from [193.109.254.147:11177] by server-11.bemta-14.messagelabs.com
	id 90/1A-29027-B4A37C05; Tue, 11 Dec 2012 13:51:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1355233863!1791935!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25929 invoked from network); 11 Dec 2012 13:51:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEh-0001Pv-CL
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEh-0005jk-43
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:03 +0000
Date: Tue, 11 Dec 2012 13:51:03 +0000
Message-Id: <E1TiQEh-0005jk-43@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ich9: Add smbus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 678e7b94b182f846de61e38e8a6499f9c55dbcf0
Author: Jason Baron <jbaron@redhat.com>
Date:   Thu Nov 22 22:06:42 2012 -0500

    ich9: Add smbus
    
    Add support for the ich9 smbus chip.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/Makefile.objs |    2 +-
 hw/smbus_ich9.c  |  159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 160 insertions(+), 1 deletions(-)

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index b863b31..35773de 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -28,7 +28,7 @@ common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
 common-obj-$(CONFIG_PCSPK) += pcspk.o
 common-obj-$(CONFIG_PCKBD) += pckbd.o
 common-obj-$(CONFIG_FDC) += fdc.o
-common-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o acpi_ich9.o
+common-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o acpi_ich9.o smbus_ich9.o
 common-obj-$(CONFIG_APM) += pm_smbus.o apm.o
 common-obj-$(CONFIG_DMA) += dma.o
 common-obj-$(CONFIG_I82374) += i82374.o
diff --git a/hw/smbus_ich9.c b/hw/smbus_ich9.c
new file mode 100644
index 0000000..6940583
--- /dev/null
+++ b/hw/smbus_ich9.c
@@ -0,0 +1,159 @@
+/*
+ * ACPI implementation
+ *
+ * Copyright (c) 2006 Fabrice Bellard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+/*
+ *  Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
+ *                     VA Linux Systems Japan K.K.
+ *  Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ *  This is based on acpi.c, but heavily rewritten.
+ */
+#include "hw.h"
+#include "pc.h"
+#include "pm_smbus.h"
+#include "pci.h"
+#include "sysemu.h"
+#include "i2c.h"
+#include "smbus.h"
+
+#include "ich9.h"
+
+#define TYPE_ICH9_SMB_DEVICE "ICH9 SMB"
+#define ICH9_SMB_DEVICE(obj) \
+     OBJECT_CHECK(ICH9SMBState, (obj), TYPE_ICH9_SMB_DEVICE)
+
+typedef struct ICH9SMBState {
+    PCIDevice dev;
+
+    PMSMBus smb;
+    MemoryRegion mem_bar;
+} ICH9SMBState;
+
+static const VMStateDescription vmstate_ich9_smbus = {
+    .name = "ich9_smb",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .fields = (VMStateField[]) {
+        VMSTATE_PCI_DEVICE(dev, struct ICH9SMBState),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static void ich9_smb_ioport_writeb(void *opaque, hwaddr addr,
+                                   uint64_t val, unsigned size)
+{
+    ICH9SMBState *s = opaque;
+    uint8_t hostc = s->dev.config[ICH9_SMB_HOSTC];
+
+    if ((hostc & ICH9_SMB_HOSTC_HST_EN) && !(hostc & ICH9_SMB_HOSTC_I2C_EN)) {
+        uint64_t offset = addr - s->dev.io_regions[ICH9_SMB_SMB_BASE_BAR].addr;
+        smb_ioport_writeb(&s->smb, offset, val);
+    }
+}
+
+static uint64_t ich9_smb_ioport_readb(void *opaque, hwaddr addr,
+                                      unsigned size)
+{
+    ICH9SMBState *s = opaque;
+    uint8_t hostc = s->dev.config[ICH9_SMB_HOSTC];
+
+    if ((hostc & ICH9_SMB_HOSTC_HST_EN) && !(hostc & ICH9_SMB_HOSTC_I2C_EN)) {
+        uint64_t offset = addr - s->dev.io_regions[ICH9_SMB_SMB_BASE_BAR].addr;
+        return smb_ioport_readb(&s->smb, offset);
+    }
+
+    return 0xff;
+}
+
+static const MemoryRegionOps lpc_smb_mmio_ops = {
+    .read = ich9_smb_ioport_readb,
+    .write = ich9_smb_ioport_writeb,
+    .endianness = DEVICE_LITTLE_ENDIAN,
+    .impl = {
+        .min_access_size = 1,
+        .max_access_size = 1,
+    },
+};
+
+static int ich9_smbus_initfn(PCIDevice *d)
+{
+    ICH9SMBState *s = ICH9_SMB_DEVICE(d);
+
+    /* TODO? D31IP.SMIP in chipset configuration space */
+    pci_config_set_interrupt_pin(d->config, 0x01); /* interrupt pin 1 */
+
+    pci_set_byte(d->config + ICH9_SMB_HOSTC, 0);
+
+    /*
+     * update parameters based on
+     * paralell_hds[0]
+     * serial_hds[0]
+     * serial_hds[0]
+     * fdc
+     *
+     * Is there any OS that depends on them?
+     */
+
+    /* TODO smb_io_base */
+    pci_set_byte(d->config + ICH9_SMB_HOSTC, 0);
+    /* TODO bar0, bar1: 64bit BAR support*/
+
+    memory_region_init_io(&s->mem_bar, &lpc_smb_mmio_ops, s, "ich9-smbus-bar",
+                            ICH9_SMB_SMB_BASE_SIZE);
+    pci_register_bar(d, ICH9_SMB_SMB_BASE_BAR, PCI_BASE_ADDRESS_SPACE_IO,
+                        &s->mem_bar);
+    pm_smbus_init(&d->qdev, &s->smb);
+    return 0;
+}
+
+static void ich9_smb_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+    k->vendor_id = PCI_VENDOR_ID_INTEL;
+    k->device_id = PCI_DEVICE_ID_INTEL_ICH9_6;
+    k->revision = ICH9_A2_SMB_REVISION;
+    k->class_id = PCI_CLASS_SERIAL_SMBUS;
+    dc->no_user = 1;
+    dc->vmsd = &vmstate_ich9_smbus;
+    dc->desc = "ICH9 SMBUS Bridge";
+    k->init = ich9_smbus_initfn;
+}
+
+i2c_bus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base)
+{
+    PCIDevice *d =
+        pci_create_simple_multifunction(bus, devfn, true, TYPE_ICH9_SMB_DEVICE);
+    ICH9SMBState *s = ICH9_SMB_DEVICE(d);
+    return s->smb.smbus;
+}
+
+static const TypeInfo ich9_smb_info = {
+    .name   = TYPE_ICH9_SMB_DEVICE,
+    .parent = TYPE_PCI_DEVICE,
+    .instance_size = sizeof(ICH9SMBState),
+    .class_init = ich9_smb_class_init,
+};
+
+static void ich9_smb_register(void)
+{
+    type_register_static(&ich9_smb_info);
+}
+
+type_init(ich9_smb_register);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:51:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:51:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQEo-0003Gt-8u; Tue, 11 Dec 2012 13:51:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEm-0003GW-61
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:08 +0000
Received: from [193.109.254.147:11177] by server-11.bemta-14.messagelabs.com
	id 90/1A-29027-B4A37C05; Tue, 11 Dec 2012 13:51:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1355233863!1791935!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25929 invoked from network); 11 Dec 2012 13:51:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEh-0001Pv-CL
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEh-0005jk-43
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:03 +0000
Date: Tue, 11 Dec 2012 13:51:03 +0000
Message-Id: <E1TiQEh-0005jk-43@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ich9: Add smbus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 678e7b94b182f846de61e38e8a6499f9c55dbcf0
Author: Jason Baron <jbaron@redhat.com>
Date:   Thu Nov 22 22:06:42 2012 -0500

    ich9: Add smbus
    
    Add support for the ich9 smbus chip.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/Makefile.objs |    2 +-
 hw/smbus_ich9.c  |  159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 160 insertions(+), 1 deletions(-)

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index b863b31..35773de 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -28,7 +28,7 @@ common-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
 common-obj-$(CONFIG_PCSPK) += pcspk.o
 common-obj-$(CONFIG_PCKBD) += pckbd.o
 common-obj-$(CONFIG_FDC) += fdc.o
-common-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o acpi_ich9.o
+common-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o acpi_ich9.o smbus_ich9.o
 common-obj-$(CONFIG_APM) += pm_smbus.o apm.o
 common-obj-$(CONFIG_DMA) += dma.o
 common-obj-$(CONFIG_I82374) += i82374.o
diff --git a/hw/smbus_ich9.c b/hw/smbus_ich9.c
new file mode 100644
index 0000000..6940583
--- /dev/null
+++ b/hw/smbus_ich9.c
@@ -0,0 +1,159 @@
+/*
+ * ACPI implementation
+ *
+ * Copyright (c) 2006 Fabrice Bellard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+/*
+ *  Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
+ *                     VA Linux Systems Japan K.K.
+ *  Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ *  This is based on acpi.c, but heavily rewritten.
+ */
+#include "hw.h"
+#include "pc.h"
+#include "pm_smbus.h"
+#include "pci.h"
+#include "sysemu.h"
+#include "i2c.h"
+#include "smbus.h"
+
+#include "ich9.h"
+
+#define TYPE_ICH9_SMB_DEVICE "ICH9 SMB"
+#define ICH9_SMB_DEVICE(obj) \
+     OBJECT_CHECK(ICH9SMBState, (obj), TYPE_ICH9_SMB_DEVICE)
+
+typedef struct ICH9SMBState {
+    PCIDevice dev;
+
+    PMSMBus smb;
+    MemoryRegion mem_bar;
+} ICH9SMBState;
+
+static const VMStateDescription vmstate_ich9_smbus = {
+    .name = "ich9_smb",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .fields = (VMStateField[]) {
+        VMSTATE_PCI_DEVICE(dev, struct ICH9SMBState),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static void ich9_smb_ioport_writeb(void *opaque, hwaddr addr,
+                                   uint64_t val, unsigned size)
+{
+    ICH9SMBState *s = opaque;
+    uint8_t hostc = s->dev.config[ICH9_SMB_HOSTC];
+
+    if ((hostc & ICH9_SMB_HOSTC_HST_EN) && !(hostc & ICH9_SMB_HOSTC_I2C_EN)) {
+        uint64_t offset = addr - s->dev.io_regions[ICH9_SMB_SMB_BASE_BAR].addr;
+        smb_ioport_writeb(&s->smb, offset, val);
+    }
+}
+
+static uint64_t ich9_smb_ioport_readb(void *opaque, hwaddr addr,
+                                      unsigned size)
+{
+    ICH9SMBState *s = opaque;
+    uint8_t hostc = s->dev.config[ICH9_SMB_HOSTC];
+
+    if ((hostc & ICH9_SMB_HOSTC_HST_EN) && !(hostc & ICH9_SMB_HOSTC_I2C_EN)) {
+        uint64_t offset = addr - s->dev.io_regions[ICH9_SMB_SMB_BASE_BAR].addr;
+        return smb_ioport_readb(&s->smb, offset);
+    }
+
+    return 0xff;
+}
+
+static const MemoryRegionOps lpc_smb_mmio_ops = {
+    .read = ich9_smb_ioport_readb,
+    .write = ich9_smb_ioport_writeb,
+    .endianness = DEVICE_LITTLE_ENDIAN,
+    .impl = {
+        .min_access_size = 1,
+        .max_access_size = 1,
+    },
+};
+
+static int ich9_smbus_initfn(PCIDevice *d)
+{
+    ICH9SMBState *s = ICH9_SMB_DEVICE(d);
+
+    /* TODO? D31IP.SMIP in chipset configuration space */
+    pci_config_set_interrupt_pin(d->config, 0x01); /* interrupt pin 1 */
+
+    pci_set_byte(d->config + ICH9_SMB_HOSTC, 0);
+
+    /*
+     * update parameters based on
+     * paralell_hds[0]
+     * serial_hds[0]
+     * serial_hds[0]
+     * fdc
+     *
+     * Is there any OS that depends on them?
+     */
+
+    /* TODO smb_io_base */
+    pci_set_byte(d->config + ICH9_SMB_HOSTC, 0);
+    /* TODO bar0, bar1: 64bit BAR support*/
+
+    memory_region_init_io(&s->mem_bar, &lpc_smb_mmio_ops, s, "ich9-smbus-bar",
+                            ICH9_SMB_SMB_BASE_SIZE);
+    pci_register_bar(d, ICH9_SMB_SMB_BASE_BAR, PCI_BASE_ADDRESS_SPACE_IO,
+                        &s->mem_bar);
+    pm_smbus_init(&d->qdev, &s->smb);
+    return 0;
+}
+
+static void ich9_smb_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+    k->vendor_id = PCI_VENDOR_ID_INTEL;
+    k->device_id = PCI_DEVICE_ID_INTEL_ICH9_6;
+    k->revision = ICH9_A2_SMB_REVISION;
+    k->class_id = PCI_CLASS_SERIAL_SMBUS;
+    dc->no_user = 1;
+    dc->vmsd = &vmstate_ich9_smbus;
+    dc->desc = "ICH9 SMBUS Bridge";
+    k->init = ich9_smbus_initfn;
+}
+
+i2c_bus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base)
+{
+    PCIDevice *d =
+        pci_create_simple_multifunction(bus, devfn, true, TYPE_ICH9_SMB_DEVICE);
+    ICH9SMBState *s = ICH9_SMB_DEVICE(d);
+    return s->smb.smbus;
+}
+
+static const TypeInfo ich9_smb_info = {
+    .name   = TYPE_ICH9_SMB_DEVICE,
+    .parent = TYPE_PCI_DEVICE,
+    .instance_size = sizeof(ICH9SMBState),
+    .class_init = ich9_smb_class_init,
+};
+
+static void ich9_smb_register(void)
+{
+    type_register_static(&ich9_smb_info);
+}
+
+type_init(ich9_smb_register);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:51:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:51:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQF0-0003JI-CA; Tue, 11 Dec 2012 13:51:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEy-0003J4-QS
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:21 +0000
Received: from [85.158.138.51:21722] by server-15.bemta-3.messagelabs.com id
	70/14-07921-85A37C05; Tue, 11 Dec 2012 13:51:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1355233873!9741523!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27631 invoked from network); 11 Dec 2012 13:51:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEr-0001Q0-Ol
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEr-0005kA-II
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:13 +0000
Date: Tue, 11 Dec 2012 13:51:13 +0000
Message-Id: <E1TiQEr-0005kA-II@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] q35: Introduce q35 pc
	based chipset emulator
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit df2d8b3ed4d2b6406335d274f9537d78ac4e3c0c
Author: Isaku Yamahata <yamahata@valinux.co.jp>
Date:   Wed Nov 14 15:54:06 2012 -0500

    q35: Introduce q35 pc based chipset emulator
    
    pc q35 based chipset emulator to support pci express natively. Based on
    Anthony Liguori's suggestion, the machine name is 'q35-next', with an alias
    of 'q35'. At this point, there are no compatibility guarantees. When the
    chipset stabilizes more, we will begin to version the machine names.
    
    Major features which still need to be added:
    
    -Migration support (mostly around ahci)
    -ACPI hotplug support (pcie hotplug support is working)
    -Passthrough support
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/i386/Makefile.objs |    2 +-
 hw/pc_q35.c           |  220 +++++++++++++++++++++++++++++++++++
 hw/pci_ids.h          |    2 +
 hw/q35.c              |  309 +++++++++++++++++++++++++++++++++++++++++++++++++
 hw/q35.h              |  150 ++++++++++++++++++++++++
 5 files changed, 682 insertions(+), 1 deletions(-)

diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 9543a69..0d3f6a8 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -6,7 +6,7 @@ obj-y += pci-hotplug.o smbios.o wdt_ib700.o
 obj-y += debugcon.o multiboot.o
 obj-y += pc_piix.o
 obj-y += pc_sysfw.o
-obj-y += lpc_ich9.o
+obj-y += lpc_ich9.o q35.o pc_q35.o
 obj-$(CONFIG_XEN) += xen_platform.o xen_apic.o
 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o
 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_msi.o
diff --git a/hw/pc_q35.c b/hw/pc_q35.c
new file mode 100644
index 0000000..142bf8a
--- /dev/null
+++ b/hw/pc_q35.c
@@ -0,0 +1,220 @@
+/*
+ * Q35 chipset based pc system emulator
+ *
+ * Copyright (c) 2003-2004 Fabrice Bellard
+ * Copyright (c) 2009, 2010
+ *               Isaku Yamahata <yamahata at valinux co jp>
+ *               VA Linux Systems Japan K.K.
+ * Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * This is based on pc.c, but heavily modified.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#include "hw.h"
+#include "arch_init.h"
+#include "smbus.h"
+#include "boards.h"
+#include "mc146818rtc.h"
+#include "xen.h"
+#include "kvm.h"
+#include "q35.h"
+#include "exec-memory.h"
+#include "ich9.h"
+#include "hw/ide/pci.h"
+#include "hw/ide/ahci.h"
+#include "hw/usb.h"
+
+/* ICH9 AHCI has 6 ports */
+#define MAX_SATA_PORTS     6
+
+/* set CMOS shutdown status register (index 0xF) as S3_resume(0xFE)
+ *    BIOS will read it and start S3 resume at POST Entry */
+static void pc_cmos_set_s3_resume(void *opaque, int irq, int level)
+{
+    ISADevice *s = opaque;
+
+    if (level) {
+        rtc_set_memory(s, 0xF, 0xFE);
+    }
+}
+
+/* PC hardware initialisation */
+static void pc_q35_init(QEMUMachineInitArgs *args)
+{
+    ram_addr_t ram_size = args->ram_size;
+    const char *cpu_model = args->cpu_model;
+    const char *kernel_filename = args->kernel_filename;
+    const char *kernel_cmdline = args->kernel_cmdline;
+    const char *initrd_filename = args->initrd_filename;
+    const char *boot_device = args->boot_device;
+    ram_addr_t below_4g_mem_size, above_4g_mem_size;
+    Q35PCIHost *q35_host;
+    PCIBus *host_bus;
+    PCIDevice *lpc;
+    BusState *idebus[MAX_SATA_PORTS];
+    ISADevice *rtc_state;
+    ISADevice *floppy;
+    MemoryRegion *pci_memory;
+    MemoryRegion *rom_memory;
+    MemoryRegion *ram_memory;
+    GSIState *gsi_state;
+    ISABus *isa_bus;
+    int pci_enabled = 1;
+    qemu_irq *cpu_irq;
+    qemu_irq *gsi;
+    qemu_irq *i8259;
+    int i;
+    ICH9LPCState *ich9_lpc;
+    PCIDevice *ahci;
+    qemu_irq *cmos_s3;
+
+    pc_cpus_init(cpu_model);
+
+    if (ram_size >= 0xb0000000) {
+        above_4g_mem_size = ram_size - 0xb0000000;
+        below_4g_mem_size = 0xb0000000;
+    } else {
+        above_4g_mem_size = 0;
+        below_4g_mem_size = ram_size;
+    }
+
+    /* pci enabled */
+    if (pci_enabled) {
+        pci_memory = g_new(MemoryRegion, 1);
+        memory_region_init(pci_memory, "pci", INT64_MAX);
+        rom_memory = pci_memory;
+    } else {
+        pci_memory = NULL;
+        rom_memory = get_system_memory();
+    }
+
+    /* allocate ram and load rom/bios */
+    if (!xen_enabled()) {
+        pc_memory_init(get_system_memory(), kernel_filename, kernel_cmdline,
+                       initrd_filename, below_4g_mem_size, above_4g_mem_size,
+                       rom_memory, &ram_memory);
+    }
+
+    /* irq lines */
+    gsi_state = g_malloc0(sizeof(*gsi_state));
+    if (kvm_irqchip_in_kernel()) {
+        kvm_pc_setup_irq_routing(pci_enabled);
+        gsi = qemu_allocate_irqs(kvm_pc_gsi_handler, gsi_state,
+                                 GSI_NUM_PINS);
+    } else {
+        gsi = qemu_allocate_irqs(gsi_handler, gsi_state, GSI_NUM_PINS);
+    }
+
+    /* create pci host bus */
+    q35_host = Q35_HOST_DEVICE(qdev_create(NULL, TYPE_Q35_HOST_DEVICE));
+
+    q35_host->mch.ram_memory = ram_memory;
+    q35_host->mch.pci_address_space = pci_memory;
+    q35_host->mch.system_memory = get_system_memory();
+    q35_host->mch.address_space_io = get_system_io();;
+    q35_host->mch.below_4g_mem_size = below_4g_mem_size;
+    q35_host->mch.above_4g_mem_size = above_4g_mem_size;
+    /* pci */
+    qdev_init_nofail(DEVICE(q35_host));
+    host_bus = q35_host->host.pci.bus;
+    /* create ISA bus */
+    lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV,
+                                          ICH9_LPC_FUNC), true,
+                                          TYPE_ICH9_LPC_DEVICE);
+    ich9_lpc = ICH9_LPC_DEVICE(lpc);
+    ich9_lpc->pic = gsi;
+    ich9_lpc->ioapic = gsi_state->ioapic_irq;
+    pci_bus_irqs(host_bus, ich9_lpc_set_irq, ich9_lpc_map_irq, ich9_lpc,
+                 ICH9_LPC_NB_PIRQS);
+    isa_bus = ich9_lpc->isa_bus;
+
+    /*end early*/
+    isa_bus_irqs(isa_bus, gsi);
+
+    if (kvm_irqchip_in_kernel()) {
+        i8259 = kvm_i8259_init(isa_bus);
+    } else if (xen_enabled()) {
+        i8259 = xen_interrupt_controller_init();
+    } else {
+        cpu_irq = pc_allocate_cpu_irq();
+        i8259 = i8259_init(isa_bus, cpu_irq[0]);
+    }
+
+    for (i = 0; i < ISA_NUM_IRQS; i++) {
+        gsi_state->i8259_irq[i] = i8259[i];
+    }
+    if (pci_enabled) {
+        ioapic_init_gsi(gsi_state, NULL);
+    }
+
+    pc_register_ferr_irq(gsi[13]);
+
+    /* init basic PC hardware */
+    pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, false);
+
+    /* connect pm stuff to lpc */
+    cmos_s3 = qemu_allocate_irqs(pc_cmos_set_s3_resume, rtc_state, 1);
+    ich9_lpc_pm_init(lpc, *cmos_s3);
+
+    /* ahci and SATA device, for q35 1 ahci controller is built-in */
+    ahci = pci_create_simple_multifunction(host_bus,
+                                           PCI_DEVFN(ICH9_SATA1_DEV,
+                                                     ICH9_SATA1_FUNC),
+                                           true, "ich9-ahci");
+    idebus[0] = qdev_get_child_bus(&ahci->qdev, "ide.0");
+    idebus[1] = qdev_get_child_bus(&ahci->qdev, "ide.1");
+
+    if (usb_enabled(false)) {
+        /* Should we create 6 UHCI according to ich9 spec? */
+        ehci_create_ich9_with_companions(host_bus, 0x1d);
+    }
+
+    /* TODO: Populate SPD eeprom data.  */
+    smbus_eeprom_init(ich9_smb_init(host_bus,
+                                    PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC),
+                                    0xb100),
+                      8, NULL, 0);
+
+    pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device,
+                 floppy, idebus[0], idebus[1], rtc_state);
+
+    /* the rest devices to which pci devfn is automatically assigned */
+    pc_vga_init(isa_bus, host_bus);
+    audio_init(isa_bus, host_bus);
+    pc_nic_init(isa_bus, host_bus);
+    if (pci_enabled) {
+        pc_pci_device_init(host_bus);
+    }
+}
+
+static QEMUMachine pc_q35_machine = {
+    .name = "q35-next",
+    .alias = "q35",
+    .desc = "Q35 chipset PC",
+    .init = pc_q35_init,
+    .max_cpus = 255,
+};
+
+static void pc_q35_machine_init(void)
+{
+    qemu_register_machine(&pc_q35_machine);
+}
+
+machine_init(pc_q35_machine_init);
diff --git a/hw/pci_ids.h b/hw/pci_ids.h
index d1e83dd..5df7245 100644
--- a/hw/pci_ids.h
+++ b/hw/pci_ids.h
@@ -138,6 +138,8 @@
 #define PCI_DEVICE_ID_INTEL_82801I_EHCI2 0x293c
 #define PCI_DEVICE_ID_INTEL_82599_SFP_VF 0x10ed
 
+#define PCI_DEVICE_ID_INTEL_Q35_MCH      0x29c0
+
 #define PCI_VENDOR_ID_XEN               0x5853
 #define PCI_DEVICE_ID_XEN_PLATFORM      0x0001
 
diff --git a/hw/q35.c b/hw/q35.c
new file mode 100644
index 0000000..efebc27
--- /dev/null
+++ b/hw/q35.c
@@ -0,0 +1,309 @@
+/*
+ * QEMU MCH/ICH9 PCI Bridge Emulation
+ *
+ * Copyright (c) 2006 Fabrice Bellard
+ * Copyright (c) 2009, 2010, 2011
+ *               Isaku Yamahata <yamahata at valinux co jp>
+ *               VA Linux Systems Japan K.K.
+ * Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * This is based on piix_pci.c, but heavily modified.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#include "hw.h"
+#include "q35.h"
+
+/****************************************************************************
+ * Q35 host
+ */
+
+static int q35_host_init(SysBusDevice *dev)
+{
+    PCIBus *b;
+    PCIHostState *pci = FROM_SYSBUS(PCIHostState, dev);
+    Q35PCIHost *s = Q35_HOST_DEVICE(&dev->qdev);
+
+    memory_region_init_io(&pci->conf_mem, &pci_host_conf_le_ops, pci,
+                          "pci-conf-idx", 4);
+    sysbus_add_io(dev, MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_mem);
+    sysbus_init_ioports(&pci->busdev, MCH_HOST_BRIDGE_CONFIG_ADDR, 4);
+
+    memory_region_init_io(&pci->data_mem, &pci_host_data_le_ops, pci,
+                          "pci-conf-data", 4);
+    sysbus_add_io(dev, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem);
+    sysbus_init_ioports(&pci->busdev, MCH_HOST_BRIDGE_CONFIG_DATA, 4);
+
+    if (pcie_host_init(&s->host) < 0) {
+        return -1;
+    }
+    b = pci_bus_new(&s->host.pci.busdev.qdev, "pcie.0",
+                    s->mch.pci_address_space, s->mch.address_space_io, 0);
+    s->host.pci.bus = b;
+    qdev_set_parent_bus(DEVICE(&s->mch), BUS(b));
+    qdev_init_nofail(DEVICE(&s->mch));
+
+    return 0;
+}
+
+static Property mch_props[] = {
+    DEFINE_PROP_UINT64("MCFG", Q35PCIHost, host.base_addr,
+                        MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void q35_host_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
+
+    k->init = q35_host_init;
+    dc->props = mch_props;
+}
+
+static void q35_host_initfn(Object *obj)
+{
+    Q35PCIHost *s = Q35_HOST_DEVICE(obj);
+
+    object_initialize(&s->mch, TYPE_MCH_PCI_DEVICE);
+    object_property_add_child(OBJECT(s), "mch", OBJECT(&s->mch), NULL);
+    qdev_prop_set_uint32(DEVICE(&s->mch), "addr", PCI_DEVFN(0, 0));
+    qdev_prop_set_bit(DEVICE(&s->mch), "multifunction", false);
+}
+
+static const TypeInfo q35_host_info = {
+    .name       = TYPE_Q35_HOST_DEVICE,
+    .parent     = TYPE_PCIE_HOST_BRIDGE,
+    .instance_size = sizeof(Q35PCIHost),
+    .instance_init = q35_host_initfn,
+    .class_init = q35_host_class_init,
+};
+
+/****************************************************************************
+ * MCH D0:F0
+ */
+
+/* PCIe MMCFG */
+static void mch_update_pciexbar(MCHPCIState *mch)
+{
+    PCIDevice *pci_dev = &mch->d;
+    BusState *bus = qdev_get_parent_bus(&pci_dev->qdev);
+    DeviceState *qdev = bus->parent;
+    Q35PCIHost *s = Q35_HOST_DEVICE(qdev);
+
+    uint64_t pciexbar;
+    int enable;
+    uint64_t addr;
+    uint64_t addr_mask;
+    uint32_t length;
+
+    pciexbar = pci_get_quad(pci_dev->config + MCH_HOST_BRIDGE_PCIEXBAR);
+    enable = pciexbar & MCH_HOST_BRIDGE_PCIEXBAREN;
+    addr_mask = MCH_HOST_BRIDGE_PCIEXBAR_ADMSK;
+    switch (pciexbar & MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_MASK) {
+    case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_256M:
+        length = 256 * 1024 * 1024;
+        break;
+    case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_128M:
+        length = 128 * 1024 * 1024;
+        addr_mask |= MCH_HOST_BRIDGE_PCIEXBAR_128ADMSK |
+            MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK;
+        break;
+    case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_64M:
+        length = 64 * 1024 * 1024;
+        addr_mask |= MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK;
+        break;
+    case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD:
+    default:
+        enable = 0;
+        length = 0;
+        abort();
+        break;
+    }
+    addr = pciexbar & addr_mask;
+    pcie_host_mmcfg_update(&s->host, enable, addr, length);
+}
+
+/* PAM */
+static void mch_update_pam(MCHPCIState *mch)
+{
+    int i;
+
+    memory_region_transaction_begin();
+    for (i = 0; i < 13; i++) {
+        pam_update(&mch->pam_regions[i], i,
+                   mch->d.config[MCH_HOST_BRIDGE_PAM0 + ((i + 1) / 2)]);
+    }
+    memory_region_transaction_commit();
+}
+
+/* SMRAM */
+static void mch_update_smram(MCHPCIState *mch)
+{
+    memory_region_transaction_begin();
+    smram_update(&mch->smram_region, mch->d.config[MCH_HOST_BRDIGE_SMRAM],
+                    mch->smm_enabled);
+    memory_region_transaction_commit();
+}
+
+static void mch_set_smm(int smm, void *arg)
+{
+    MCHPCIState *mch = arg;
+
+    memory_region_transaction_begin();
+    smram_set_smm(&mch->smm_enabled, smm, mch->d.config[MCH_HOST_BRDIGE_SMRAM],
+                    &mch->smram_region);
+    memory_region_transaction_commit();
+}
+
+static void mch_write_config(PCIDevice *d,
+                              uint32_t address, uint32_t val, int len)
+{
+    MCHPCIState *mch = MCH_PCI_DEVICE(d);
+
+    /* XXX: implement SMRAM.D_LOCK */
+    pci_default_write_config(d, address, val, len);
+
+    if (ranges_overlap(address, len, MCH_HOST_BRIDGE_PAM0,
+                       MCH_HOST_BRIDGE_PAM_SIZE)) {
+        mch_update_pam(mch);
+    }
+
+    if (ranges_overlap(address, len, MCH_HOST_BRIDGE_PCIEXBAR,
+                       MCH_HOST_BRIDGE_PCIEXBAR_SIZE)) {
+        mch_update_pciexbar(mch);
+    }
+
+    if (ranges_overlap(address, len, MCH_HOST_BRDIGE_SMRAM,
+                       MCH_HOST_BRDIGE_SMRAM_SIZE)) {
+        mch_update_smram(mch);
+    }
+}
+
+static void mch_update(MCHPCIState *mch)
+{
+    mch_update_pciexbar(mch);
+    mch_update_pam(mch);
+    mch_update_smram(mch);
+}
+
+static int mch_post_load(void *opaque, int version_id)
+{
+    MCHPCIState *mch = opaque;
+    mch_update(mch);
+    return 0;
+}
+
+static const VMStateDescription vmstate_mch = {
+    .name = "mch",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .post_load = mch_post_load,
+    .fields = (VMStateField []) {
+        VMSTATE_PCI_DEVICE(d, MCHPCIState),
+        VMSTATE_UINT8(smm_enabled, MCHPCIState),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static void mch_reset(DeviceState *qdev)
+{
+    PCIDevice *d = PCI_DEVICE(qdev);
+    MCHPCIState *mch = MCH_PCI_DEVICE(d);
+
+    pci_set_quad(d->config + MCH_HOST_BRIDGE_PCIEXBAR,
+                 MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT);
+
+    d->config[MCH_HOST_BRDIGE_SMRAM] = MCH_HOST_BRIDGE_SMRAM_DEFAULT;
+
+    mch_update(mch);
+}
+
+static int mch_init(PCIDevice *d)
+{
+    int i;
+    hwaddr pci_hole64_size;
+    MCHPCIState *mch = MCH_PCI_DEVICE(d);
+
+    /* setup pci memory regions */
+    memory_region_init_alias(&mch->pci_hole, "pci-hole",
+                             mch->pci_address_space,
+                             mch->below_4g_mem_size,
+                             0x100000000ULL - mch->below_4g_mem_size);
+    memory_region_add_subregion(mch->system_memory, mch->below_4g_mem_size,
+                                &mch->pci_hole);
+    pci_hole64_size = (sizeof(hwaddr) == 4 ? 0 :
+                       ((uint64_t)1 << 62));
+    memory_region_init_alias(&mch->pci_hole_64bit, "pci-hole64",
+                             mch->pci_address_space,
+                             0x100000000ULL + mch->above_4g_mem_size,
+                             pci_hole64_size);
+    if (pci_hole64_size) {
+        memory_region_add_subregion(mch->system_memory,
+                                    0x100000000ULL + mch->above_4g_mem_size,
+                                    &mch->pci_hole_64bit);
+    }
+    /* smram */
+    cpu_smm_register(&mch_set_smm, mch);
+    memory_region_init_alias(&mch->smram_region, "smram-region",
+                             mch->pci_address_space, 0xa0000, 0x20000);
+    memory_region_add_subregion_overlap(mch->system_memory, 0xa0000,
+                                        &mch->smram_region, 1);
+    memory_region_set_enabled(&mch->smram_region, false);
+    init_pam(mch->ram_memory, mch->system_memory, mch->pci_address_space,
+             &mch->pam_regions[0], PAM_BIOS_BASE, PAM_BIOS_SIZE);
+    for (i = 0; i < 12; ++i) {
+        init_pam(mch->ram_memory, mch->system_memory, mch->pci_address_space,
+                 &mch->pam_regions[i+1], PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE,
+                 PAM_EXPAN_SIZE);
+    }
+    return 0;
+}
+
+static void mch_class_init(ObjectClass *klass, void *data)
+{
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    k->init = mch_init;
+    k->config_write = mch_write_config;
+    dc->reset = mch_reset;
+    dc->desc = "Host bridge";
+    dc->vmsd = &vmstate_mch;
+    k->vendor_id = PCI_VENDOR_ID_INTEL;
+    k->device_id = PCI_DEVICE_ID_INTEL_Q35_MCH;
+    k->revision = MCH_HOST_BRIDGE_REVISION_DEFUALT;
+    k->class_id = PCI_CLASS_BRIDGE_HOST;
+}
+
+static const TypeInfo mch_info = {
+    .name = TYPE_MCH_PCI_DEVICE,
+    .parent = TYPE_PCI_DEVICE,
+    .instance_size = sizeof(MCHPCIState),
+    .class_init = mch_class_init,
+};
+
+static void q35_register(void)
+{
+    type_register_static(&mch_info);
+    type_register_static(&q35_host_info);
+}
+
+type_init(q35_register);
diff --git a/hw/q35.h b/hw/q35.h
new file mode 100644
index 0000000..e34f7c1
--- /dev/null
+++ b/hw/q35.h
@@ -0,0 +1,150 @@
+/*
+ * q35.h
+ *
+ * Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
+ *                    VA Linux Systems Japan K.K.
+ * Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#ifndef HW_Q35_H
+#define HW_Q35_H
+
+#include "hw.h"
+#include "range.h"
+#include "isa.h"
+#include "sysbus.h"
+#include "pc.h"
+#include "apm.h"
+#include "apic.h"
+#include "pci.h"
+#include "pcie_host.h"
+#include "acpi.h"
+#include "acpi_ich9.h"
+#include "pam.h"
+
+#define TYPE_Q35_HOST_DEVICE "q35-pcihost"
+#define Q35_HOST_DEVICE(obj) \
+     OBJECT_CHECK(Q35PCIHost, (obj), TYPE_Q35_HOST_DEVICE)
+
+#define TYPE_MCH_PCI_DEVICE "mch"
+#define MCH_PCI_DEVICE(obj) \
+     OBJECT_CHECK(MCHPCIState, (obj), TYPE_MCH_PCI_DEVICE)
+
+typedef struct MCHPCIState {
+    PCIDevice d;
+    MemoryRegion *ram_memory;
+    MemoryRegion *pci_address_space;
+    MemoryRegion *system_memory;
+    MemoryRegion *address_space_io;
+    PAMMemoryRegion pam_regions[13];
+    MemoryRegion smram_region;
+    MemoryRegion pci_hole;
+    MemoryRegion pci_hole_64bit;
+    uint8_t smm_enabled;
+    ram_addr_t below_4g_mem_size;
+    ram_addr_t above_4g_mem_size;
+} MCHPCIState;
+
+typedef struct Q35PCIHost {
+    PCIExpressHost host;
+    MCHPCIState mch;
+} Q35PCIHost;
+
+#define Q35_MASK(bit, ms_bit, ls_bit) \
+((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1)))
+
+/*
+ * gmch part
+ */
+
+/* PCI configuration */
+#define MCH_HOST_BRIDGE                        "MCH"
+
+#define MCH_HOST_BRIDGE_CONFIG_ADDR            0xcf8
+#define MCH_HOST_BRIDGE_CONFIG_DATA            0xcfc
+
+/* D0:F0 configuration space */
+#define MCH_HOST_BRIDGE_REVISION_DEFUALT       0x0
+
+#define MCH_HOST_BRIDGE_PCIEXBAR               0x60    /* 64bit register */
+#define MCH_HOST_BRIDGE_PCIEXBAR_SIZE          8       /* 64bit register */
+#define MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT       0xb0000000
+#define MCH_HOST_BRIDGE_PCIEXBAR_ADMSK         Q35_MASK(64, 35, 28)
+#define MCH_HOST_BRIDGE_PCIEXBAR_128ADMSK      ((uint64_t)(1 << 26))
+#define MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK       ((uint64_t)(1 << 25))
+#define MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_MASK   ((uint64_t)(0x3 << 1))
+#define MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_256M   ((uint64_t)(0x0 << 1))
+#define MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_128M   ((uint64_t)(0x1 << 1))
+#define MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_64M    ((uint64_t)(0x2 << 1))
+#define MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD    ((uint64_t)(0x3 << 1))
+#define MCH_HOST_BRIDGE_PCIEXBAREN             ((uint64_t)1)
+
+#define MCH_HOST_BRIDGE_PAM_NB                 7
+#define MCH_HOST_BRIDGE_PAM_SIZE               7
+#define MCH_HOST_BRIDGE_PAM0                   0x90
+#define MCH_HOST_BRIDGE_PAM_BIOS_AREA          0xf0000
+#define MCH_HOST_BRIDGE_PAM_AREA_SIZE          0x10000 /* 16KB */
+#define MCH_HOST_BRIDGE_PAM1                   0x91
+#define MCH_HOST_BRIDGE_PAM_EXPAN_AREA         0xc0000
+#define MCH_HOST_BRIDGE_PAM_EXPAN_SIZE         0x04000
+#define MCH_HOST_BRIDGE_PAM2                   0x92
+#define MCH_HOST_BRIDGE_PAM3                   0x93
+#define MCH_HOST_BRIDGE_PAM4                   0x94
+#define MCH_HOST_BRIDGE_PAM_EXBIOS_AREA        0xe0000
+#define MCH_HOST_BRIDGE_PAM_EXBIOS_SIZE        0x04000
+#define MCH_HOST_BRIDGE_PAM5                   0x95
+#define MCH_HOST_BRIDGE_PAM6                   0x96
+#define MCH_HOST_BRIDGE_PAM_WE_HI              ((uint8_t)(0x2 << 4))
+#define MCH_HOST_BRIDGE_PAM_RE_HI              ((uint8_t)(0x1 << 4))
+#define MCH_HOST_BRIDGE_PAM_HI_MASK            ((uint8_t)(0x3 << 4))
+#define MCH_HOST_BRIDGE_PAM_WE_LO              ((uint8_t)0x2)
+#define MCH_HOST_BRIDGE_PAM_RE_LO              ((uint8_t)0x1)
+#define MCH_HOST_BRIDGE_PAM_LO_MASK            ((uint8_t)0x3)
+#define MCH_HOST_BRIDGE_PAM_WE                 ((uint8_t)0x2)
+#define MCH_HOST_BRIDGE_PAM_RE                 ((uint8_t)0x1)
+#define MCH_HOST_BRIDGE_PAM_MASK               ((uint8_t)0x3)
+
+#define MCH_HOST_BRDIGE_SMRAM                  0x9d
+#define MCH_HOST_BRDIGE_SMRAM_SIZE             1
+#define MCH_HOST_BRIDGE_SMRAM_DEFAULT          ((uint8_t)0x2)
+#define MCH_HOST_BRIDGE_SMRAM_D_OPEN           ((uint8_t)(1 << 6))
+#define MCH_HOST_BRIDGE_SMRAM_D_CLS            ((uint8_t)(1 << 5))
+#define MCH_HOST_BRIDGE_SMRAM_D_LCK            ((uint8_t)(1 << 4))
+#define MCH_HOST_BRIDGE_SMRAM_G_SMRAME         ((uint8_t)(1 << 3))
+#define MCH_HOST_BRIDGE_SMRAM_C_BASE_SEG_MASK  ((uint8_t)0x7)
+#define MCH_HOST_BRIDGE_SMRAM_C_BASE_SEG       ((uint8_t)0x2)  /* hardwired to b010 */
+#define MCH_HOST_BRIDGE_SMRAM_C_BASE           0xa0000
+#define MCH_HOST_BRIDGE_SMRAM_C_END            0xc0000
+#define MCH_HOST_BRIDGE_SMRAM_C_SIZE           0x20000
+#define MCH_HOST_BRIDGE_UPPER_SYSTEM_BIOS_END  0x100000
+
+#define MCH_HOST_BRIDGE_ESMRAMC                0x9e
+#define MCH_HOST_BRDIGE_ESMRAMC_H_SMRAME       ((uint8_t)(1 << 6))
+#define MCH_HOST_BRDIGE_ESMRAMC_E_SMERR        ((uint8_t)(1 << 5))
+#define MCH_HOST_BRDIGE_ESMRAMC_SM_CACHE       ((uint8_t)(1 << 4))
+#define MCH_HOST_BRDIGE_ESMRAMC_SM_L1          ((uint8_t)(1 << 3))
+#define MCH_HOST_BRDIGE_ESMRAMC_SM_L2          ((uint8_t)(1 << 2))
+#define MCH_HOST_BRDIGE_ESMRAMC_TSEG_SZ_MASK   ((uint8_t)(0x3 << 1))
+#define MCH_HOST_BRDIGE_ESMRAMC_TSEG_SZ_1MB    ((uint8_t)(0x0 << 1))
+#define MCH_HOST_BRDIGE_ESMRAMC_TSEG_SZ_2MB    ((uint8_t)(0x1 << 1))
+#define MCH_HOST_BRDIGE_ESMRAMC_TSEG_SZ_8MB    ((uint8_t)(0x2 << 1))
+#define MCH_HOST_BRDIGE_ESMRAMC_T_EN           ((uint8_t)1)
+
+/* D1:F0 PCIE* port*/
+#define MCH_PCIE_DEV                           1
+#define MCH_PCIE_FUNC                          0
+
+#endif /* HW_Q35_H */
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:51:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:51:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQF0-0003JI-CA; Tue, 11 Dec 2012 13:51:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEy-0003J4-QS
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:21 +0000
Received: from [85.158.138.51:21722] by server-15.bemta-3.messagelabs.com id
	70/14-07921-85A37C05; Tue, 11 Dec 2012 13:51:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1355233873!9741523!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27631 invoked from network); 11 Dec 2012 13:51:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEr-0001Q0-Ol
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQEr-0005kA-II
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:13 +0000
Date: Tue, 11 Dec 2012 13:51:13 +0000
Message-Id: <E1TiQEr-0005kA-II@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] q35: Introduce q35 pc
	based chipset emulator
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit df2d8b3ed4d2b6406335d274f9537d78ac4e3c0c
Author: Isaku Yamahata <yamahata@valinux.co.jp>
Date:   Wed Nov 14 15:54:06 2012 -0500

    q35: Introduce q35 pc based chipset emulator
    
    pc q35 based chipset emulator to support pci express natively. Based on
    Anthony Liguori's suggestion, the machine name is 'q35-next', with an alias
    of 'q35'. At this point, there are no compatibility guarantees. When the
    chipset stabilizes more, we will begin to version the machine names.
    
    Major features which still need to be added:
    
    -Migration support (mostly around ahci)
    -ACPI hotplug support (pcie hotplug support is working)
    -Passthrough support
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/i386/Makefile.objs |    2 +-
 hw/pc_q35.c           |  220 +++++++++++++++++++++++++++++++++++
 hw/pci_ids.h          |    2 +
 hw/q35.c              |  309 +++++++++++++++++++++++++++++++++++++++++++++++++
 hw/q35.h              |  150 ++++++++++++++++++++++++
 5 files changed, 682 insertions(+), 1 deletions(-)

diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 9543a69..0d3f6a8 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -6,7 +6,7 @@ obj-y += pci-hotplug.o smbios.o wdt_ib700.o
 obj-y += debugcon.o multiboot.o
 obj-y += pc_piix.o
 obj-y += pc_sysfw.o
-obj-y += lpc_ich9.o
+obj-y += lpc_ich9.o q35.o pc_q35.o
 obj-$(CONFIG_XEN) += xen_platform.o xen_apic.o
 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o
 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_msi.o
diff --git a/hw/pc_q35.c b/hw/pc_q35.c
new file mode 100644
index 0000000..142bf8a
--- /dev/null
+++ b/hw/pc_q35.c
@@ -0,0 +1,220 @@
+/*
+ * Q35 chipset based pc system emulator
+ *
+ * Copyright (c) 2003-2004 Fabrice Bellard
+ * Copyright (c) 2009, 2010
+ *               Isaku Yamahata <yamahata at valinux co jp>
+ *               VA Linux Systems Japan K.K.
+ * Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * This is based on pc.c, but heavily modified.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#include "hw.h"
+#include "arch_init.h"
+#include "smbus.h"
+#include "boards.h"
+#include "mc146818rtc.h"
+#include "xen.h"
+#include "kvm.h"
+#include "q35.h"
+#include "exec-memory.h"
+#include "ich9.h"
+#include "hw/ide/pci.h"
+#include "hw/ide/ahci.h"
+#include "hw/usb.h"
+
+/* ICH9 AHCI has 6 ports */
+#define MAX_SATA_PORTS     6
+
+/* set CMOS shutdown status register (index 0xF) as S3_resume(0xFE)
+ *    BIOS will read it and start S3 resume at POST Entry */
+static void pc_cmos_set_s3_resume(void *opaque, int irq, int level)
+{
+    ISADevice *s = opaque;
+
+    if (level) {
+        rtc_set_memory(s, 0xF, 0xFE);
+    }
+}
+
+/* PC hardware initialisation */
+static void pc_q35_init(QEMUMachineInitArgs *args)
+{
+    ram_addr_t ram_size = args->ram_size;
+    const char *cpu_model = args->cpu_model;
+    const char *kernel_filename = args->kernel_filename;
+    const char *kernel_cmdline = args->kernel_cmdline;
+    const char *initrd_filename = args->initrd_filename;
+    const char *boot_device = args->boot_device;
+    ram_addr_t below_4g_mem_size, above_4g_mem_size;
+    Q35PCIHost *q35_host;
+    PCIBus *host_bus;
+    PCIDevice *lpc;
+    BusState *idebus[MAX_SATA_PORTS];
+    ISADevice *rtc_state;
+    ISADevice *floppy;
+    MemoryRegion *pci_memory;
+    MemoryRegion *rom_memory;
+    MemoryRegion *ram_memory;
+    GSIState *gsi_state;
+    ISABus *isa_bus;
+    int pci_enabled = 1;
+    qemu_irq *cpu_irq;
+    qemu_irq *gsi;
+    qemu_irq *i8259;
+    int i;
+    ICH9LPCState *ich9_lpc;
+    PCIDevice *ahci;
+    qemu_irq *cmos_s3;
+
+    pc_cpus_init(cpu_model);
+
+    if (ram_size >= 0xb0000000) {
+        above_4g_mem_size = ram_size - 0xb0000000;
+        below_4g_mem_size = 0xb0000000;
+    } else {
+        above_4g_mem_size = 0;
+        below_4g_mem_size = ram_size;
+    }
+
+    /* pci enabled */
+    if (pci_enabled) {
+        pci_memory = g_new(MemoryRegion, 1);
+        memory_region_init(pci_memory, "pci", INT64_MAX);
+        rom_memory = pci_memory;
+    } else {
+        pci_memory = NULL;
+        rom_memory = get_system_memory();
+    }
+
+    /* allocate ram and load rom/bios */
+    if (!xen_enabled()) {
+        pc_memory_init(get_system_memory(), kernel_filename, kernel_cmdline,
+                       initrd_filename, below_4g_mem_size, above_4g_mem_size,
+                       rom_memory, &ram_memory);
+    }
+
+    /* irq lines */
+    gsi_state = g_malloc0(sizeof(*gsi_state));
+    if (kvm_irqchip_in_kernel()) {
+        kvm_pc_setup_irq_routing(pci_enabled);
+        gsi = qemu_allocate_irqs(kvm_pc_gsi_handler, gsi_state,
+                                 GSI_NUM_PINS);
+    } else {
+        gsi = qemu_allocate_irqs(gsi_handler, gsi_state, GSI_NUM_PINS);
+    }
+
+    /* create pci host bus */
+    q35_host = Q35_HOST_DEVICE(qdev_create(NULL, TYPE_Q35_HOST_DEVICE));
+
+    q35_host->mch.ram_memory = ram_memory;
+    q35_host->mch.pci_address_space = pci_memory;
+    q35_host->mch.system_memory = get_system_memory();
+    q35_host->mch.address_space_io = get_system_io();;
+    q35_host->mch.below_4g_mem_size = below_4g_mem_size;
+    q35_host->mch.above_4g_mem_size = above_4g_mem_size;
+    /* pci */
+    qdev_init_nofail(DEVICE(q35_host));
+    host_bus = q35_host->host.pci.bus;
+    /* create ISA bus */
+    lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV,
+                                          ICH9_LPC_FUNC), true,
+                                          TYPE_ICH9_LPC_DEVICE);
+    ich9_lpc = ICH9_LPC_DEVICE(lpc);
+    ich9_lpc->pic = gsi;
+    ich9_lpc->ioapic = gsi_state->ioapic_irq;
+    pci_bus_irqs(host_bus, ich9_lpc_set_irq, ich9_lpc_map_irq, ich9_lpc,
+                 ICH9_LPC_NB_PIRQS);
+    isa_bus = ich9_lpc->isa_bus;
+
+    /*end early*/
+    isa_bus_irqs(isa_bus, gsi);
+
+    if (kvm_irqchip_in_kernel()) {
+        i8259 = kvm_i8259_init(isa_bus);
+    } else if (xen_enabled()) {
+        i8259 = xen_interrupt_controller_init();
+    } else {
+        cpu_irq = pc_allocate_cpu_irq();
+        i8259 = i8259_init(isa_bus, cpu_irq[0]);
+    }
+
+    for (i = 0; i < ISA_NUM_IRQS; i++) {
+        gsi_state->i8259_irq[i] = i8259[i];
+    }
+    if (pci_enabled) {
+        ioapic_init_gsi(gsi_state, NULL);
+    }
+
+    pc_register_ferr_irq(gsi[13]);
+
+    /* init basic PC hardware */
+    pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, false);
+
+    /* connect pm stuff to lpc */
+    cmos_s3 = qemu_allocate_irqs(pc_cmos_set_s3_resume, rtc_state, 1);
+    ich9_lpc_pm_init(lpc, *cmos_s3);
+
+    /* ahci and SATA device, for q35 1 ahci controller is built-in */
+    ahci = pci_create_simple_multifunction(host_bus,
+                                           PCI_DEVFN(ICH9_SATA1_DEV,
+                                                     ICH9_SATA1_FUNC),
+                                           true, "ich9-ahci");
+    idebus[0] = qdev_get_child_bus(&ahci->qdev, "ide.0");
+    idebus[1] = qdev_get_child_bus(&ahci->qdev, "ide.1");
+
+    if (usb_enabled(false)) {
+        /* Should we create 6 UHCI according to ich9 spec? */
+        ehci_create_ich9_with_companions(host_bus, 0x1d);
+    }
+
+    /* TODO: Populate SPD eeprom data.  */
+    smbus_eeprom_init(ich9_smb_init(host_bus,
+                                    PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC),
+                                    0xb100),
+                      8, NULL, 0);
+
+    pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device,
+                 floppy, idebus[0], idebus[1], rtc_state);
+
+    /* the rest devices to which pci devfn is automatically assigned */
+    pc_vga_init(isa_bus, host_bus);
+    audio_init(isa_bus, host_bus);
+    pc_nic_init(isa_bus, host_bus);
+    if (pci_enabled) {
+        pc_pci_device_init(host_bus);
+    }
+}
+
+static QEMUMachine pc_q35_machine = {
+    .name = "q35-next",
+    .alias = "q35",
+    .desc = "Q35 chipset PC",
+    .init = pc_q35_init,
+    .max_cpus = 255,
+};
+
+static void pc_q35_machine_init(void)
+{
+    qemu_register_machine(&pc_q35_machine);
+}
+
+machine_init(pc_q35_machine_init);
diff --git a/hw/pci_ids.h b/hw/pci_ids.h
index d1e83dd..5df7245 100644
--- a/hw/pci_ids.h
+++ b/hw/pci_ids.h
@@ -138,6 +138,8 @@
 #define PCI_DEVICE_ID_INTEL_82801I_EHCI2 0x293c
 #define PCI_DEVICE_ID_INTEL_82599_SFP_VF 0x10ed
 
+#define PCI_DEVICE_ID_INTEL_Q35_MCH      0x29c0
+
 #define PCI_VENDOR_ID_XEN               0x5853
 #define PCI_DEVICE_ID_XEN_PLATFORM      0x0001
 
diff --git a/hw/q35.c b/hw/q35.c
new file mode 100644
index 0000000..efebc27
--- /dev/null
+++ b/hw/q35.c
@@ -0,0 +1,309 @@
+/*
+ * QEMU MCH/ICH9 PCI Bridge Emulation
+ *
+ * Copyright (c) 2006 Fabrice Bellard
+ * Copyright (c) 2009, 2010, 2011
+ *               Isaku Yamahata <yamahata at valinux co jp>
+ *               VA Linux Systems Japan K.K.
+ * Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * This is based on piix_pci.c, but heavily modified.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#include "hw.h"
+#include "q35.h"
+
+/****************************************************************************
+ * Q35 host
+ */
+
+static int q35_host_init(SysBusDevice *dev)
+{
+    PCIBus *b;
+    PCIHostState *pci = FROM_SYSBUS(PCIHostState, dev);
+    Q35PCIHost *s = Q35_HOST_DEVICE(&dev->qdev);
+
+    memory_region_init_io(&pci->conf_mem, &pci_host_conf_le_ops, pci,
+                          "pci-conf-idx", 4);
+    sysbus_add_io(dev, MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_mem);
+    sysbus_init_ioports(&pci->busdev, MCH_HOST_BRIDGE_CONFIG_ADDR, 4);
+
+    memory_region_init_io(&pci->data_mem, &pci_host_data_le_ops, pci,
+                          "pci-conf-data", 4);
+    sysbus_add_io(dev, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem);
+    sysbus_init_ioports(&pci->busdev, MCH_HOST_BRIDGE_CONFIG_DATA, 4);
+
+    if (pcie_host_init(&s->host) < 0) {
+        return -1;
+    }
+    b = pci_bus_new(&s->host.pci.busdev.qdev, "pcie.0",
+                    s->mch.pci_address_space, s->mch.address_space_io, 0);
+    s->host.pci.bus = b;
+    qdev_set_parent_bus(DEVICE(&s->mch), BUS(b));
+    qdev_init_nofail(DEVICE(&s->mch));
+
+    return 0;
+}
+
+static Property mch_props[] = {
+    DEFINE_PROP_UINT64("MCFG", Q35PCIHost, host.base_addr,
+                        MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void q35_host_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
+
+    k->init = q35_host_init;
+    dc->props = mch_props;
+}
+
+static void q35_host_initfn(Object *obj)
+{
+    Q35PCIHost *s = Q35_HOST_DEVICE(obj);
+
+    object_initialize(&s->mch, TYPE_MCH_PCI_DEVICE);
+    object_property_add_child(OBJECT(s), "mch", OBJECT(&s->mch), NULL);
+    qdev_prop_set_uint32(DEVICE(&s->mch), "addr", PCI_DEVFN(0, 0));
+    qdev_prop_set_bit(DEVICE(&s->mch), "multifunction", false);
+}
+
+static const TypeInfo q35_host_info = {
+    .name       = TYPE_Q35_HOST_DEVICE,
+    .parent     = TYPE_PCIE_HOST_BRIDGE,
+    .instance_size = sizeof(Q35PCIHost),
+    .instance_init = q35_host_initfn,
+    .class_init = q35_host_class_init,
+};
+
+/****************************************************************************
+ * MCH D0:F0
+ */
+
+/* PCIe MMCFG */
+static void mch_update_pciexbar(MCHPCIState *mch)
+{
+    PCIDevice *pci_dev = &mch->d;
+    BusState *bus = qdev_get_parent_bus(&pci_dev->qdev);
+    DeviceState *qdev = bus->parent;
+    Q35PCIHost *s = Q35_HOST_DEVICE(qdev);
+
+    uint64_t pciexbar;
+    int enable;
+    uint64_t addr;
+    uint64_t addr_mask;
+    uint32_t length;
+
+    pciexbar = pci_get_quad(pci_dev->config + MCH_HOST_BRIDGE_PCIEXBAR);
+    enable = pciexbar & MCH_HOST_BRIDGE_PCIEXBAREN;
+    addr_mask = MCH_HOST_BRIDGE_PCIEXBAR_ADMSK;
+    switch (pciexbar & MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_MASK) {
+    case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_256M:
+        length = 256 * 1024 * 1024;
+        break;
+    case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_128M:
+        length = 128 * 1024 * 1024;
+        addr_mask |= MCH_HOST_BRIDGE_PCIEXBAR_128ADMSK |
+            MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK;
+        break;
+    case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_64M:
+        length = 64 * 1024 * 1024;
+        addr_mask |= MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK;
+        break;
+    case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD:
+    default:
+        enable = 0;
+        length = 0;
+        abort();
+        break;
+    }
+    addr = pciexbar & addr_mask;
+    pcie_host_mmcfg_update(&s->host, enable, addr, length);
+}
+
+/* PAM */
+static void mch_update_pam(MCHPCIState *mch)
+{
+    int i;
+
+    memory_region_transaction_begin();
+    for (i = 0; i < 13; i++) {
+        pam_update(&mch->pam_regions[i], i,
+                   mch->d.config[MCH_HOST_BRIDGE_PAM0 + ((i + 1) / 2)]);
+    }
+    memory_region_transaction_commit();
+}
+
+/* SMRAM */
+static void mch_update_smram(MCHPCIState *mch)
+{
+    memory_region_transaction_begin();
+    smram_update(&mch->smram_region, mch->d.config[MCH_HOST_BRDIGE_SMRAM],
+                    mch->smm_enabled);
+    memory_region_transaction_commit();
+}
+
+static void mch_set_smm(int smm, void *arg)
+{
+    MCHPCIState *mch = arg;
+
+    memory_region_transaction_begin();
+    smram_set_smm(&mch->smm_enabled, smm, mch->d.config[MCH_HOST_BRDIGE_SMRAM],
+                    &mch->smram_region);
+    memory_region_transaction_commit();
+}
+
+static void mch_write_config(PCIDevice *d,
+                              uint32_t address, uint32_t val, int len)
+{
+    MCHPCIState *mch = MCH_PCI_DEVICE(d);
+
+    /* XXX: implement SMRAM.D_LOCK */
+    pci_default_write_config(d, address, val, len);
+
+    if (ranges_overlap(address, len, MCH_HOST_BRIDGE_PAM0,
+                       MCH_HOST_BRIDGE_PAM_SIZE)) {
+        mch_update_pam(mch);
+    }
+
+    if (ranges_overlap(address, len, MCH_HOST_BRIDGE_PCIEXBAR,
+                       MCH_HOST_BRIDGE_PCIEXBAR_SIZE)) {
+        mch_update_pciexbar(mch);
+    }
+
+    if (ranges_overlap(address, len, MCH_HOST_BRDIGE_SMRAM,
+                       MCH_HOST_BRDIGE_SMRAM_SIZE)) {
+        mch_update_smram(mch);
+    }
+}
+
+static void mch_update(MCHPCIState *mch)
+{
+    mch_update_pciexbar(mch);
+    mch_update_pam(mch);
+    mch_update_smram(mch);
+}
+
+static int mch_post_load(void *opaque, int version_id)
+{
+    MCHPCIState *mch = opaque;
+    mch_update(mch);
+    return 0;
+}
+
+static const VMStateDescription vmstate_mch = {
+    .name = "mch",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .post_load = mch_post_load,
+    .fields = (VMStateField []) {
+        VMSTATE_PCI_DEVICE(d, MCHPCIState),
+        VMSTATE_UINT8(smm_enabled, MCHPCIState),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+static void mch_reset(DeviceState *qdev)
+{
+    PCIDevice *d = PCI_DEVICE(qdev);
+    MCHPCIState *mch = MCH_PCI_DEVICE(d);
+
+    pci_set_quad(d->config + MCH_HOST_BRIDGE_PCIEXBAR,
+                 MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT);
+
+    d->config[MCH_HOST_BRDIGE_SMRAM] = MCH_HOST_BRIDGE_SMRAM_DEFAULT;
+
+    mch_update(mch);
+}
+
+static int mch_init(PCIDevice *d)
+{
+    int i;
+    hwaddr pci_hole64_size;
+    MCHPCIState *mch = MCH_PCI_DEVICE(d);
+
+    /* setup pci memory regions */
+    memory_region_init_alias(&mch->pci_hole, "pci-hole",
+                             mch->pci_address_space,
+                             mch->below_4g_mem_size,
+                             0x100000000ULL - mch->below_4g_mem_size);
+    memory_region_add_subregion(mch->system_memory, mch->below_4g_mem_size,
+                                &mch->pci_hole);
+    pci_hole64_size = (sizeof(hwaddr) == 4 ? 0 :
+                       ((uint64_t)1 << 62));
+    memory_region_init_alias(&mch->pci_hole_64bit, "pci-hole64",
+                             mch->pci_address_space,
+                             0x100000000ULL + mch->above_4g_mem_size,
+                             pci_hole64_size);
+    if (pci_hole64_size) {
+        memory_region_add_subregion(mch->system_memory,
+                                    0x100000000ULL + mch->above_4g_mem_size,
+                                    &mch->pci_hole_64bit);
+    }
+    /* smram */
+    cpu_smm_register(&mch_set_smm, mch);
+    memory_region_init_alias(&mch->smram_region, "smram-region",
+                             mch->pci_address_space, 0xa0000, 0x20000);
+    memory_region_add_subregion_overlap(mch->system_memory, 0xa0000,
+                                        &mch->smram_region, 1);
+    memory_region_set_enabled(&mch->smram_region, false);
+    init_pam(mch->ram_memory, mch->system_memory, mch->pci_address_space,
+             &mch->pam_regions[0], PAM_BIOS_BASE, PAM_BIOS_SIZE);
+    for (i = 0; i < 12; ++i) {
+        init_pam(mch->ram_memory, mch->system_memory, mch->pci_address_space,
+                 &mch->pam_regions[i+1], PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE,
+                 PAM_EXPAN_SIZE);
+    }
+    return 0;
+}
+
+static void mch_class_init(ObjectClass *klass, void *data)
+{
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    k->init = mch_init;
+    k->config_write = mch_write_config;
+    dc->reset = mch_reset;
+    dc->desc = "Host bridge";
+    dc->vmsd = &vmstate_mch;
+    k->vendor_id = PCI_VENDOR_ID_INTEL;
+    k->device_id = PCI_DEVICE_ID_INTEL_Q35_MCH;
+    k->revision = MCH_HOST_BRIDGE_REVISION_DEFUALT;
+    k->class_id = PCI_CLASS_BRIDGE_HOST;
+}
+
+static const TypeInfo mch_info = {
+    .name = TYPE_MCH_PCI_DEVICE,
+    .parent = TYPE_PCI_DEVICE,
+    .instance_size = sizeof(MCHPCIState),
+    .class_init = mch_class_init,
+};
+
+static void q35_register(void)
+{
+    type_register_static(&mch_info);
+    type_register_static(&q35_host_info);
+}
+
+type_init(q35_register);
diff --git a/hw/q35.h b/hw/q35.h
new file mode 100644
index 0000000..e34f7c1
--- /dev/null
+++ b/hw/q35.h
@@ -0,0 +1,150 @@
+/*
+ * q35.h
+ *
+ * Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
+ *                    VA Linux Systems Japan K.K.
+ * Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#ifndef HW_Q35_H
+#define HW_Q35_H
+
+#include "hw.h"
+#include "range.h"
+#include "isa.h"
+#include "sysbus.h"
+#include "pc.h"
+#include "apm.h"
+#include "apic.h"
+#include "pci.h"
+#include "pcie_host.h"
+#include "acpi.h"
+#include "acpi_ich9.h"
+#include "pam.h"
+
+#define TYPE_Q35_HOST_DEVICE "q35-pcihost"
+#define Q35_HOST_DEVICE(obj) \
+     OBJECT_CHECK(Q35PCIHost, (obj), TYPE_Q35_HOST_DEVICE)
+
+#define TYPE_MCH_PCI_DEVICE "mch"
+#define MCH_PCI_DEVICE(obj) \
+     OBJECT_CHECK(MCHPCIState, (obj), TYPE_MCH_PCI_DEVICE)
+
+typedef struct MCHPCIState {
+    PCIDevice d;
+    MemoryRegion *ram_memory;
+    MemoryRegion *pci_address_space;
+    MemoryRegion *system_memory;
+    MemoryRegion *address_space_io;
+    PAMMemoryRegion pam_regions[13];
+    MemoryRegion smram_region;
+    MemoryRegion pci_hole;
+    MemoryRegion pci_hole_64bit;
+    uint8_t smm_enabled;
+    ram_addr_t below_4g_mem_size;
+    ram_addr_t above_4g_mem_size;
+} MCHPCIState;
+
+typedef struct Q35PCIHost {
+    PCIExpressHost host;
+    MCHPCIState mch;
+} Q35PCIHost;
+
+#define Q35_MASK(bit, ms_bit, ls_bit) \
+((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1)))
+
+/*
+ * gmch part
+ */
+
+/* PCI configuration */
+#define MCH_HOST_BRIDGE                        "MCH"
+
+#define MCH_HOST_BRIDGE_CONFIG_ADDR            0xcf8
+#define MCH_HOST_BRIDGE_CONFIG_DATA            0xcfc
+
+/* D0:F0 configuration space */
+#define MCH_HOST_BRIDGE_REVISION_DEFUALT       0x0
+
+#define MCH_HOST_BRIDGE_PCIEXBAR               0x60    /* 64bit register */
+#define MCH_HOST_BRIDGE_PCIEXBAR_SIZE          8       /* 64bit register */
+#define MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT       0xb0000000
+#define MCH_HOST_BRIDGE_PCIEXBAR_ADMSK         Q35_MASK(64, 35, 28)
+#define MCH_HOST_BRIDGE_PCIEXBAR_128ADMSK      ((uint64_t)(1 << 26))
+#define MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK       ((uint64_t)(1 << 25))
+#define MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_MASK   ((uint64_t)(0x3 << 1))
+#define MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_256M   ((uint64_t)(0x0 << 1))
+#define MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_128M   ((uint64_t)(0x1 << 1))
+#define MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_64M    ((uint64_t)(0x2 << 1))
+#define MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD    ((uint64_t)(0x3 << 1))
+#define MCH_HOST_BRIDGE_PCIEXBAREN             ((uint64_t)1)
+
+#define MCH_HOST_BRIDGE_PAM_NB                 7
+#define MCH_HOST_BRIDGE_PAM_SIZE               7
+#define MCH_HOST_BRIDGE_PAM0                   0x90
+#define MCH_HOST_BRIDGE_PAM_BIOS_AREA          0xf0000
+#define MCH_HOST_BRIDGE_PAM_AREA_SIZE          0x10000 /* 16KB */
+#define MCH_HOST_BRIDGE_PAM1                   0x91
+#define MCH_HOST_BRIDGE_PAM_EXPAN_AREA         0xc0000
+#define MCH_HOST_BRIDGE_PAM_EXPAN_SIZE         0x04000
+#define MCH_HOST_BRIDGE_PAM2                   0x92
+#define MCH_HOST_BRIDGE_PAM3                   0x93
+#define MCH_HOST_BRIDGE_PAM4                   0x94
+#define MCH_HOST_BRIDGE_PAM_EXBIOS_AREA        0xe0000
+#define MCH_HOST_BRIDGE_PAM_EXBIOS_SIZE        0x04000
+#define MCH_HOST_BRIDGE_PAM5                   0x95
+#define MCH_HOST_BRIDGE_PAM6                   0x96
+#define MCH_HOST_BRIDGE_PAM_WE_HI              ((uint8_t)(0x2 << 4))
+#define MCH_HOST_BRIDGE_PAM_RE_HI              ((uint8_t)(0x1 << 4))
+#define MCH_HOST_BRIDGE_PAM_HI_MASK            ((uint8_t)(0x3 << 4))
+#define MCH_HOST_BRIDGE_PAM_WE_LO              ((uint8_t)0x2)
+#define MCH_HOST_BRIDGE_PAM_RE_LO              ((uint8_t)0x1)
+#define MCH_HOST_BRIDGE_PAM_LO_MASK            ((uint8_t)0x3)
+#define MCH_HOST_BRIDGE_PAM_WE                 ((uint8_t)0x2)
+#define MCH_HOST_BRIDGE_PAM_RE                 ((uint8_t)0x1)
+#define MCH_HOST_BRIDGE_PAM_MASK               ((uint8_t)0x3)
+
+#define MCH_HOST_BRDIGE_SMRAM                  0x9d
+#define MCH_HOST_BRDIGE_SMRAM_SIZE             1
+#define MCH_HOST_BRIDGE_SMRAM_DEFAULT          ((uint8_t)0x2)
+#define MCH_HOST_BRIDGE_SMRAM_D_OPEN           ((uint8_t)(1 << 6))
+#define MCH_HOST_BRIDGE_SMRAM_D_CLS            ((uint8_t)(1 << 5))
+#define MCH_HOST_BRIDGE_SMRAM_D_LCK            ((uint8_t)(1 << 4))
+#define MCH_HOST_BRIDGE_SMRAM_G_SMRAME         ((uint8_t)(1 << 3))
+#define MCH_HOST_BRIDGE_SMRAM_C_BASE_SEG_MASK  ((uint8_t)0x7)
+#define MCH_HOST_BRIDGE_SMRAM_C_BASE_SEG       ((uint8_t)0x2)  /* hardwired to b010 */
+#define MCH_HOST_BRIDGE_SMRAM_C_BASE           0xa0000
+#define MCH_HOST_BRIDGE_SMRAM_C_END            0xc0000
+#define MCH_HOST_BRIDGE_SMRAM_C_SIZE           0x20000
+#define MCH_HOST_BRIDGE_UPPER_SYSTEM_BIOS_END  0x100000
+
+#define MCH_HOST_BRIDGE_ESMRAMC                0x9e
+#define MCH_HOST_BRDIGE_ESMRAMC_H_SMRAME       ((uint8_t)(1 << 6))
+#define MCH_HOST_BRDIGE_ESMRAMC_E_SMERR        ((uint8_t)(1 << 5))
+#define MCH_HOST_BRDIGE_ESMRAMC_SM_CACHE       ((uint8_t)(1 << 4))
+#define MCH_HOST_BRDIGE_ESMRAMC_SM_L1          ((uint8_t)(1 << 3))
+#define MCH_HOST_BRDIGE_ESMRAMC_SM_L2          ((uint8_t)(1 << 2))
+#define MCH_HOST_BRDIGE_ESMRAMC_TSEG_SZ_MASK   ((uint8_t)(0x3 << 1))
+#define MCH_HOST_BRDIGE_ESMRAMC_TSEG_SZ_1MB    ((uint8_t)(0x0 << 1))
+#define MCH_HOST_BRDIGE_ESMRAMC_TSEG_SZ_2MB    ((uint8_t)(0x1 << 1))
+#define MCH_HOST_BRDIGE_ESMRAMC_TSEG_SZ_8MB    ((uint8_t)(0x2 << 1))
+#define MCH_HOST_BRDIGE_ESMRAMC_T_EN           ((uint8_t)1)
+
+/* D1:F0 PCIE* port*/
+#define MCH_PCIE_DEV                           1
+#define MCH_PCIE_FUNC                          0
+
+#endif /* HW_Q35_H */
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:51:49 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:51:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQFR-0003Nj-IK; Tue, 11 Dec 2012 13:51:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFP-0003NM-Lt
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:47 +0000
Received: from [85.158.139.83:25019] by server-12.bemta-5.messagelabs.com id
	D6/E9-02275-27A37C05; Tue, 11 Dec 2012 13:51:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1355233905!29368709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7204 invoked from network); 11 Dec 2012 13:51:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFM-0001QK-Su
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFM-0005m4-E2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:44 +0000
Date: Tue, 11 Dec 2012 13:51:44 +0000
Message-Id: <E1TiQFM-0005m4-E2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] q35: Fix non-PCI IRQ
	processing in ich9_lpc_update_apic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 243b95111c8b8d171e627247a7de16e94c7e9de0
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Wed Nov 14 15:54:08 2012 -0500

    q35: Fix non-PCI IRQ processing in ich9_lpc_update_apic
    
    Avoid passing a non-PCI IRQ to ich9_gsi_to_pirq. It's wrong and triggers
    an assertion.
    
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/lpc_ich9.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/lpc_ich9.c b/hw/lpc_ich9.c
index f8f06b3..2fc83a4 100644
--- a/hw/lpc_ich9.c
+++ b/hw/lpc_ich9.c
@@ -264,9 +264,11 @@ static int ich9_gsi_to_pirq(int gsi)
 
 static void ich9_lpc_update_apic(ICH9LPCState *lpc, int gsi)
 {
-    int level;
+    int level = 0;
 
-    level = pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));
+    if (gsi >= ICH9_LPC_PIC_NUM_PINS) {
+        level |= pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));
+    }
     if (gsi == ich9_lpc_sci_irq(lpc)) {
         level |= lpc->sci_level;
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:51:49 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:51:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQFR-0003Nj-IK; Tue, 11 Dec 2012 13:51:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFP-0003NM-Lt
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:47 +0000
Received: from [85.158.139.83:25019] by server-12.bemta-5.messagelabs.com id
	D6/E9-02275-27A37C05; Tue, 11 Dec 2012 13:51:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1355233905!29368709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7204 invoked from network); 11 Dec 2012 13:51:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFM-0001QK-Su
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFM-0005m4-E2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:44 +0000
Date: Tue, 11 Dec 2012 13:51:44 +0000
Message-Id: <E1TiQFM-0005m4-E2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] q35: Fix non-PCI IRQ
	processing in ich9_lpc_update_apic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 243b95111c8b8d171e627247a7de16e94c7e9de0
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Wed Nov 14 15:54:08 2012 -0500

    q35: Fix non-PCI IRQ processing in ich9_lpc_update_apic
    
    Avoid passing a non-PCI IRQ to ich9_gsi_to_pirq. It's wrong and triggers
    an assertion.
    
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/lpc_ich9.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/lpc_ich9.c b/hw/lpc_ich9.c
index f8f06b3..2fc83a4 100644
--- a/hw/lpc_ich9.c
+++ b/hw/lpc_ich9.c
@@ -264,9 +264,11 @@ static int ich9_gsi_to_pirq(int gsi)
 
 static void ich9_lpc_update_apic(ICH9LPCState *lpc, int gsi)
 {
-    int level;
+    int level = 0;
 
-    level = pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));
+    if (gsi >= ICH9_LPC_PIC_NUM_PINS) {
+        level |= pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));
+    }
     if (gsi == ich9_lpc_sci_irq(lpc)) {
         level |= lpc->sci_level;
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:51:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:51:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQFV-0003OY-Kr; Tue, 11 Dec 2012 13:51:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFT-0003OG-DN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:51 +0000
Received: from [85.158.143.99:29938] by server-1.bemta-4.messagelabs.com id
	A9/7D-28401-67A37C05; Tue, 11 Dec 2012 13:51:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1355233894!23691796!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26387 invoked from network); 11 Dec 2012 13:51:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFC-0001QH-A2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFC-0005li-5O
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:34 +0000
Date: Tue, 11 Dec 2012 13:51:34 +0000
Message-Id: <E1TiQFC-0005li-5O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] q35: Suppress SMM BIOS
	initialization under KVM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21bcfdd9a43041720f9370831c694bcb2e11eea4
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Wed Nov 14 15:54:07 2012 -0500

    q35: Suppress SMM BIOS initialization under KVM
    
    Same as for i44fx: KVM does not support SMM yet. Signal it initialized
    to Seabios to avoid failures.
    
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/acpi_ich9.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/acpi_ich9.c b/hw/acpi_ich9.c
index c45921c..61034d3 100644
--- a/hw/acpi_ich9.c
+++ b/hw/acpi_ich9.c
@@ -28,6 +28,7 @@
 #include "qemu-timer.h"
 #include "sysemu.h"
 #include "acpi.h"
+#include "kvm.h"
 
 #include "ich9.h"
 
@@ -292,6 +293,12 @@ static void pm_reset(void *opaque)
     acpi_pm_tmr_reset(&pm->acpi_regs);
     acpi_gpe_reset(&pm->acpi_regs);
 
+    if (kvm_enabled()) {
+        /* Mark SMM as already inited to prevent SMM from running. KVM does not
+         * support SMM mode. */
+        pm->smi_en |= ICH9_PMIO_SMI_EN_APMC_EN;
+    }
+
     pm_update_sci(pm);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:51:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:51:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQFV-0003OY-Kr; Tue, 11 Dec 2012 13:51:53 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFT-0003OG-DN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:51 +0000
Received: from [85.158.143.99:29938] by server-1.bemta-4.messagelabs.com id
	A9/7D-28401-67A37C05; Tue, 11 Dec 2012 13:51:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1355233894!23691796!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26387 invoked from network); 11 Dec 2012 13:51:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFC-0001QH-A2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFC-0005li-5O
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:34 +0000
Date: Tue, 11 Dec 2012 13:51:34 +0000
Message-Id: <E1TiQFC-0005li-5O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] q35: Suppress SMM BIOS
	initialization under KVM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21bcfdd9a43041720f9370831c694bcb2e11eea4
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Wed Nov 14 15:54:07 2012 -0500

    q35: Suppress SMM BIOS initialization under KVM
    
    Same as for i44fx: KVM does not support SMM yet. Signal it initialized
    to Seabios to avoid failures.
    
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/acpi_ich9.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/acpi_ich9.c b/hw/acpi_ich9.c
index c45921c..61034d3 100644
--- a/hw/acpi_ich9.c
+++ b/hw/acpi_ich9.c
@@ -28,6 +28,7 @@
 #include "qemu-timer.h"
 #include "sysemu.h"
 #include "acpi.h"
+#include "kvm.h"
 
 #include "ich9.h"
 
@@ -292,6 +293,12 @@ static void pm_reset(void *opaque)
     acpi_pm_tmr_reset(&pm->acpi_regs);
     acpi_gpe_reset(&pm->acpi_regs);
 
+    if (kvm_enabled()) {
+        /* Mark SMM as already inited to prevent SMM from running. KVM does not
+         * support SMM mode. */
+        pm->smi_en |= ICH9_PMIO_SMI_EN_APMC_EN;
+    }
+
     pm_update_sci(pm);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:00 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQFa-0003PZ-Nk; Tue, 11 Dec 2012 13:51:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFa-0003PN-4r
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:58 +0000
Received: from [85.158.139.83:26998] by server-8.bemta-5.messagelabs.com id
	91/4D-15003-D7A37C05; Tue, 11 Dec 2012 13:51:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1355233915!29394596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6958 invoked from network); 11 Dec 2012 13:51:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFX-0001QT-7u
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFX-0005mS-2P
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:55 +0000
Date: Tue, 11 Dec 2012 13:51:55 +0000
Message-Id: <E1TiQFX-0005mS-2P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] q35: Add kvmclock support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21022c92dc5095324ceb3effc068b5ff81642125
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Wed Nov 14 15:54:08 2012 -0500

    q35: Add kvmclock support
    
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/pc_q35.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/pc_q35.c b/hw/pc_q35.c
index 142bf8a..3429a9a 100644
--- a/hw/pc_q35.c
+++ b/hw/pc_q35.c
@@ -34,6 +34,7 @@
 #include "mc146818rtc.h"
 #include "xen.h"
 #include "kvm.h"
+#include "kvm/clock.h"
 #include "q35.h"
 #include "exec-memory.h"
 #include "ich9.h"
@@ -87,6 +88,8 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
 
     pc_cpus_init(cpu_model);
 
+    kvmclock_create();
+
     if (ram_size >= 0xb0000000) {
         above_4g_mem_size = ram_size - 0xb0000000;
         below_4g_mem_size = 0xb0000000;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:00 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQFa-0003PZ-Nk; Tue, 11 Dec 2012 13:51:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFa-0003PN-4r
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:58 +0000
Received: from [85.158.139.83:26998] by server-8.bemta-5.messagelabs.com id
	91/4D-15003-D7A37C05; Tue, 11 Dec 2012 13:51:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1355233915!29394596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6958 invoked from network); 11 Dec 2012 13:51:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFX-0001QT-7u
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFX-0005mS-2P
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:55 +0000
Date: Tue, 11 Dec 2012 13:51:55 +0000
Message-Id: <E1TiQFX-0005mS-2P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] q35: Add kvmclock support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21022c92dc5095324ceb3effc068b5ff81642125
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Wed Nov 14 15:54:08 2012 -0500

    q35: Add kvmclock support
    
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/pc_q35.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/pc_q35.c b/hw/pc_q35.c
index 142bf8a..3429a9a 100644
--- a/hw/pc_q35.c
+++ b/hw/pc_q35.c
@@ -34,6 +34,7 @@
 #include "mc146818rtc.h"
 #include "xen.h"
 #include "kvm.h"
+#include "kvm/clock.h"
 #include "q35.h"
 #include "exec-memory.h"
 #include "ich9.h"
@@ -87,6 +88,8 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
 
     pc_cpus_init(cpu_model);
 
+    kvmclock_create();
+
     if (ram_size >= 0xb0000000) {
         above_4g_mem_size = ram_size - 0xb0000000;
         below_4g_mem_size = 0xb0000000;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQFr-0003Sq-Qw; Tue, 11 Dec 2012 13:52:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFq-0003SN-I1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:14 +0000
Received: from [85.158.139.83:29376] by server-4.bemta-5.messagelabs.com id
	32/7B-14693-D8A37C05; Tue, 11 Dec 2012 13:52:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1355233926!25479380!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32044 invoked from network); 11 Dec 2012 13:52:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFh-0001R5-Jp
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFh-0005mr-Dp
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:05 +0000
Date: Tue, 11 Dec 2012 13:52:05 +0000
Message-Id: <E1TiQFh-0005mr-Dp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] aio: avoid livelock
	behavior for Win32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b022b4a44abda9b6f89777b07e538be6f8f7aacb
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 15:59:43 2012 +0100

    aio: avoid livelock behavior for Win32
    
    The repeated calls to WaitForMultipleObjects may cause a livelock in aio_poll,
    where no progress is made on bottom halves.  This patch matches the behavior
    of the POSIX code.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 aio-win32.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/aio-win32.c b/aio-win32.c
index a84eb71..cec4646 100644
--- a/aio-win32.c
+++ b/aio-win32.c
@@ -173,7 +173,7 @@ bool aio_poll(AioContext *ctx, bool blocking)
     }
 
     /* wait until next event */
-    for (;;) {
+    while (count > 0) {
         int timeout = blocking ? INFINITE : 0;
         int ret = WaitForMultipleObjects(count, events, FALSE, timeout);
 
@@ -209,6 +209,9 @@ bool aio_poll(AioContext *ctx, bool blocking)
                 g_free(tmp);
             }
         }
+
+        /* Try again, but only call each handler once.  */
+        events[ret - WAIT_OBJECT_0] = events[--count];
     }
 
     return progress;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQFr-0003Sq-Qw; Tue, 11 Dec 2012 13:52:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFq-0003SN-I1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:14 +0000
Received: from [85.158.139.83:29376] by server-4.bemta-5.messagelabs.com id
	32/7B-14693-D8A37C05; Tue, 11 Dec 2012 13:52:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1355233926!25479380!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32044 invoked from network); 11 Dec 2012 13:52:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFh-0001R5-Jp
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFh-0005mr-Dp
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:05 +0000
Date: Tue, 11 Dec 2012 13:52:05 +0000
Message-Id: <E1TiQFh-0005mr-Dp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] aio: avoid livelock
	behavior for Win32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b022b4a44abda9b6f89777b07e538be6f8f7aacb
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 15:59:43 2012 +0100

    aio: avoid livelock behavior for Win32
    
    The repeated calls to WaitForMultipleObjects may cause a livelock in aio_poll,
    where no progress is made on bottom halves.  This patch matches the behavior
    of the POSIX code.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 aio-win32.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/aio-win32.c b/aio-win32.c
index a84eb71..cec4646 100644
--- a/aio-win32.c
+++ b/aio-win32.c
@@ -173,7 +173,7 @@ bool aio_poll(AioContext *ctx, bool blocking)
     }
 
     /* wait until next event */
-    for (;;) {
+    while (count > 0) {
         int timeout = blocking ? INFINITE : 0;
         int ret = WaitForMultipleObjects(count, events, FALSE, timeout);
 
@@ -209,6 +209,9 @@ bool aio_poll(AioContext *ctx, bool blocking)
                 g_free(tmp);
             }
         }
+
+        /* Try again, but only call each handler once.  */
+        events[ret - WAIT_OBJECT_0] = events[--count];
     }
 
     return progress;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQG3-0003VY-UF; Tue, 11 Dec 2012 13:52:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQG2-0003VC-L8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:27 +0000
Received: from [85.158.143.35:22647] by server-3.bemta-4.messagelabs.com id
	EC/34-18211-99A37C05; Tue, 11 Dec 2012 13:52:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1355233936!14357815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9946 invoked from network); 11 Dec 2012 13:52:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFr-0001R8-SN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFr-0005nH-Oy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:15 +0000
Date: Tue, 11 Dec 2012 13:52:15 +0000
Message-Id: <E1TiQFr-0005nH-Oy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tests: add AioContext unit
	tests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b2ea25d7aea3106f3cad597be20cf5ab4d87f7ab
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 16:13:23 2012 +0100

    tests: add AioContext unit tests
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 tests/Makefile   |    2 +
 tests/test-aio.c |  667 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 669 insertions(+), 0 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index ca680e5..61cbe3b 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -15,6 +15,7 @@ check-unit-y += tests/test-string-output-visitor$(EXESUF)
 check-unit-y += tests/test-coroutine$(EXESUF)
 check-unit-y += tests/test-visitor-serialization$(EXESUF)
 check-unit-y += tests/test-iov$(EXESUF)
+check-unit-y += tests/test-aio$(EXESUF)
 
 check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 
@@ -49,6 +50,7 @@ tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o
 tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o
 tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) qemu-tool.o
 tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) iov.o libqemustub.a
+tests/test-aio$(EXESUF): tests/test-aio.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a
 tests/test-iov$(EXESUF): tests/test-iov.o iov.o
 
 tests/test-qapi-types.c tests/test-qapi-types.h :\
diff --git a/tests/test-aio.c b/tests/test-aio.c
new file mode 100644
index 0000000..f53c908
--- /dev/null
+++ b/tests/test-aio.c
@@ -0,0 +1,667 @@
+/*
+ * AioContext tests
+ *
+ * Copyright Red Hat, Inc. 2012
+ *
+ * Authors:
+ *  Paolo Bonzini    <pbonzini@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU LGPL, version 2 or later.
+ * See the COPYING.LIB file in the top-level directory.
+ */
+
+#include <glib.h>
+#include "qemu-aio.h"
+
+AioContext *ctx;
+
+/* Simple callbacks for testing.  */
+
+typedef struct {
+    QEMUBH *bh;
+    int n;
+    int max;
+} BHTestData;
+
+static void bh_test_cb(void *opaque)
+{
+    BHTestData *data = opaque;
+    if (++data->n < data->max) {
+        qemu_bh_schedule(data->bh);
+    }
+}
+
+static void bh_delete_cb(void *opaque)
+{
+    BHTestData *data = opaque;
+    if (++data->n < data->max) {
+        qemu_bh_schedule(data->bh);
+    } else {
+        qemu_bh_delete(data->bh);
+        data->bh = NULL;
+    }
+}
+
+typedef struct {
+    EventNotifier e;
+    int n;
+    int active;
+    bool auto_set;
+} EventNotifierTestData;
+
+static int event_active_cb(EventNotifier *e)
+{
+    EventNotifierTestData *data = container_of(e, EventNotifierTestData, e);
+    return data->active > 0;
+}
+
+static void event_ready_cb(EventNotifier *e)
+{
+    EventNotifierTestData *data = container_of(e, EventNotifierTestData, e);
+    g_assert(event_notifier_test_and_clear(e));
+    data->n++;
+    if (data->active > 0) {
+        data->active--;
+    }
+    if (data->auto_set && data->active) {
+        event_notifier_set(e);
+    }
+}
+
+/* Tests using aio_*.  */
+
+static void test_notify(void)
+{
+    g_assert(!aio_poll(ctx, false));
+    aio_notify(ctx);
+    g_assert(!aio_poll(ctx, true));
+    g_assert(!aio_poll(ctx, false));
+}
+
+static void test_flush(void)
+{
+    g_assert(!aio_poll(ctx, false));
+    aio_notify(ctx);
+    aio_flush(ctx);
+    g_assert(!aio_poll(ctx, false));
+}
+
+static void test_bh_schedule(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(aio_poll(ctx, true));
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_bh_schedule10(void)
+{
+    BHTestData data = { .n = 0, .max = 10 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(aio_poll(ctx, true));
+    g_assert_cmpint(data.n, ==, 2);
+
+    aio_flush(ctx);
+    g_assert_cmpint(data.n, ==, 10);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 10);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_bh_cancel(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    qemu_bh_cancel(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_bh_delete(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    qemu_bh_delete(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+}
+
+static void test_bh_delete_from_cb(void)
+{
+    BHTestData data1 = { .n = 0, .max = 1 };
+
+    data1.bh = aio_bh_new(ctx, bh_delete_cb, &data1);
+
+    qemu_bh_schedule(data1.bh);
+    g_assert_cmpint(data1.n, ==, 0);
+
+    aio_flush(ctx);
+    g_assert_cmpint(data1.n, ==, data1.max);
+    g_assert(data1.bh == NULL);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert(!aio_poll(ctx, true));
+}
+
+static void test_bh_delete_from_cb_many(void)
+{
+    BHTestData data1 = { .n = 0, .max = 1 };
+    BHTestData data2 = { .n = 0, .max = 3 };
+    BHTestData data3 = { .n = 0, .max = 2 };
+    BHTestData data4 = { .n = 0, .max = 4 };
+
+    data1.bh = aio_bh_new(ctx, bh_delete_cb, &data1);
+    data2.bh = aio_bh_new(ctx, bh_delete_cb, &data2);
+    data3.bh = aio_bh_new(ctx, bh_delete_cb, &data3);
+    data4.bh = aio_bh_new(ctx, bh_delete_cb, &data4);
+
+    qemu_bh_schedule(data1.bh);
+    qemu_bh_schedule(data2.bh);
+    qemu_bh_schedule(data3.bh);
+    qemu_bh_schedule(data4.bh);
+    g_assert_cmpint(data1.n, ==, 0);
+    g_assert_cmpint(data2.n, ==, 0);
+    g_assert_cmpint(data3.n, ==, 0);
+    g_assert_cmpint(data4.n, ==, 0);
+
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data1.n, ==, 1);
+    g_assert_cmpint(data2.n, ==, 1);
+    g_assert_cmpint(data3.n, ==, 1);
+    g_assert_cmpint(data4.n, ==, 1);
+    g_assert(data1.bh == NULL);
+
+    aio_flush(ctx);
+    g_assert_cmpint(data1.n, ==, data1.max);
+    g_assert_cmpint(data2.n, ==, data2.max);
+    g_assert_cmpint(data3.n, ==, data3.max);
+    g_assert_cmpint(data4.n, ==, data4.max);
+    g_assert(data1.bh == NULL);
+    g_assert(data2.bh == NULL);
+    g_assert(data3.bh == NULL);
+    g_assert(data4.bh == NULL);
+}
+
+static void test_bh_flush(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    aio_flush(ctx);
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_set_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 0 };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_wait_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 1 };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+    g_assert_cmpint(data.active, ==, 1);
+
+    event_notifier_set(&data.e);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 0);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 0);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_flush_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+    g_assert_cmpint(data.active, ==, 10);
+
+    event_notifier_set(&data.e);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 9);
+    g_assert(aio_poll(ctx, false));
+
+    aio_flush(ctx);
+    g_assert_cmpint(data.n, ==, 10);
+    g_assert_cmpint(data.active, ==, 0);
+    g_assert(!aio_poll(ctx, false));
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    g_assert(!aio_poll(ctx, false));
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_wait_event_notifier_noflush(void)
+{
+    EventNotifierTestData data = { .n = 0 };
+    EventNotifierTestData dummy = { .n = 0, .active = 1 };
+
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+
+    /* Until there is an active descriptor, aio_poll may or may not call
+     * event_ready_cb.  Still, it must not block.  */
+    event_notifier_set(&data.e);
+    g_assert(!aio_poll(ctx, true));
+    data.n = 0;
+
+    /* An active event notifier forces aio_poll to look at EventNotifiers.  */
+    event_notifier_init(&dummy.e, false);
+    aio_set_event_notifier(ctx, &dummy.e, event_ready_cb, event_active_cb);
+
+    event_notifier_set(&data.e);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    event_notifier_set(&data.e);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 2);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 2);
+
+    event_notifier_set(&dummy.e);
+    aio_flush(ctx);
+    g_assert_cmpint(data.n, ==, 2);
+    g_assert_cmpint(dummy.n, ==, 1);
+    g_assert_cmpint(dummy.active, ==, 0);
+
+    aio_set_event_notifier(ctx, &dummy.e, NULL, NULL);
+    event_notifier_cleanup(&dummy.e);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 2);
+
+    event_notifier_cleanup(&data.e);
+}
+
+/* Now the same tests, using the context as a GSource.  They are
+ * very similar to the ones above, with g_main_context_iteration
+ * replacing aio_poll.  However:
+ * - sometimes both the AioContext and the glib main loop wake
+ *   themselves up.  Hence, some "g_assert(!aio_poll(ctx, false));"
+ *   are replaced by "while (g_main_context_iteration(NULL, false));".
+ * - there is no exact replacement for aio_flush's blocking wait.
+ *   "while (g_main_context_iteration(NULL, true)" seems to work,
+ *   but it is not documented _why_ it works.  For these tests a
+ *   non-blocking loop like "while (g_main_context_iteration(NULL, false)"
+ *   works well, and that's what I am using.
+ */
+
+static void test_source_notify(void)
+{
+    while (g_main_context_iteration(NULL, false));
+    aio_notify(ctx);
+    g_assert(g_main_context_iteration(NULL, true));
+    g_assert(!g_main_context_iteration(NULL, false));
+}
+
+static void test_source_flush(void)
+{
+    g_assert(!g_main_context_iteration(NULL, false));
+    aio_notify(ctx);
+    while (g_main_context_iteration(NULL, false));
+    g_assert(!g_main_context_iteration(NULL, false));
+}
+
+static void test_source_bh_schedule(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(g_main_context_iteration(NULL, true));
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(!g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_source_bh_schedule10(void)
+{
+    BHTestData data = { .n = 0, .max = 10 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(g_main_context_iteration(NULL, true));
+    g_assert_cmpint(data.n, ==, 2);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 10);
+
+    g_assert(!g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 10);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_source_bh_cancel(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    qemu_bh_cancel(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_source_bh_delete(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    qemu_bh_delete(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+}
+
+static void test_source_bh_delete_from_cb(void)
+{
+    BHTestData data1 = { .n = 0, .max = 1 };
+
+    data1.bh = aio_bh_new(ctx, bh_delete_cb, &data1);
+
+    qemu_bh_schedule(data1.bh);
+    g_assert_cmpint(data1.n, ==, 0);
+
+    g_main_context_iteration(NULL, true);
+    g_assert_cmpint(data1.n, ==, data1.max);
+    g_assert(data1.bh == NULL);
+
+    g_assert(!g_main_context_iteration(NULL, false));
+}
+
+static void test_source_bh_delete_from_cb_many(void)
+{
+    BHTestData data1 = { .n = 0, .max = 1 };
+    BHTestData data2 = { .n = 0, .max = 3 };
+    BHTestData data3 = { .n = 0, .max = 2 };
+    BHTestData data4 = { .n = 0, .max = 4 };
+
+    data1.bh = aio_bh_new(ctx, bh_delete_cb, &data1);
+    data2.bh = aio_bh_new(ctx, bh_delete_cb, &data2);
+    data3.bh = aio_bh_new(ctx, bh_delete_cb, &data3);
+    data4.bh = aio_bh_new(ctx, bh_delete_cb, &data4);
+
+    qemu_bh_schedule(data1.bh);
+    qemu_bh_schedule(data2.bh);
+    qemu_bh_schedule(data3.bh);
+    qemu_bh_schedule(data4.bh);
+    g_assert_cmpint(data1.n, ==, 0);
+    g_assert_cmpint(data2.n, ==, 0);
+    g_assert_cmpint(data3.n, ==, 0);
+    g_assert_cmpint(data4.n, ==, 0);
+
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data1.n, ==, 1);
+    g_assert_cmpint(data2.n, ==, 1);
+    g_assert_cmpint(data3.n, ==, 1);
+    g_assert_cmpint(data4.n, ==, 1);
+    g_assert(data1.bh == NULL);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data1.n, ==, data1.max);
+    g_assert_cmpint(data2.n, ==, data2.max);
+    g_assert_cmpint(data3.n, ==, data3.max);
+    g_assert_cmpint(data4.n, ==, data4.max);
+    g_assert(data1.bh == NULL);
+    g_assert(data2.bh == NULL);
+    g_assert(data3.bh == NULL);
+    g_assert(data4.bh == NULL);
+}
+
+static void test_source_bh_flush(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(g_main_context_iteration(NULL, true));
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(!g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_source_set_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 0 };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_source_wait_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 1 };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+    g_assert_cmpint(data.active, ==, 1);
+
+    event_notifier_set(&data.e);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 0);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 0);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_source_flush_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+    g_assert_cmpint(data.active, ==, 10);
+
+    event_notifier_set(&data.e);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 9);
+    g_assert(g_main_context_iteration(NULL, false));
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 10);
+    g_assert_cmpint(data.active, ==, 0);
+    g_assert(!g_main_context_iteration(NULL, false));
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    while (g_main_context_iteration(NULL, false));
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_source_wait_event_notifier_noflush(void)
+{
+    EventNotifierTestData data = { .n = 0 };
+    EventNotifierTestData dummy = { .n = 0, .active = 1 };
+
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+
+    /* Until there is an active descriptor, glib may or may not call
+     * event_ready_cb.  Still, it must not block.  */
+    event_notifier_set(&data.e);
+    g_main_context_iteration(NULL, true);
+    data.n = 0;
+
+    /* An active event notifier forces aio_poll to look at EventNotifiers.  */
+    event_notifier_init(&dummy.e, false);
+    aio_set_event_notifier(ctx, &dummy.e, event_ready_cb, event_active_cb);
+
+    event_notifier_set(&data.e);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert(!g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    event_notifier_set(&data.e);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 2);
+    g_assert(!g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 2);
+
+    event_notifier_set(&dummy.e);
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 2);
+    g_assert_cmpint(dummy.n, ==, 1);
+    g_assert_cmpint(dummy.active, ==, 0);
+
+    aio_set_event_notifier(ctx, &dummy.e, NULL, NULL);
+    event_notifier_cleanup(&dummy.e);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 2);
+
+    event_notifier_cleanup(&data.e);
+}
+
+/* End of tests.  */
+
+int main(int argc, char **argv)
+{
+    GSource *src;
+
+    ctx = aio_context_new();
+    src = aio_get_g_source(ctx);
+    g_source_attach(src, NULL);
+    g_source_unref(src);
+
+    while (g_main_context_iteration(NULL, false));
+
+    g_test_init(&argc, &argv, NULL);
+    g_test_add_func("/aio/notify",                  test_notify);
+    g_test_add_func("/aio/flush",                   test_flush);
+    g_test_add_func("/aio/bh/schedule",             test_bh_schedule);
+    g_test_add_func("/aio/bh/schedule10",           test_bh_schedule10);
+    g_test_add_func("/aio/bh/cancel",               test_bh_cancel);
+    g_test_add_func("/aio/bh/delete",               test_bh_delete);
+    g_test_add_func("/aio/bh/callback-delete/one",  test_bh_delete_from_cb);
+    g_test_add_func("/aio/bh/callback-delete/many", test_bh_delete_from_cb_many);
+    g_test_add_func("/aio/bh/flush",                test_bh_flush);
+    g_test_add_func("/aio/event/add-remove",        test_set_event_notifier);
+    g_test_add_func("/aio/event/wait",              test_wait_event_notifier);
+    g_test_add_func("/aio/event/wait/no-flush-cb",  test_wait_event_notifier_noflush);
+    g_test_add_func("/aio/event/flush",             test_flush_event_notifier);
+
+    g_test_add_func("/aio-gsource/notify",                  test_source_notify);
+    g_test_add_func("/aio-gsource/flush",                   test_source_flush);
+    g_test_add_func("/aio-gsource/bh/schedule",             test_source_bh_schedule);
+    g_test_add_func("/aio-gsource/bh/schedule10",           test_source_bh_schedule10);
+    g_test_add_func("/aio-gsource/bh/cancel",               test_source_bh_cancel);
+    g_test_add_func("/aio-gsource/bh/delete",               test_source_bh_delete);
+    g_test_add_func("/aio-gsource/bh/callback-delete/one",  test_source_bh_delete_from_cb);
+    g_test_add_func("/aio-gsource/bh/callback-delete/many", test_source_bh_delete_from_cb_many);
+    g_test_add_func("/aio-gsource/bh/flush",                test_source_bh_flush);
+    g_test_add_func("/aio-gsource/event/add-remove",        test_source_set_event_notifier);
+    g_test_add_func("/aio-gsource/event/wait",              test_source_wait_event_notifier);
+    g_test_add_func("/aio-gsource/event/wait/no-flush-cb",  test_source_wait_event_notifier_noflush);
+    g_test_add_func("/aio-gsource/event/flush",             test_source_flush_event_notifier);
+    return g_test_run();
+}
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQG3-0003VY-UF; Tue, 11 Dec 2012 13:52:27 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQG2-0003VC-L8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:27 +0000
Received: from [85.158.143.35:22647] by server-3.bemta-4.messagelabs.com id
	EC/34-18211-99A37C05; Tue, 11 Dec 2012 13:52:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1355233936!14357815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9946 invoked from network); 11 Dec 2012 13:52:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFr-0001R8-SN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQFr-0005nH-Oy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:15 +0000
Date: Tue, 11 Dec 2012 13:52:15 +0000
Message-Id: <E1TiQFr-0005nH-Oy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tests: add AioContext unit
	tests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b2ea25d7aea3106f3cad597be20cf5ab4d87f7ab
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 16:13:23 2012 +0100

    tests: add AioContext unit tests
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 tests/Makefile   |    2 +
 tests/test-aio.c |  667 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 669 insertions(+), 0 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index ca680e5..61cbe3b 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -15,6 +15,7 @@ check-unit-y += tests/test-string-output-visitor$(EXESUF)
 check-unit-y += tests/test-coroutine$(EXESUF)
 check-unit-y += tests/test-visitor-serialization$(EXESUF)
 check-unit-y += tests/test-iov$(EXESUF)
+check-unit-y += tests/test-aio$(EXESUF)
 
 check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 
@@ -49,6 +50,7 @@ tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o
 tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o
 tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) qemu-tool.o
 tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) iov.o libqemustub.a
+tests/test-aio$(EXESUF): tests/test-aio.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a
 tests/test-iov$(EXESUF): tests/test-iov.o iov.o
 
 tests/test-qapi-types.c tests/test-qapi-types.h :\
diff --git a/tests/test-aio.c b/tests/test-aio.c
new file mode 100644
index 0000000..f53c908
--- /dev/null
+++ b/tests/test-aio.c
@@ -0,0 +1,667 @@
+/*
+ * AioContext tests
+ *
+ * Copyright Red Hat, Inc. 2012
+ *
+ * Authors:
+ *  Paolo Bonzini    <pbonzini@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU LGPL, version 2 or later.
+ * See the COPYING.LIB file in the top-level directory.
+ */
+
+#include <glib.h>
+#include "qemu-aio.h"
+
+AioContext *ctx;
+
+/* Simple callbacks for testing.  */
+
+typedef struct {
+    QEMUBH *bh;
+    int n;
+    int max;
+} BHTestData;
+
+static void bh_test_cb(void *opaque)
+{
+    BHTestData *data = opaque;
+    if (++data->n < data->max) {
+        qemu_bh_schedule(data->bh);
+    }
+}
+
+static void bh_delete_cb(void *opaque)
+{
+    BHTestData *data = opaque;
+    if (++data->n < data->max) {
+        qemu_bh_schedule(data->bh);
+    } else {
+        qemu_bh_delete(data->bh);
+        data->bh = NULL;
+    }
+}
+
+typedef struct {
+    EventNotifier e;
+    int n;
+    int active;
+    bool auto_set;
+} EventNotifierTestData;
+
+static int event_active_cb(EventNotifier *e)
+{
+    EventNotifierTestData *data = container_of(e, EventNotifierTestData, e);
+    return data->active > 0;
+}
+
+static void event_ready_cb(EventNotifier *e)
+{
+    EventNotifierTestData *data = container_of(e, EventNotifierTestData, e);
+    g_assert(event_notifier_test_and_clear(e));
+    data->n++;
+    if (data->active > 0) {
+        data->active--;
+    }
+    if (data->auto_set && data->active) {
+        event_notifier_set(e);
+    }
+}
+
+/* Tests using aio_*.  */
+
+static void test_notify(void)
+{
+    g_assert(!aio_poll(ctx, false));
+    aio_notify(ctx);
+    g_assert(!aio_poll(ctx, true));
+    g_assert(!aio_poll(ctx, false));
+}
+
+static void test_flush(void)
+{
+    g_assert(!aio_poll(ctx, false));
+    aio_notify(ctx);
+    aio_flush(ctx);
+    g_assert(!aio_poll(ctx, false));
+}
+
+static void test_bh_schedule(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(aio_poll(ctx, true));
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_bh_schedule10(void)
+{
+    BHTestData data = { .n = 0, .max = 10 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(aio_poll(ctx, true));
+    g_assert_cmpint(data.n, ==, 2);
+
+    aio_flush(ctx);
+    g_assert_cmpint(data.n, ==, 10);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 10);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_bh_cancel(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    qemu_bh_cancel(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_bh_delete(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    qemu_bh_delete(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+}
+
+static void test_bh_delete_from_cb(void)
+{
+    BHTestData data1 = { .n = 0, .max = 1 };
+
+    data1.bh = aio_bh_new(ctx, bh_delete_cb, &data1);
+
+    qemu_bh_schedule(data1.bh);
+    g_assert_cmpint(data1.n, ==, 0);
+
+    aio_flush(ctx);
+    g_assert_cmpint(data1.n, ==, data1.max);
+    g_assert(data1.bh == NULL);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert(!aio_poll(ctx, true));
+}
+
+static void test_bh_delete_from_cb_many(void)
+{
+    BHTestData data1 = { .n = 0, .max = 1 };
+    BHTestData data2 = { .n = 0, .max = 3 };
+    BHTestData data3 = { .n = 0, .max = 2 };
+    BHTestData data4 = { .n = 0, .max = 4 };
+
+    data1.bh = aio_bh_new(ctx, bh_delete_cb, &data1);
+    data2.bh = aio_bh_new(ctx, bh_delete_cb, &data2);
+    data3.bh = aio_bh_new(ctx, bh_delete_cb, &data3);
+    data4.bh = aio_bh_new(ctx, bh_delete_cb, &data4);
+
+    qemu_bh_schedule(data1.bh);
+    qemu_bh_schedule(data2.bh);
+    qemu_bh_schedule(data3.bh);
+    qemu_bh_schedule(data4.bh);
+    g_assert_cmpint(data1.n, ==, 0);
+    g_assert_cmpint(data2.n, ==, 0);
+    g_assert_cmpint(data3.n, ==, 0);
+    g_assert_cmpint(data4.n, ==, 0);
+
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data1.n, ==, 1);
+    g_assert_cmpint(data2.n, ==, 1);
+    g_assert_cmpint(data3.n, ==, 1);
+    g_assert_cmpint(data4.n, ==, 1);
+    g_assert(data1.bh == NULL);
+
+    aio_flush(ctx);
+    g_assert_cmpint(data1.n, ==, data1.max);
+    g_assert_cmpint(data2.n, ==, data2.max);
+    g_assert_cmpint(data3.n, ==, data3.max);
+    g_assert_cmpint(data4.n, ==, data4.max);
+    g_assert(data1.bh == NULL);
+    g_assert(data2.bh == NULL);
+    g_assert(data3.bh == NULL);
+    g_assert(data4.bh == NULL);
+}
+
+static void test_bh_flush(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    aio_flush(ctx);
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_set_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 0 };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_wait_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 1 };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+    g_assert_cmpint(data.active, ==, 1);
+
+    event_notifier_set(&data.e);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 0);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 0);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_flush_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+    g_assert_cmpint(data.active, ==, 10);
+
+    event_notifier_set(&data.e);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 9);
+    g_assert(aio_poll(ctx, false));
+
+    aio_flush(ctx);
+    g_assert_cmpint(data.n, ==, 10);
+    g_assert_cmpint(data.active, ==, 0);
+    g_assert(!aio_poll(ctx, false));
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    g_assert(!aio_poll(ctx, false));
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_wait_event_notifier_noflush(void)
+{
+    EventNotifierTestData data = { .n = 0 };
+    EventNotifierTestData dummy = { .n = 0, .active = 1 };
+
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL);
+
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 0);
+
+    /* Until there is an active descriptor, aio_poll may or may not call
+     * event_ready_cb.  Still, it must not block.  */
+    event_notifier_set(&data.e);
+    g_assert(!aio_poll(ctx, true));
+    data.n = 0;
+
+    /* An active event notifier forces aio_poll to look at EventNotifiers.  */
+    event_notifier_init(&dummy.e, false);
+    aio_set_event_notifier(ctx, &dummy.e, event_ready_cb, event_active_cb);
+
+    event_notifier_set(&data.e);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    event_notifier_set(&data.e);
+    g_assert(aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 2);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 2);
+
+    event_notifier_set(&dummy.e);
+    aio_flush(ctx);
+    g_assert_cmpint(data.n, ==, 2);
+    g_assert_cmpint(dummy.n, ==, 1);
+    g_assert_cmpint(dummy.active, ==, 0);
+
+    aio_set_event_notifier(ctx, &dummy.e, NULL, NULL);
+    event_notifier_cleanup(&dummy.e);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    g_assert(!aio_poll(ctx, false));
+    g_assert_cmpint(data.n, ==, 2);
+
+    event_notifier_cleanup(&data.e);
+}
+
+/* Now the same tests, using the context as a GSource.  They are
+ * very similar to the ones above, with g_main_context_iteration
+ * replacing aio_poll.  However:
+ * - sometimes both the AioContext and the glib main loop wake
+ *   themselves up.  Hence, some "g_assert(!aio_poll(ctx, false));"
+ *   are replaced by "while (g_main_context_iteration(NULL, false));".
+ * - there is no exact replacement for aio_flush's blocking wait.
+ *   "while (g_main_context_iteration(NULL, true)" seems to work,
+ *   but it is not documented _why_ it works.  For these tests a
+ *   non-blocking loop like "while (g_main_context_iteration(NULL, false)"
+ *   works well, and that's what I am using.
+ */
+
+static void test_source_notify(void)
+{
+    while (g_main_context_iteration(NULL, false));
+    aio_notify(ctx);
+    g_assert(g_main_context_iteration(NULL, true));
+    g_assert(!g_main_context_iteration(NULL, false));
+}
+
+static void test_source_flush(void)
+{
+    g_assert(!g_main_context_iteration(NULL, false));
+    aio_notify(ctx);
+    while (g_main_context_iteration(NULL, false));
+    g_assert(!g_main_context_iteration(NULL, false));
+}
+
+static void test_source_bh_schedule(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(g_main_context_iteration(NULL, true));
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(!g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_source_bh_schedule10(void)
+{
+    BHTestData data = { .n = 0, .max = 10 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(g_main_context_iteration(NULL, true));
+    g_assert_cmpint(data.n, ==, 2);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 10);
+
+    g_assert(!g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 10);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_source_bh_cancel(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    qemu_bh_cancel(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_source_bh_delete(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    qemu_bh_delete(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+}
+
+static void test_source_bh_delete_from_cb(void)
+{
+    BHTestData data1 = { .n = 0, .max = 1 };
+
+    data1.bh = aio_bh_new(ctx, bh_delete_cb, &data1);
+
+    qemu_bh_schedule(data1.bh);
+    g_assert_cmpint(data1.n, ==, 0);
+
+    g_main_context_iteration(NULL, true);
+    g_assert_cmpint(data1.n, ==, data1.max);
+    g_assert(data1.bh == NULL);
+
+    g_assert(!g_main_context_iteration(NULL, false));
+}
+
+static void test_source_bh_delete_from_cb_many(void)
+{
+    BHTestData data1 = { .n = 0, .max = 1 };
+    BHTestData data2 = { .n = 0, .max = 3 };
+    BHTestData data3 = { .n = 0, .max = 2 };
+    BHTestData data4 = { .n = 0, .max = 4 };
+
+    data1.bh = aio_bh_new(ctx, bh_delete_cb, &data1);
+    data2.bh = aio_bh_new(ctx, bh_delete_cb, &data2);
+    data3.bh = aio_bh_new(ctx, bh_delete_cb, &data3);
+    data4.bh = aio_bh_new(ctx, bh_delete_cb, &data4);
+
+    qemu_bh_schedule(data1.bh);
+    qemu_bh_schedule(data2.bh);
+    qemu_bh_schedule(data3.bh);
+    qemu_bh_schedule(data4.bh);
+    g_assert_cmpint(data1.n, ==, 0);
+    g_assert_cmpint(data2.n, ==, 0);
+    g_assert_cmpint(data3.n, ==, 0);
+    g_assert_cmpint(data4.n, ==, 0);
+
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data1.n, ==, 1);
+    g_assert_cmpint(data2.n, ==, 1);
+    g_assert_cmpint(data3.n, ==, 1);
+    g_assert_cmpint(data4.n, ==, 1);
+    g_assert(data1.bh == NULL);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data1.n, ==, data1.max);
+    g_assert_cmpint(data2.n, ==, data2.max);
+    g_assert_cmpint(data3.n, ==, data3.max);
+    g_assert_cmpint(data4.n, ==, data4.max);
+    g_assert(data1.bh == NULL);
+    g_assert(data2.bh == NULL);
+    g_assert(data3.bh == NULL);
+    g_assert(data4.bh == NULL);
+}
+
+static void test_source_bh_flush(void)
+{
+    BHTestData data = { .n = 0 };
+    data.bh = aio_bh_new(ctx, bh_test_cb, &data);
+
+    qemu_bh_schedule(data.bh);
+    g_assert_cmpint(data.n, ==, 0);
+
+    g_assert(g_main_context_iteration(NULL, true));
+    g_assert_cmpint(data.n, ==, 1);
+
+    g_assert(!g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    qemu_bh_delete(data.bh);
+}
+
+static void test_source_set_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 0 };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_source_wait_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 1 };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+    g_assert_cmpint(data.active, ==, 1);
+
+    event_notifier_set(&data.e);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 0);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 0);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_source_flush_event_notifier(void)
+{
+    EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true };
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, event_active_cb);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+    g_assert_cmpint(data.active, ==, 10);
+
+    event_notifier_set(&data.e);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.active, ==, 9);
+    g_assert(g_main_context_iteration(NULL, false));
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 10);
+    g_assert_cmpint(data.active, ==, 0);
+    g_assert(!g_main_context_iteration(NULL, false));
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    while (g_main_context_iteration(NULL, false));
+    event_notifier_cleanup(&data.e);
+}
+
+static void test_source_wait_event_notifier_noflush(void)
+{
+    EventNotifierTestData data = { .n = 0 };
+    EventNotifierTestData dummy = { .n = 0, .active = 1 };
+
+    event_notifier_init(&data.e, false);
+    aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL);
+
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 0);
+
+    /* Until there is an active descriptor, glib may or may not call
+     * event_ready_cb.  Still, it must not block.  */
+    event_notifier_set(&data.e);
+    g_main_context_iteration(NULL, true);
+    data.n = 0;
+
+    /* An active event notifier forces aio_poll to look at EventNotifiers.  */
+    event_notifier_init(&dummy.e, false);
+    aio_set_event_notifier(ctx, &dummy.e, event_ready_cb, event_active_cb);
+
+    event_notifier_set(&data.e);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert(!g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 1);
+
+    event_notifier_set(&data.e);
+    g_assert(g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 2);
+    g_assert(!g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 2);
+
+    event_notifier_set(&dummy.e);
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 2);
+    g_assert_cmpint(dummy.n, ==, 1);
+    g_assert_cmpint(dummy.active, ==, 0);
+
+    aio_set_event_notifier(ctx, &dummy.e, NULL, NULL);
+    event_notifier_cleanup(&dummy.e);
+
+    aio_set_event_notifier(ctx, &data.e, NULL, NULL);
+    while (g_main_context_iteration(NULL, false));
+    g_assert_cmpint(data.n, ==, 2);
+
+    event_notifier_cleanup(&data.e);
+}
+
+/* End of tests.  */
+
+int main(int argc, char **argv)
+{
+    GSource *src;
+
+    ctx = aio_context_new();
+    src = aio_get_g_source(ctx);
+    g_source_attach(src, NULL);
+    g_source_unref(src);
+
+    while (g_main_context_iteration(NULL, false));
+
+    g_test_init(&argc, &argv, NULL);
+    g_test_add_func("/aio/notify",                  test_notify);
+    g_test_add_func("/aio/flush",                   test_flush);
+    g_test_add_func("/aio/bh/schedule",             test_bh_schedule);
+    g_test_add_func("/aio/bh/schedule10",           test_bh_schedule10);
+    g_test_add_func("/aio/bh/cancel",               test_bh_cancel);
+    g_test_add_func("/aio/bh/delete",               test_bh_delete);
+    g_test_add_func("/aio/bh/callback-delete/one",  test_bh_delete_from_cb);
+    g_test_add_func("/aio/bh/callback-delete/many", test_bh_delete_from_cb_many);
+    g_test_add_func("/aio/bh/flush",                test_bh_flush);
+    g_test_add_func("/aio/event/add-remove",        test_set_event_notifier);
+    g_test_add_func("/aio/event/wait",              test_wait_event_notifier);
+    g_test_add_func("/aio/event/wait/no-flush-cb",  test_wait_event_notifier_noflush);
+    g_test_add_func("/aio/event/flush",             test_flush_event_notifier);
+
+    g_test_add_func("/aio-gsource/notify",                  test_source_notify);
+    g_test_add_func("/aio-gsource/flush",                   test_source_flush);
+    g_test_add_func("/aio-gsource/bh/schedule",             test_source_bh_schedule);
+    g_test_add_func("/aio-gsource/bh/schedule10",           test_source_bh_schedule10);
+    g_test_add_func("/aio-gsource/bh/cancel",               test_source_bh_cancel);
+    g_test_add_func("/aio-gsource/bh/delete",               test_source_bh_delete);
+    g_test_add_func("/aio-gsource/bh/callback-delete/one",  test_source_bh_delete_from_cb);
+    g_test_add_func("/aio-gsource/bh/callback-delete/many", test_source_bh_delete_from_cb_many);
+    g_test_add_func("/aio-gsource/bh/flush",                test_source_bh_flush);
+    g_test_add_func("/aio-gsource/event/add-remove",        test_source_set_event_notifier);
+    g_test_add_func("/aio-gsource/event/wait",              test_source_wait_event_notifier);
+    g_test_add_func("/aio-gsource/event/wait/no-flush-cb",  test_source_wait_event_notifier_noflush);
+    g_test_add_func("/aio-gsource/event/flush",             test_source_flush_event_notifier);
+    return g_test_run();
+}
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQG7-0003Wf-2q; Tue, 11 Dec 2012 13:52:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQG6-0003WO-6L
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:30 +0000
Received: from [85.158.138.51:10065] by server-4.bemta-3.messagelabs.com id
	A9/30-31835-C9A37C05; Tue, 11 Dec 2012 13:52:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1355233946!20476365!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16520 invoked from network); 11 Dec 2012 13:52:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQG2-0001RB-2y
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQG2-0005nd-0v
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:26 +0000
Date: Tue, 11 Dec 2012 13:52:26 +0000
Message-Id: <E1TiQG2-0005nd-0v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tests: add thread pool
	unit tests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 74c856e9228445bac1624f6aad83422bdbc59f98
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 16:13:24 2012 +0100

    tests: add thread pool unit tests
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 tests/Makefile           |    2 +
 tests/test-thread-pool.c |  213 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 215 insertions(+), 0 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index 61cbe3b..b60f0fb 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -16,6 +16,7 @@ check-unit-y += tests/test-coroutine$(EXESUF)
 check-unit-y += tests/test-visitor-serialization$(EXESUF)
 check-unit-y += tests/test-iov$(EXESUF)
 check-unit-y += tests/test-aio$(EXESUF)
+check-unit-y += tests/test-thread-pool$(EXESUF)
 
 check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 
@@ -51,6 +52,7 @@ tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o
 tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) qemu-tool.o
 tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) iov.o libqemustub.a
 tests/test-aio$(EXESUF): tests/test-aio.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a
+tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a
 tests/test-iov$(EXESUF): tests/test-iov.o iov.o
 
 tests/test-qapi-types.c tests/test-qapi-types.h :\
diff --git a/tests/test-thread-pool.c b/tests/test-thread-pool.c
new file mode 100644
index 0000000..484c5b3
--- /dev/null
+++ b/tests/test-thread-pool.c
@@ -0,0 +1,213 @@
+#include <glib.h>
+#include "qemu-common.h"
+#include "qemu-aio.h"
+#include "thread-pool.h"
+#include "block.h"
+
+static int active;
+
+typedef struct {
+    BlockDriverAIOCB *aiocb;
+    int n;
+    int ret;
+} WorkerTestData;
+
+static int worker_cb(void *opaque)
+{
+    WorkerTestData *data = opaque;
+    return __sync_fetch_and_add(&data->n, 1);
+}
+
+static int long_cb(void *opaque)
+{
+    WorkerTestData *data = opaque;
+    __sync_fetch_and_add(&data->n, 1);
+    g_usleep(2000000);
+    __sync_fetch_and_add(&data->n, 1);
+    return 0;
+}
+
+static void done_cb(void *opaque, int ret)
+{
+    WorkerTestData *data = opaque;
+    g_assert_cmpint(data->ret, ==, -EINPROGRESS);
+    data->ret = ret;
+    data->aiocb = NULL;
+
+    /* Callbacks are serialized, so no need to use atomic ops.  */
+    active--;
+}
+
+/* A non-blocking poll of the main AIO context (we cannot use aio_poll
+ * because we do not know the AioContext).
+ */
+static void qemu_aio_wait_nonblocking(void)
+{
+    qemu_notify_event();
+    qemu_aio_wait();
+}
+
+static void test_submit(void)
+{
+    WorkerTestData data = { .n = 0 };
+    thread_pool_submit(worker_cb, &data);
+    qemu_aio_flush();
+    g_assert_cmpint(data.n, ==, 1);
+}
+
+static void test_submit_aio(void)
+{
+    WorkerTestData data = { .n = 0, .ret = -EINPROGRESS };
+    data.aiocb = thread_pool_submit_aio(worker_cb, &data, done_cb, &data);
+
+    /* The callbacks are not called until after the first wait.  */
+    active = 1;
+    g_assert_cmpint(data.ret, ==, -EINPROGRESS);
+    qemu_aio_flush();
+    g_assert_cmpint(active, ==, 0);
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.ret, ==, 0);
+}
+
+static void co_test_cb(void *opaque)
+{
+    WorkerTestData *data = opaque;
+
+    active = 1;
+    data->n = 0;
+    data->ret = -EINPROGRESS;
+    thread_pool_submit_co(worker_cb, data);
+
+    /* The test continues in test_submit_co, after qemu_coroutine_enter... */
+
+    g_assert_cmpint(data->n, ==, 1);
+    data->ret = 0;
+    active--;
+
+    /* The test continues in test_submit_co, after qemu_aio_flush... */
+}
+
+static void test_submit_co(void)
+{
+    WorkerTestData data;
+    Coroutine *co = qemu_coroutine_create(co_test_cb);
+
+    qemu_coroutine_enter(co, &data);
+
+    /* Back here once the worker has started.  */
+
+    g_assert_cmpint(active, ==, 1);
+    g_assert_cmpint(data.ret, ==, -EINPROGRESS);
+
+    /* qemu_aio_flush will execute the rest of the coroutine.  */
+
+    qemu_aio_flush();
+
+    /* Back here after the coroutine has finished.  */
+
+    g_assert_cmpint(active, ==, 0);
+    g_assert_cmpint(data.ret, ==, 0);
+}
+
+static void test_submit_many(void)
+{
+    WorkerTestData data[100];
+    int i;
+
+    /* Start more work items than there will be threads.  */
+    for (i = 0; i < 100; i++) {
+        data[i].n = 0;
+        data[i].ret = -EINPROGRESS;
+        thread_pool_submit_aio(worker_cb, &data[i], done_cb, &data[i]);
+    }
+
+    active = 100;
+    while (active > 0) {
+        qemu_aio_wait();
+    }
+    for (i = 0; i < 100; i++) {
+        g_assert_cmpint(data[i].n, ==, 1);
+        g_assert_cmpint(data[i].ret, ==, 0);
+    }
+}
+
+static void test_cancel(void)
+{
+    WorkerTestData data[100];
+    int i;
+
+    /* Start more work items than there will be threads, to ensure
+     * the pool is full.
+     */
+    test_submit_many();
+
+    /* Start long running jobs, to ensure we can cancel some.  */
+    for (i = 0; i < 100; i++) {
+        data[i].n = 0;
+        data[i].ret = -EINPROGRESS;
+        data[i].aiocb = thread_pool_submit_aio(long_cb, &data[i],
+                                               done_cb, &data[i]);
+    }
+
+    /* Starting the threads may be left to a bottom half.  Let it
+     * run, but do not waste too much time...
+     */
+    active = 100;
+    qemu_aio_wait_nonblocking();
+
+    /* Wait some time for the threads to start, with some sanity
+     * testing on the behavior of the scheduler...
+     */
+    g_assert_cmpint(active, ==, 100);
+    g_usleep(1000000);
+    g_assert_cmpint(active, >, 50);
+
+    /* Cancel the jobs that haven't been started yet.  */
+    for (i = 0; i < 100; i++) {
+        if (__sync_val_compare_and_swap(&data[i].n, 0, 3) == 0) {
+            data[i].ret = -ECANCELED;
+            bdrv_aio_cancel(data[i].aiocb);
+            active--;
+        }
+    }
+    g_assert_cmpint(active, >, 5);
+    g_assert_cmpint(active, <, 95);
+
+    /* Canceling the others will be a blocking operation.  */
+    for (i = 0; i < 100; i++) {
+        if (data[i].n != 3) {
+            bdrv_aio_cancel(data[i].aiocb);
+        }
+    }
+
+    /* Finish execution and execute any remaining callbacks.  */
+    qemu_aio_flush();
+    g_assert_cmpint(active, ==, 0);
+    for (i = 0; i < 100; i++) {
+        if (data[i].n == 3) {
+            g_assert_cmpint(data[i].ret, ==, -ECANCELED);
+            g_assert(data[i].aiocb != NULL);
+        } else {
+            g_assert_cmpint(data[i].n, ==, 2);
+            g_assert_cmpint(data[i].ret, ==, 0);
+            g_assert(data[i].aiocb == NULL);
+        }
+    }
+}
+
+int main(int argc, char **argv)
+{
+    /* These should be removed once each AioContext has its thread pool.
+     * The test should create its own AioContext.
+     */
+    qemu_init_main_loop();
+    bdrv_init();
+
+    g_test_init(&argc, &argv, NULL);
+    g_test_add_func("/thread-pool/submit", test_submit);
+    g_test_add_func("/thread-pool/submit-aio", test_submit_aio);
+    g_test_add_func("/thread-pool/submit-co", test_submit_co);
+    g_test_add_func("/thread-pool/submit-many", test_submit_many);
+    g_test_add_func("/thread-pool/cancel", test_cancel);
+    return g_test_run();
+}
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQG7-0003Wf-2q; Tue, 11 Dec 2012 13:52:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQG6-0003WO-6L
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:30 +0000
Received: from [85.158.138.51:10065] by server-4.bemta-3.messagelabs.com id
	A9/30-31835-C9A37C05; Tue, 11 Dec 2012 13:52:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-174.messagelabs.com!1355233946!20476365!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16520 invoked from network); 11 Dec 2012 13:52:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQG2-0001RB-2y
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQG2-0005nd-0v
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:26 +0000
Date: Tue, 11 Dec 2012 13:52:26 +0000
Message-Id: <E1TiQG2-0005nd-0v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tests: add thread pool
	unit tests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 74c856e9228445bac1624f6aad83422bdbc59f98
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 16:13:24 2012 +0100

    tests: add thread pool unit tests
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 tests/Makefile           |    2 +
 tests/test-thread-pool.c |  213 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 215 insertions(+), 0 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index 61cbe3b..b60f0fb 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -16,6 +16,7 @@ check-unit-y += tests/test-coroutine$(EXESUF)
 check-unit-y += tests/test-visitor-serialization$(EXESUF)
 check-unit-y += tests/test-iov$(EXESUF)
 check-unit-y += tests/test-aio$(EXESUF)
+check-unit-y += tests/test-thread-pool$(EXESUF)
 
 check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
 
@@ -51,6 +52,7 @@ tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o
 tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) qemu-tool.o
 tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) iov.o libqemustub.a
 tests/test-aio$(EXESUF): tests/test-aio.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a
+tests/test-thread-pool$(EXESUF): tests/test-thread-pool.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) libqemustub.a
 tests/test-iov$(EXESUF): tests/test-iov.o iov.o
 
 tests/test-qapi-types.c tests/test-qapi-types.h :\
diff --git a/tests/test-thread-pool.c b/tests/test-thread-pool.c
new file mode 100644
index 0000000..484c5b3
--- /dev/null
+++ b/tests/test-thread-pool.c
@@ -0,0 +1,213 @@
+#include <glib.h>
+#include "qemu-common.h"
+#include "qemu-aio.h"
+#include "thread-pool.h"
+#include "block.h"
+
+static int active;
+
+typedef struct {
+    BlockDriverAIOCB *aiocb;
+    int n;
+    int ret;
+} WorkerTestData;
+
+static int worker_cb(void *opaque)
+{
+    WorkerTestData *data = opaque;
+    return __sync_fetch_and_add(&data->n, 1);
+}
+
+static int long_cb(void *opaque)
+{
+    WorkerTestData *data = opaque;
+    __sync_fetch_and_add(&data->n, 1);
+    g_usleep(2000000);
+    __sync_fetch_and_add(&data->n, 1);
+    return 0;
+}
+
+static void done_cb(void *opaque, int ret)
+{
+    WorkerTestData *data = opaque;
+    g_assert_cmpint(data->ret, ==, -EINPROGRESS);
+    data->ret = ret;
+    data->aiocb = NULL;
+
+    /* Callbacks are serialized, so no need to use atomic ops.  */
+    active--;
+}
+
+/* A non-blocking poll of the main AIO context (we cannot use aio_poll
+ * because we do not know the AioContext).
+ */
+static void qemu_aio_wait_nonblocking(void)
+{
+    qemu_notify_event();
+    qemu_aio_wait();
+}
+
+static void test_submit(void)
+{
+    WorkerTestData data = { .n = 0 };
+    thread_pool_submit(worker_cb, &data);
+    qemu_aio_flush();
+    g_assert_cmpint(data.n, ==, 1);
+}
+
+static void test_submit_aio(void)
+{
+    WorkerTestData data = { .n = 0, .ret = -EINPROGRESS };
+    data.aiocb = thread_pool_submit_aio(worker_cb, &data, done_cb, &data);
+
+    /* The callbacks are not called until after the first wait.  */
+    active = 1;
+    g_assert_cmpint(data.ret, ==, -EINPROGRESS);
+    qemu_aio_flush();
+    g_assert_cmpint(active, ==, 0);
+    g_assert_cmpint(data.n, ==, 1);
+    g_assert_cmpint(data.ret, ==, 0);
+}
+
+static void co_test_cb(void *opaque)
+{
+    WorkerTestData *data = opaque;
+
+    active = 1;
+    data->n = 0;
+    data->ret = -EINPROGRESS;
+    thread_pool_submit_co(worker_cb, data);
+
+    /* The test continues in test_submit_co, after qemu_coroutine_enter... */
+
+    g_assert_cmpint(data->n, ==, 1);
+    data->ret = 0;
+    active--;
+
+    /* The test continues in test_submit_co, after qemu_aio_flush... */
+}
+
+static void test_submit_co(void)
+{
+    WorkerTestData data;
+    Coroutine *co = qemu_coroutine_create(co_test_cb);
+
+    qemu_coroutine_enter(co, &data);
+
+    /* Back here once the worker has started.  */
+
+    g_assert_cmpint(active, ==, 1);
+    g_assert_cmpint(data.ret, ==, -EINPROGRESS);
+
+    /* qemu_aio_flush will execute the rest of the coroutine.  */
+
+    qemu_aio_flush();
+
+    /* Back here after the coroutine has finished.  */
+
+    g_assert_cmpint(active, ==, 0);
+    g_assert_cmpint(data.ret, ==, 0);
+}
+
+static void test_submit_many(void)
+{
+    WorkerTestData data[100];
+    int i;
+
+    /* Start more work items than there will be threads.  */
+    for (i = 0; i < 100; i++) {
+        data[i].n = 0;
+        data[i].ret = -EINPROGRESS;
+        thread_pool_submit_aio(worker_cb, &data[i], done_cb, &data[i]);
+    }
+
+    active = 100;
+    while (active > 0) {
+        qemu_aio_wait();
+    }
+    for (i = 0; i < 100; i++) {
+        g_assert_cmpint(data[i].n, ==, 1);
+        g_assert_cmpint(data[i].ret, ==, 0);
+    }
+}
+
+static void test_cancel(void)
+{
+    WorkerTestData data[100];
+    int i;
+
+    /* Start more work items than there will be threads, to ensure
+     * the pool is full.
+     */
+    test_submit_many();
+
+    /* Start long running jobs, to ensure we can cancel some.  */
+    for (i = 0; i < 100; i++) {
+        data[i].n = 0;
+        data[i].ret = -EINPROGRESS;
+        data[i].aiocb = thread_pool_submit_aio(long_cb, &data[i],
+                                               done_cb, &data[i]);
+    }
+
+    /* Starting the threads may be left to a bottom half.  Let it
+     * run, but do not waste too much time...
+     */
+    active = 100;
+    qemu_aio_wait_nonblocking();
+
+    /* Wait some time for the threads to start, with some sanity
+     * testing on the behavior of the scheduler...
+     */
+    g_assert_cmpint(active, ==, 100);
+    g_usleep(1000000);
+    g_assert_cmpint(active, >, 50);
+
+    /* Cancel the jobs that haven't been started yet.  */
+    for (i = 0; i < 100; i++) {
+        if (__sync_val_compare_and_swap(&data[i].n, 0, 3) == 0) {
+            data[i].ret = -ECANCELED;
+            bdrv_aio_cancel(data[i].aiocb);
+            active--;
+        }
+    }
+    g_assert_cmpint(active, >, 5);
+    g_assert_cmpint(active, <, 95);
+
+    /* Canceling the others will be a blocking operation.  */
+    for (i = 0; i < 100; i++) {
+        if (data[i].n != 3) {
+            bdrv_aio_cancel(data[i].aiocb);
+        }
+    }
+
+    /* Finish execution and execute any remaining callbacks.  */
+    qemu_aio_flush();
+    g_assert_cmpint(active, ==, 0);
+    for (i = 0; i < 100; i++) {
+        if (data[i].n == 3) {
+            g_assert_cmpint(data[i].ret, ==, -ECANCELED);
+            g_assert(data[i].aiocb != NULL);
+        } else {
+            g_assert_cmpint(data[i].n, ==, 2);
+            g_assert_cmpint(data[i].ret, ==, 0);
+            g_assert(data[i].aiocb == NULL);
+        }
+    }
+}
+
+int main(int argc, char **argv)
+{
+    /* These should be removed once each AioContext has its thread pool.
+     * The test should create its own AioContext.
+     */
+    qemu_init_main_loop();
+    bdrv_init();
+
+    g_test_init(&argc, &argv, NULL);
+    g_test_add_func("/thread-pool/submit", test_submit);
+    g_test_add_func("/thread-pool/submit-aio", test_submit_aio);
+    g_test_add_func("/thread-pool/submit-co", test_submit_co);
+    g_test_add_func("/thread-pool/submit-many", test_submit_many);
+    g_test_add_func("/thread-pool/cancel", test_cancel);
+    return g_test_run();
+}
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:49 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGP-0003Zy-6C; Tue, 11 Dec 2012 13:52:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGN-0003Zg-L0
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:47 +0000
Received: from [85.158.143.35:23474] by server-2.bemta-4.messagelabs.com id
	38/4D-30861-EAA37C05; Tue, 11 Dec 2012 13:52:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1355233755!12073574!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30537 invoked from network); 11 Dec 2012 13:49:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:49:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCx-0001NN-IQ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCx-0005eY-GL
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:15 +0000
Date: Tue, 11 Dec 2012 13:49:15 +0000
Message-Id: <E1TiQCx-0005eY-GL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'kraxel/usb.72' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 95a6e48d776b208d085854358313346ebdb2924d
Merge: fb43a4807ec06307048018d93a7f9e0828308bb5 723aedd53281cfa0997457cb156a59909a75f5a8
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 08:19:20 2012 -0600

    Merge remote-tracking branch 'kraxel/usb.72' into staging
    
    * kraxel/usb.72:
      usb-redir: Don't handle interrupt output packets async
      usb-redir: Split usb_handle_interrupt_data into separate in/out functions
      usb-smartcard-reader: Properly NAK interrupt eps when we've no events
      usb-bt: Return NAK instead of STALL when interrupt ep has no data
      uhci: Fix double unlink
      uhci: Don't allow the guest to set port-enabled when there is no dev connected
      uhci: Add a completions_only flag for async completions
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 hw/usb/dev-bluetooth.c        |   25 ++++++-
 hw/usb/dev-smartcard-reader.c |    2 +
 hw/usb/hcd-uhci.c             |   19 ++++--
 hw/usb/redirect.c             |  150 +++++++++++++++++++++-------------------
 4 files changed, 116 insertions(+), 80 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:49 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGP-0003Zy-6C; Tue, 11 Dec 2012 13:52:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGN-0003Zg-L0
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:47 +0000
Received: from [85.158.143.35:23474] by server-2.bemta-4.messagelabs.com id
	38/4D-30861-EAA37C05; Tue, 11 Dec 2012 13:52:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1355233755!12073574!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30537 invoked from network); 11 Dec 2012 13:49:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:49:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCx-0001NN-IQ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQCx-0005eY-GL
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:49:15 +0000
Date: Tue, 11 Dec 2012 13:49:15 +0000
Message-Id: <E1TiQCx-0005eY-GL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'kraxel/usb.72' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 95a6e48d776b208d085854358313346ebdb2924d
Merge: fb43a4807ec06307048018d93a7f9e0828308bb5 723aedd53281cfa0997457cb156a59909a75f5a8
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 08:19:20 2012 -0600

    Merge remote-tracking branch 'kraxel/usb.72' into staging
    
    * kraxel/usb.72:
      usb-redir: Don't handle interrupt output packets async
      usb-redir: Split usb_handle_interrupt_data into separate in/out functions
      usb-smartcard-reader: Properly NAK interrupt eps when we've no events
      usb-bt: Return NAK instead of STALL when interrupt ep has no data
      uhci: Fix double unlink
      uhci: Don't allow the guest to set port-enabled when there is no dev connected
      uhci: Add a completions_only flag for async completions
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 hw/usb/dev-bluetooth.c        |   25 ++++++-
 hw/usb/dev-smartcard-reader.c |    2 +
 hw/usb/hcd-uhci.c             |   19 ++++--
 hw/usb/redirect.c             |  150 +++++++++++++++++++++-------------------
 4 files changed, 116 insertions(+), 80 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGU-0003b6-9N; Tue, 11 Dec 2012 13:52:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGT-0003ao-54
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:53 +0000
Received: from [193.109.254.147:49630] by server-2.bemta-14.messagelabs.com id
	FE/F3-20829-4BA37C05; Tue, 11 Dec 2012 13:52:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1355233966!4959688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20829 invoked from network); 11 Dec 2012 13:52:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGM-0001RP-Ld
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGM-0005ox-HQ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:46 +0000
Date: Tue, 11 Dec 2012 13:52:46 +0000
Message-Id: <E1TiQGM-0005ox-HQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] hmp: do not crash on
	invalid SCSI hotplug
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b5007bcc9729acd995518c52eb1038c4d8416b5d
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 16:56:18 2012 +0100

    hmp: do not crash on invalid SCSI hotplug
    
    Commit 0d93692 (qdev: Convert busses to QEMU Object Model, 2012-05-02)
    removed a check on the type of the bus where a SCSI disk is hotplugged.
    However, hot-plugging to the wrong kind of device now causes a crash
    due to either a NULL pointer dereference (avoided by the previous patch)
    or a failed QOM cast.
    
    Instead, in this case we need to use object_dynamic_cast and check for
    the result, similar to what was done before that commit.
    
    Reported-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/pci-hotplug.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index e7fb780..0ca5546 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -80,7 +80,13 @@ static int scsi_hot_add(Monitor *mon, DeviceState *adapter,
     SCSIBus *scsibus;
     SCSIDevice *scsidev;
 
-    scsibus = SCSI_BUS(QLIST_FIRST(&adapter->child_bus));
+    scsibus = (SCSIBus *)
+        object_dynamic_cast(OBJECT(QLIST_FIRST(&adapter->child_bus)),
+                            TYPE_SCSI_BUS);
+    if (!scsibus) {
+	error_report("Device is not a SCSI adapter");
+	return -1;
+    }
 
     /*
      * drive_init() tries to find a default for dinfo->unit.  Doesn't
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGU-0003b6-9N; Tue, 11 Dec 2012 13:52:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGT-0003ao-54
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:53 +0000
Received: from [193.109.254.147:49630] by server-2.bemta-14.messagelabs.com id
	FE/F3-20829-4BA37C05; Tue, 11 Dec 2012 13:52:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1355233966!4959688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20829 invoked from network); 11 Dec 2012 13:52:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGM-0001RP-Ld
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGM-0005ox-HQ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:46 +0000
Date: Tue, 11 Dec 2012 13:52:46 +0000
Message-Id: <E1TiQGM-0005ox-HQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] hmp: do not crash on
	invalid SCSI hotplug
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b5007bcc9729acd995518c52eb1038c4d8416b5d
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 16:56:18 2012 +0100

    hmp: do not crash on invalid SCSI hotplug
    
    Commit 0d93692 (qdev: Convert busses to QEMU Object Model, 2012-05-02)
    removed a check on the type of the bus where a SCSI disk is hotplugged.
    However, hot-plugging to the wrong kind of device now causes a crash
    due to either a NULL pointer dereference (avoided by the previous patch)
    or a failed QOM cast.
    
    Instead, in this case we need to use object_dynamic_cast and check for
    the result, similar to what was done before that commit.
    
    Reported-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/pci-hotplug.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index e7fb780..0ca5546 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -80,7 +80,13 @@ static int scsi_hot_add(Monitor *mon, DeviceState *adapter,
     SCSIBus *scsibus;
     SCSIDevice *scsidev;
 
-    scsibus = SCSI_BUS(QLIST_FIRST(&adapter->child_bus));
+    scsibus = (SCSIBus *)
+        object_dynamic_cast(OBJECT(QLIST_FIRST(&adapter->child_bus)),
+                            TYPE_SCSI_BUS);
+    if (!scsibus) {
+	error_report("Device is not a SCSI adapter");
+	return -1;
+    }
 
     /*
      * drive_init() tries to find a default for dinfo->unit.  Doesn't
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:58 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGY-0003cH-Bs; Tue, 11 Dec 2012 13:52:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGW-0003bq-TZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:57 +0000
Received: from [85.158.143.35:24273] by server-3.bemta-4.messagelabs.com id
	14/25-18211-8BA37C05; Tue, 11 Dec 2012 13:52:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1355233970!12448555!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31706 invoked from network); 11 Dec 2012 13:52:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGC-0001RH-Cj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGC-0005oa-79
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:36 +0000
Date: Tue, 11 Dec 2012 13:52:36 +0000
Message-Id: <E1TiQGC-0005oa-79@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qom: dynamic_cast of NULL
	is always NULL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b7f43fe46029d8fd0594cd599fa2599dcce0f553
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 16:56:17 2012 +0100

    qom: dynamic_cast of NULL is always NULL
    
    Trying to cast a NULL value will cause a crash.  Returning
    NULL is also sensible, and it is also what the type-unsafe
    DO_UPCAST macro does.
    
    Reported-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qom/object.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index d7092b0..2e18c9a 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -417,7 +417,7 @@ void object_delete(Object *obj)
 
 Object *object_dynamic_cast(Object *obj, const char *typename)
 {
-    if (object_class_dynamic_cast(object_get_class(obj), typename)) {
+    if (obj && object_class_dynamic_cast(object_get_class(obj), typename)) {
         return obj;
     }
 
@@ -430,7 +430,7 @@ Object *object_dynamic_cast_assert(Object *obj, const char *typename)
 
     inst = object_dynamic_cast(obj, typename);
 
-    if (!inst) {
+    if (!inst && obj) {
         fprintf(stderr, "Object %p is not an instance of type %s\n",
                 obj, typename);
         abort();
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:52:58 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:52:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGY-0003cH-Bs; Tue, 11 Dec 2012 13:52:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGW-0003bq-TZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:57 +0000
Received: from [85.158.143.35:24273] by server-3.bemta-4.messagelabs.com id
	14/25-18211-8BA37C05; Tue, 11 Dec 2012 13:52:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1355233970!12448555!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31706 invoked from network); 11 Dec 2012 13:52:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGC-0001RH-Cj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGC-0005oa-79
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:36 +0000
Date: Tue, 11 Dec 2012 13:52:36 +0000
Message-Id: <E1TiQGC-0005oa-79@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qom: dynamic_cast of NULL
	is always NULL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b7f43fe46029d8fd0594cd599fa2599dcce0f553
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 16:56:17 2012 +0100

    qom: dynamic_cast of NULL is always NULL
    
    Trying to cast a NULL value will cause a crash.  Returning
    NULL is also sensible, and it is also what the type-unsafe
    DO_UPCAST macro does.
    
    Reported-by: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qom/object.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index d7092b0..2e18c9a 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -417,7 +417,7 @@ void object_delete(Object *obj)
 
 Object *object_dynamic_cast(Object *obj, const char *typename)
 {
-    if (object_class_dynamic_cast(object_get_class(obj), typename)) {
+    if (obj && object_class_dynamic_cast(object_get_class(obj), typename)) {
         return obj;
     }
 
@@ -430,7 +430,7 @@ Object *object_dynamic_cast_assert(Object *obj, const char *typename)
 
     inst = object_dynamic_cast(obj, typename);
 
-    if (!inst) {
+    if (!inst && obj) {
         fprintf(stderr, "Object %p is not an instance of type %s\n",
                 obj, typename);
         abort();
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:02 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGb-0003dF-Rt; Tue, 11 Dec 2012 13:53:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGZ-0003co-Tz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:00 +0000
Received: from [85.158.137.99:26593] by server-13.bemta-3.messagelabs.com id
	B6/C7-00465-BBA37C05; Tue, 11 Dec 2012 13:52:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1355233977!18017569!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29262 invoked from network); 11 Dec 2012 13:52:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGX-0001RX-2N
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGW-0005pM-PH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:56 +0000
Date: Tue, 11 Dec 2012 13:52:56 +0000
Message-Id: <E1TiQGW-0005pM-PH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qom: fix refcount of
	non-heap-allocated objects
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5534477558906695896=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5534477558906695896==
Content-Type: text/plain

commit 764b63125a77dab54ed405d493452a4e05679c2e
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 09:47:12 2012 +0100

    qom: fix refcount of non-heap-allocated objects
    
    The reference count for embedded objects is always one too low, because
    object_initialize_with_type returns with zero references to the object.
    This causes premature finalization of the object (or an assertion failure)
    after calling object_ref to add an extra reference and object_unref to
    remove it.
    
    The fix is to move the initial object_ref call from object_new_with_type
    to object_initialize_with_type.
    
    Acked-by: Andreas FÃ¤rber <afaerber@suse.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qom/object.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index 2e18c9a..662ff7e 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -307,6 +307,7 @@ void object_initialize_with_type(void *data, TypeImpl *type)
 
     memset(obj, 0, type->instance_size);
     obj->class = type->class;
+    object_ref(obj);
     QTAILQ_INIT(&obj->properties);
     object_init_with_type(obj, type);
 }
@@ -395,7 +396,6 @@ Object *object_new_with_type(Type type)
 
     obj = g_malloc(type->instance_size);
     object_initialize_with_type(obj, type);
-    object_ref(obj);
 
     return obj;
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============5534477558906695896==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============5534477558906695896==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:02 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGb-0003dF-Rt; Tue, 11 Dec 2012 13:53:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGZ-0003co-Tz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:00 +0000
Received: from [85.158.137.99:26593] by server-13.bemta-3.messagelabs.com id
	B6/C7-00465-BBA37C05; Tue, 11 Dec 2012 13:52:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1355233977!18017569!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29262 invoked from network); 11 Dec 2012 13:52:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:52:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGX-0001RX-2N
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGW-0005pM-PH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:52:56 +0000
Date: Tue, 11 Dec 2012 13:52:56 +0000
Message-Id: <E1TiQGW-0005pM-PH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qom: fix refcount of
	non-heap-allocated objects
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5534477558906695896=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5534477558906695896==
Content-Type: text/plain

commit 764b63125a77dab54ed405d493452a4e05679c2e
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 09:47:12 2012 +0100

    qom: fix refcount of non-heap-allocated objects
    
    The reference count for embedded objects is always one too low, because
    object_initialize_with_type returns with zero references to the object.
    This causes premature finalization of the object (or an assertion failure)
    after calling object_ref to add an extra reference and object_unref to
    remove it.
    
    The fix is to move the initial object_ref call from object_new_with_type
    to object_initialize_with_type.
    
    Acked-by: Andreas FÃ¤rber <afaerber@suse.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qom/object.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index 2e18c9a..662ff7e 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -307,6 +307,7 @@ void object_initialize_with_type(void *data, TypeImpl *type)
 
     memset(obj, 0, type->instance_size);
     obj->class = type->class;
+    object_ref(obj);
     QTAILQ_INIT(&obj->properties);
     object_init_with_type(obj, type);
 }
@@ -395,7 +396,6 @@ Object *object_new_with_type(Type type)
 
     obj = g_malloc(type->instance_size);
     object_initialize_with_type(obj, type);
-    object_ref(obj);
 
     return obj;
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============5534477558906695896==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============5534477558906695896==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGs-0003hJ-Vg; Tue, 11 Dec 2012 13:53:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGs-0003h3-6B
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:18 +0000
Received: from [85.158.138.51:56464] by server-7.bemta-3.messagelabs.com id
	DE/8C-23008-8CA37C05; Tue, 11 Dec 2012 13:53:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1355233987!28420732!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5372 invoked from network); 11 Dec 2012 13:53:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:53:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGh-0001SC-9l
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGh-0005pj-8I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:07 +0000
Date: Tue, 11 Dec 2012 13:53:07 +0000
Message-Id: <E1TiQGh-0005pj-8I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qdev: move bus removal to
	object_unparent
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0061220439978379781=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0061220439978379781==
Content-Type: text/plain

commit 667d22d1ae59da46b4c1fbd094ca61145f19b8c3
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 09:47:13 2012 +0100

    qdev: move bus removal to object_unparent
    
    Add an ObjectClass method that is done at object_unparent time.  It
    should remove any backlinks to the object in the composition tree,
    so that object_delete will be able to drop the last reference and
    free the object.
    
    Use it for qdev buses.
    
    Reviewed-by: Andreas FÃ¤rber <afaerber@suse.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/qdev.c             |   16 +++++++++++++---
 include/qemu/object.h |   11 +++++++++++
 qom/object.c          |    3 +++
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index 7ddcd24..f43717b 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -705,9 +705,6 @@ static void device_finalize(Object *obj)
             qemu_opts_del(dev->opts);
         }
     }
-    if (dev->parent_bus) {
-        bus_remove_child(dev->parent_bus, dev);
-    }
 }
 
 static void device_class_base_init(ObjectClass *class, void *data)
@@ -720,6 +717,18 @@ static void device_class_base_init(ObjectClass *class, void *data)
     klass->props = NULL;
 }
 
+static void qdev_remove_from_bus(Object *obj)
+{
+    DeviceState *dev = DEVICE(obj);
+
+    bus_remove_child(dev->parent_bus, dev);
+}
+
+static void device_class_init(ObjectClass *class, void *data)
+{
+    class->unparent = qdev_remove_from_bus;
+}
+
 void device_reset(DeviceState *dev)
 {
     DeviceClass *klass = DEVICE_GET_CLASS(dev);
@@ -747,6 +756,7 @@ static TypeInfo device_type_info = {
     .instance_init = device_initfn,
     .instance_finalize = device_finalize,
     .class_base_init = device_class_base_init,
+    .class_init = device_class_init,
     .abstract = true,
     .class_size = sizeof(DeviceClass),
 };
diff --git a/include/qemu/object.h b/include/qemu/object.h
index be707f1..232463b 100644
--- a/include/qemu/object.h
+++ b/include/qemu/object.h
@@ -230,6 +230,15 @@ typedef struct ObjectProperty
 } ObjectProperty;
 
 /**
+ * ObjectUnparent:
+ * @obj: the object that is being removed from the composition tree
+ *
+ * Called when an object is being removed from the QOM composition tree.
+ * The function should remove any backlinks from children objects to @obj.
+ */
+typedef void (ObjectUnparent)(Object *obj);
+
+/**
  * ObjectClass:
  *
  * The base for all classes.  The only thing that #ObjectClass contains is an
@@ -240,6 +249,8 @@ struct ObjectClass
     /*< private >*/
     Type type;
     GSList *interfaces;
+
+    ObjectUnparent *unparent;
 };
 
 /**
diff --git a/qom/object.c b/qom/object.c
index 662ff7e..0749506 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -363,6 +363,9 @@ void object_unparent(Object *obj)
     if (obj->parent) {
         object_property_del_child(obj->parent, obj, NULL);
     }
+    if (obj->class->unparent) {
+        (obj->class->unparent)(obj);
+    }
 }
 
 static void object_deinit(Object *obj, TypeImpl *type)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============0061220439978379781==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0061220439978379781==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGs-0003hJ-Vg; Tue, 11 Dec 2012 13:53:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGs-0003h3-6B
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:18 +0000
Received: from [85.158.138.51:56464] by server-7.bemta-3.messagelabs.com id
	DE/8C-23008-8CA37C05; Tue, 11 Dec 2012 13:53:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1355233987!28420732!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5372 invoked from network); 11 Dec 2012 13:53:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:53:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGh-0001SC-9l
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGh-0005pj-8I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:07 +0000
Date: Tue, 11 Dec 2012 13:53:07 +0000
Message-Id: <E1TiQGh-0005pj-8I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qdev: move bus removal to
	object_unparent
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0061220439978379781=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0061220439978379781==
Content-Type: text/plain

commit 667d22d1ae59da46b4c1fbd094ca61145f19b8c3
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 09:47:13 2012 +0100

    qdev: move bus removal to object_unparent
    
    Add an ObjectClass method that is done at object_unparent time.  It
    should remove any backlinks to the object in the composition tree,
    so that object_delete will be able to drop the last reference and
    free the object.
    
    Use it for qdev buses.
    
    Reviewed-by: Andreas FÃ¤rber <afaerber@suse.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/qdev.c             |   16 +++++++++++++---
 include/qemu/object.h |   11 +++++++++++
 qom/object.c          |    3 +++
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index 7ddcd24..f43717b 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -705,9 +705,6 @@ static void device_finalize(Object *obj)
             qemu_opts_del(dev->opts);
         }
     }
-    if (dev->parent_bus) {
-        bus_remove_child(dev->parent_bus, dev);
-    }
 }
 
 static void device_class_base_init(ObjectClass *class, void *data)
@@ -720,6 +717,18 @@ static void device_class_base_init(ObjectClass *class, void *data)
     klass->props = NULL;
 }
 
+static void qdev_remove_from_bus(Object *obj)
+{
+    DeviceState *dev = DEVICE(obj);
+
+    bus_remove_child(dev->parent_bus, dev);
+}
+
+static void device_class_init(ObjectClass *class, void *data)
+{
+    class->unparent = qdev_remove_from_bus;
+}
+
 void device_reset(DeviceState *dev)
 {
     DeviceClass *klass = DEVICE_GET_CLASS(dev);
@@ -747,6 +756,7 @@ static TypeInfo device_type_info = {
     .instance_init = device_initfn,
     .instance_finalize = device_finalize,
     .class_base_init = device_class_base_init,
+    .class_init = device_class_init,
     .abstract = true,
     .class_size = sizeof(DeviceClass),
 };
diff --git a/include/qemu/object.h b/include/qemu/object.h
index be707f1..232463b 100644
--- a/include/qemu/object.h
+++ b/include/qemu/object.h
@@ -230,6 +230,15 @@ typedef struct ObjectProperty
 } ObjectProperty;
 
 /**
+ * ObjectUnparent:
+ * @obj: the object that is being removed from the composition tree
+ *
+ * Called when an object is being removed from the QOM composition tree.
+ * The function should remove any backlinks from children objects to @obj.
+ */
+typedef void (ObjectUnparent)(Object *obj);
+
+/**
  * ObjectClass:
  *
  * The base for all classes.  The only thing that #ObjectClass contains is an
@@ -240,6 +249,8 @@ struct ObjectClass
     /*< private >*/
     Type type;
     GSList *interfaces;
+
+    ObjectUnparent *unparent;
 };
 
 /**
diff --git a/qom/object.c b/qom/object.c
index 662ff7e..0749506 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -363,6 +363,9 @@ void object_unparent(Object *obj)
     if (obj->parent) {
         object_property_del_child(obj->parent, obj, NULL);
     }
+    if (obj->class->unparent) {
+        (obj->class->unparent)(obj);
+    }
 }
 
 static void object_deinit(Object *obj, TypeImpl *type)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============0061220439978379781==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0061220439978379781==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGv-0003i6-2I; Tue, 11 Dec 2012 13:53:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGu-0003hn-D2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:20 +0000
Received: from [85.158.139.211:33570] by server-16.bemta-5.messagelabs.com id
	6B/AF-09208-FCA37C05; Tue, 11 Dec 2012 13:53:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355233997!18526152!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18471 invoked from network); 11 Dec 2012 13:53:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:53:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGr-0001SF-J8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGr-0005qG-DX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:17 +0000
Date: Tue, 11 Dec 2012 13:53:17 +0000
Message-Id: <E1TiQGr-0005qG-DX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qom: make object_delete
	usable for statically-allocated objects
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8916017182624562673=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8916017182624562673==
Content-Type: text/plain

commit fde9bf4470d4a3b6ee1da0dee2370ab028b6314a
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 09:47:14 2012 +0100

    qom: make object_delete usable for statically-allocated objects
    
    Store in the object the freeing function that will be used at deletion
    time.  This makes it possible to use object_delete on statically-allocated
    (embedded) objects.  Dually, it makes it possible to use object_unparent
    and object_unref without leaking memory, when the lifetime of object
    might extend until after the call to object_delete.
    
    Reviewed-by: Andreas FÃ¤rber <afaerber@suse.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 include/qemu/object.h |    9 +++++++++
 qom/object.c          |    5 ++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/include/qemu/object.h b/include/qemu/object.h
index 232463b..5ddcb4a 100644
--- a/include/qemu/object.h
+++ b/include/qemu/object.h
@@ -239,6 +239,14 @@ typedef struct ObjectProperty
 typedef void (ObjectUnparent)(Object *obj);
 
 /**
+ * ObjectFree:
+ * @obj: the object being freed
+ *
+ * Called when an object's last reference is removed.
+ */
+typedef void (ObjectFree)(void *obj);
+
+/**
  * ObjectClass:
  *
  * The base for all classes.  The only thing that #ObjectClass contains is an
@@ -272,6 +280,7 @@ struct Object
 {
     /*< private >*/
     ObjectClass *class;
+    ObjectFree *free;
     QTAILQ_HEAD(, ObjectProperty) properties;
     uint32_t ref;
     Object *parent;
diff --git a/qom/object.c b/qom/object.c
index 0749506..3b50255 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -388,6 +388,9 @@ void object_finalize(void *data)
     object_property_del_all(obj);
 
     g_assert(obj->ref == 0);
+    if (obj->free) {
+        obj->free(obj);
+    }
 }
 
 Object *object_new_with_type(Type type)
@@ -399,6 +402,7 @@ Object *object_new_with_type(Type type)
 
     obj = g_malloc(type->instance_size);
     object_initialize_with_type(obj, type);
+    obj->free = g_free;
 
     return obj;
 }
@@ -415,7 +419,6 @@ void object_delete(Object *obj)
     object_unparent(obj);
     g_assert(obj->ref == 1);
     object_unref(obj);
-    g_free(obj);
 }
 
 Object *object_dynamic_cast(Object *obj, const char *typename)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============8916017182624562673==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============8916017182624562673==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQGv-0003i6-2I; Tue, 11 Dec 2012 13:53:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGu-0003hn-D2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:20 +0000
Received: from [85.158.139.211:33570] by server-16.bemta-5.messagelabs.com id
	6B/AF-09208-FCA37C05; Tue, 11 Dec 2012 13:53:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355233997!18526152!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18471 invoked from network); 11 Dec 2012 13:53:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:53:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGr-0001SF-J8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQGr-0005qG-DX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:17 +0000
Date: Tue, 11 Dec 2012 13:53:17 +0000
Message-Id: <E1TiQGr-0005qG-DX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qom: make object_delete
	usable for statically-allocated objects
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8916017182624562673=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8916017182624562673==
Content-Type: text/plain

commit fde9bf4470d4a3b6ee1da0dee2370ab028b6314a
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 09:47:14 2012 +0100

    qom: make object_delete usable for statically-allocated objects
    
    Store in the object the freeing function that will be used at deletion
    time.  This makes it possible to use object_delete on statically-allocated
    (embedded) objects.  Dually, it makes it possible to use object_unparent
    and object_unref without leaking memory, when the lifetime of object
    might extend until after the call to object_delete.
    
    Reviewed-by: Andreas FÃ¤rber <afaerber@suse.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 include/qemu/object.h |    9 +++++++++
 qom/object.c          |    5 ++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/include/qemu/object.h b/include/qemu/object.h
index 232463b..5ddcb4a 100644
--- a/include/qemu/object.h
+++ b/include/qemu/object.h
@@ -239,6 +239,14 @@ typedef struct ObjectProperty
 typedef void (ObjectUnparent)(Object *obj);
 
 /**
+ * ObjectFree:
+ * @obj: the object being freed
+ *
+ * Called when an object's last reference is removed.
+ */
+typedef void (ObjectFree)(void *obj);
+
+/**
  * ObjectClass:
  *
  * The base for all classes.  The only thing that #ObjectClass contains is an
@@ -272,6 +280,7 @@ struct Object
 {
     /*< private >*/
     ObjectClass *class;
+    ObjectFree *free;
     QTAILQ_HEAD(, ObjectProperty) properties;
     uint32_t ref;
     Object *parent;
diff --git a/qom/object.c b/qom/object.c
index 0749506..3b50255 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -388,6 +388,9 @@ void object_finalize(void *data)
     object_property_del_all(obj);
 
     g_assert(obj->ref == 0);
+    if (obj->free) {
+        obj->free(obj);
+    }
 }
 
 Object *object_new_with_type(Type type)
@@ -399,6 +402,7 @@ Object *object_new_with_type(Type type)
 
     obj = g_malloc(type->instance_size);
     object_initialize_with_type(obj, type);
+    obj->free = g_free;
 
     return obj;
 }
@@ -415,7 +419,6 @@ void object_delete(Object *obj)
     object_unparent(obj);
     g_assert(obj->ref == 1);
     object_unref(obj);
-    g_free(obj);
 }
 
 Object *object_dynamic_cast(Object *obj, const char *typename)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============8916017182624562673==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============8916017182624562673==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQH6-0003l3-7q; Tue, 11 Dec 2012 13:53:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQH4-0003ka-Rh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:31 +0000
Received: from [85.158.138.51:62064] by server-11.bemta-3.messagelabs.com id
	10/D7-13335-ADA37C05; Tue, 11 Dec 2012 13:53:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1355234008!22055540!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4128 invoked from network); 11 Dec 2012 13:53:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:53:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQH1-0001SL-Vl
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQH1-0005qn-QE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:27 +0000
Date: Tue, 11 Dec 2012 13:53:27 +0000
Message-Id: <E1TiQH1-0005qn-QE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qdev: simplify
	(de)allocation of buses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 64b625f4b2fdb2c873e25c149648b2ce923faab7
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 09:47:15 2012 +0100

    qdev: simplify (de)allocation of buses
    
    All conditional deallocation can now be done with object_delete.
    Remove the @qom_allocated and @glib_allocated fields; replace the latter
    with a direct assignment of the @free function pointer.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/pci.c       |    2 +-
 hw/qdev-core.h |    5 -----
 hw/qdev.c      |   10 +---------
 hw/sysbus.c    |    2 +-
 4 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index 9841e39..97a0cd7 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -301,9 +301,9 @@ PCIBus *pci_bus_new(DeviceState *parent, const char *name,
     PCIBus *bus;
 
     bus = g_malloc0(sizeof(*bus));
-    bus->qbus.glib_allocated = true;
     pci_bus_new_inplace(bus, parent, name, address_space_mem,
                         address_space_io, devfn_min);
+    OBJECT(bus)->free = g_free;
     return bus;
 }
 
diff --git a/hw/qdev-core.h b/hw/qdev-core.h
index fce9e22..fff7f0f 100644
--- a/hw/qdev-core.h
+++ b/hw/qdev-core.h
@@ -106,17 +106,12 @@ typedef struct BusChild {
 
 /**
  * BusState:
- * @qom_allocated: Indicates whether the object was allocated by QOM.
- * @glib_allocated: Indicates whether the object was initialized in-place
- * yet is expected to be freed with g_free().
  */
 struct BusState {
     Object obj;
     DeviceState *parent;
     const char *name;
     int allow_hotplug;
-    bool qom_allocated;
-    bool glib_allocated;
     int max_index;
     QTAILQ_HEAD(ChildrenHead, BusChild) children;
     QLIST_ENTRY(BusState) sibling;
diff --git a/hw/qdev.c b/hw/qdev.c
index f43717b..788b4da 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -454,7 +454,6 @@ BusState *qbus_create(const char *typename, DeviceState *parent, const char *nam
     BusState *bus;
 
     bus = BUS(object_new(typename));
-    bus->qom_allocated = true;
 
     bus->parent = parent;
     bus->name = name ? g_strdup(name) : NULL;
@@ -465,14 +464,7 @@ BusState *qbus_create(const char *typename, DeviceState *parent, const char *nam
 
 void qbus_free(BusState *bus)
 {
-    if (bus->qom_allocated) {
-        object_delete(OBJECT(bus));
-    } else {
-        object_finalize(OBJECT(bus));
-        if (bus->glib_allocated) {
-            g_free(bus);
-        }
-    }
+    object_delete(OBJECT(bus));
 }
 
 static char *bus_get_fw_dev_path(BusState *bus, DeviceState *dev)
diff --git a/hw/sysbus.c b/hw/sysbus.c
index 4969f06..ef8ffb6 100644
--- a/hw/sysbus.c
+++ b/hw/sysbus.c
@@ -274,7 +274,7 @@ static void main_system_bus_create(void)
     main_system_bus = g_malloc0(system_bus_info.instance_size);
     qbus_create_inplace(main_system_bus, TYPE_SYSTEM_BUS, NULL,
                         "main-system-bus");
-    main_system_bus->glib_allocated = true;
+    OBJECT(main_system_bus)->free = g_free;
     object_property_add_child(container_get(qdev_get_machine(),
                                             "/unattached"),
                               "sysbus", OBJECT(main_system_bus), NULL);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQH6-0003l3-7q; Tue, 11 Dec 2012 13:53:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQH4-0003ka-Rh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:31 +0000
Received: from [85.158.138.51:62064] by server-11.bemta-3.messagelabs.com id
	10/D7-13335-ADA37C05; Tue, 11 Dec 2012 13:53:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1355234008!22055540!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4128 invoked from network); 11 Dec 2012 13:53:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:53:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQH1-0001SL-Vl
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQH1-0005qn-QE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:27 +0000
Date: Tue, 11 Dec 2012 13:53:27 +0000
Message-Id: <E1TiQH1-0005qn-QE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qdev: simplify
	(de)allocation of buses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 64b625f4b2fdb2c873e25c149648b2ce923faab7
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 09:47:15 2012 +0100

    qdev: simplify (de)allocation of buses
    
    All conditional deallocation can now be done with object_delete.
    Remove the @qom_allocated and @glib_allocated fields; replace the latter
    with a direct assignment of the @free function pointer.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/pci.c       |    2 +-
 hw/qdev-core.h |    5 -----
 hw/qdev.c      |   10 +---------
 hw/sysbus.c    |    2 +-
 4 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index 9841e39..97a0cd7 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -301,9 +301,9 @@ PCIBus *pci_bus_new(DeviceState *parent, const char *name,
     PCIBus *bus;
 
     bus = g_malloc0(sizeof(*bus));
-    bus->qbus.glib_allocated = true;
     pci_bus_new_inplace(bus, parent, name, address_space_mem,
                         address_space_io, devfn_min);
+    OBJECT(bus)->free = g_free;
     return bus;
 }
 
diff --git a/hw/qdev-core.h b/hw/qdev-core.h
index fce9e22..fff7f0f 100644
--- a/hw/qdev-core.h
+++ b/hw/qdev-core.h
@@ -106,17 +106,12 @@ typedef struct BusChild {
 
 /**
  * BusState:
- * @qom_allocated: Indicates whether the object was allocated by QOM.
- * @glib_allocated: Indicates whether the object was initialized in-place
- * yet is expected to be freed with g_free().
  */
 struct BusState {
     Object obj;
     DeviceState *parent;
     const char *name;
     int allow_hotplug;
-    bool qom_allocated;
-    bool glib_allocated;
     int max_index;
     QTAILQ_HEAD(ChildrenHead, BusChild) children;
     QLIST_ENTRY(BusState) sibling;
diff --git a/hw/qdev.c b/hw/qdev.c
index f43717b..788b4da 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -454,7 +454,6 @@ BusState *qbus_create(const char *typename, DeviceState *parent, const char *nam
     BusState *bus;
 
     bus = BUS(object_new(typename));
-    bus->qom_allocated = true;
 
     bus->parent = parent;
     bus->name = name ? g_strdup(name) : NULL;
@@ -465,14 +464,7 @@ BusState *qbus_create(const char *typename, DeviceState *parent, const char *nam
 
 void qbus_free(BusState *bus)
 {
-    if (bus->qom_allocated) {
-        object_delete(OBJECT(bus));
-    } else {
-        object_finalize(OBJECT(bus));
-        if (bus->glib_allocated) {
-            g_free(bus);
-        }
-    }
+    object_delete(OBJECT(bus));
 }
 
 static char *bus_get_fw_dev_path(BusState *bus, DeviceState *dev)
diff --git a/hw/sysbus.c b/hw/sysbus.c
index 4969f06..ef8ffb6 100644
--- a/hw/sysbus.c
+++ b/hw/sysbus.c
@@ -274,7 +274,7 @@ static void main_system_bus_create(void)
     main_system_bus = g_malloc0(system_bus_info.instance_size);
     qbus_create_inplace(main_system_bus, TYPE_SYSTEM_BUS, NULL,
                         "main-system-bus");
-    main_system_bus->glib_allocated = true;
+    OBJECT(main_system_bus)->free = g_free;
     object_property_add_child(container_get(qdev_get_machine(),
                                             "/unattached"),
                               "sysbus", OBJECT(main_system_bus), NULL);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQHG-0003n6-Al; Tue, 11 Dec 2012 13:53:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHF-0003mk-4o
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:41 +0000
Received: from [85.158.137.99:20148] by server-14.bemta-3.messagelabs.com id
	9F/1E-27443-4EA37C05; Tue, 11 Dec 2012 13:53:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1355234018!17150912!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1639 invoked from network); 11 Dec 2012 13:53:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:53:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHC-0001SQ-Ew
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHC-0005ry-3t
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:38 +0000
Date: Tue, 11 Dec 2012 13:53:38 +0000
Message-Id: <E1TiQHC-0005ry-3t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qom: make object_finalize
	static
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 339c2708e7a0d91e926c473314d563354a949c7f
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 09:47:16 2012 +0100

    qom: make object_finalize static
    
    It is not used anymore, and there is no need to make it public.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 include/qemu/object.h |    9 ---------
 qom/object.c          |    2 +-
 2 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/include/qemu/object.h b/include/qemu/object.h
index 5ddcb4a..ed1f47f 100644
--- a/include/qemu/object.h
+++ b/include/qemu/object.h
@@ -505,15 +505,6 @@ void object_initialize_with_type(void *data, Type type);
 void object_initialize(void *obj, const char *typename);
 
 /**
- * object_finalize:
- * @obj: The object to finalize.
- *
- * This function destroys and object without freeing the memory associated with
- * it.
- */
-void object_finalize(void *obj);
-
-/**
  * object_dynamic_cast:
  * @obj: The object to cast.
  * @typename: The @typename to cast to.
diff --git a/qom/object.c b/qom/object.c
index 3b50255..0739aa2 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -379,7 +379,7 @@ static void object_deinit(Object *obj, TypeImpl *type)
     }
 }
 
-void object_finalize(void *data)
+static void object_finalize(void *data)
 {
     Object *obj = data;
     TypeImpl *ti = obj->class->type;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQHG-0003n6-Al; Tue, 11 Dec 2012 13:53:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHF-0003mk-4o
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:41 +0000
Received: from [85.158.137.99:20148] by server-14.bemta-3.messagelabs.com id
	9F/1E-27443-4EA37C05; Tue, 11 Dec 2012 13:53:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-217.messagelabs.com!1355234018!17150912!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1639 invoked from network); 11 Dec 2012 13:53:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:53:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHC-0001SQ-Ew
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHC-0005ry-3t
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:38 +0000
Date: Tue, 11 Dec 2012 13:53:38 +0000
Message-Id: <E1TiQHC-0005ry-3t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qom: make object_finalize
	static
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 339c2708e7a0d91e926c473314d563354a949c7f
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Fri Nov 23 09:47:16 2012 +0100

    qom: make object_finalize static
    
    It is not used anymore, and there is no need to make it public.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 include/qemu/object.h |    9 ---------
 qom/object.c          |    2 +-
 2 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/include/qemu/object.h b/include/qemu/object.h
index 5ddcb4a..ed1f47f 100644
--- a/include/qemu/object.h
+++ b/include/qemu/object.h
@@ -505,15 +505,6 @@ void object_initialize_with_type(void *data, Type type);
 void object_initialize(void *obj, const char *typename);
 
 /**
- * object_finalize:
- * @obj: The object to finalize.
- *
- * This function destroys and object without freeing the memory associated with
- * it.
- */
-void object_finalize(void *obj);
-
-/**
  * object_dynamic_cast:
  * @obj: The object to cast.
  * @typename: The @typename to cast to.
diff --git a/qom/object.c b/qom/object.c
index 3b50255..0739aa2 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -379,7 +379,7 @@ static void object_deinit(Object *obj, TypeImpl *type)
     }
 }
 
-void object_finalize(void *data)
+static void object_finalize(void *data)
 {
     Object *obj = data;
     TypeImpl *ti = obj->class->type;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQHR-0003pK-Dr; Tue, 11 Dec 2012 13:53:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHP-0003p1-LW
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:52 +0000
Received: from [85.158.137.99:17067] by server-10.bemta-3.messagelabs.com id
	8C/90-07616-EEA37C05; Tue, 11 Dec 2012 13:53:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1355234029!18838712!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21748 invoked from network); 11 Dec 2012 13:53:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:53:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHM-0001SW-PS
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHM-0005sM-KN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:48 +0000
Date: Tue, 11 Dec 2012 13:53:48 +0000
Message-Id: <E1TiQHM-0005sM-KN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] vl.c: Fix broken -usb
	option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa5358c69d090d13f762f545d39c5e03124dfdd8
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Thu Nov 22 16:48:45 2012 +0000

    vl.c: Fix broken -usb option
    
    Commit 094b287f0b accidentally broke the "-usb" command line
    option, so it would have no effect if the user had not specified
    any machine options at that point. (the return value from
    'qemu_opts_find(qemu_find_opts("machine"), 0);' is NULL if there
    are no user specified options, so it is only to be used for
    looking up an option, not when trying to set one.) Similarly,
    would '-usbdevice' no longer cause USB to default to enabled.
    
    Fix this regression by using the same style of code for forcing
    the usb=on machine option that we use for other aliases such as
    '-enable-kvm'.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 vl.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/vl.c b/vl.c
index c8e9c78..a3ab384 100644
--- a/vl.c
+++ b/vl.c
@@ -3273,16 +3273,12 @@ int main(int argc, char **argv, char **envp)
                 break;
             }
             case QEMU_OPTION_usb:
-                machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
-                if (machine_opts) {
-                    qemu_opt_set_bool(machine_opts, "usb", true);
-                }
+                olist = qemu_find_opts("machine");
+                qemu_opts_parse(olist, "usb=on", 0);
                 break;
             case QEMU_OPTION_usbdevice:
-                machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
-                if (machine_opts) {
-                    qemu_opt_set_bool(machine_opts, "usb", true);
-                }
+                olist = qemu_find_opts("machine");
+                qemu_opts_parse(olist, "usb=on", 0);
                 add_device_config(DEV_USB, optarg);
                 break;
             case QEMU_OPTION_device:
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:53:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:53:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQHR-0003pK-Dr; Tue, 11 Dec 2012 13:53:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHP-0003p1-LW
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:52 +0000
Received: from [85.158.137.99:17067] by server-10.bemta-3.messagelabs.com id
	8C/90-07616-EEA37C05; Tue, 11 Dec 2012 13:53:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1355234029!18838712!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21748 invoked from network); 11 Dec 2012 13:53:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:53:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHM-0001SW-PS
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHM-0005sM-KN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:48 +0000
Date: Tue, 11 Dec 2012 13:53:48 +0000
Message-Id: <E1TiQHM-0005sM-KN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] vl.c: Fix broken -usb
	option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa5358c69d090d13f762f545d39c5e03124dfdd8
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Thu Nov 22 16:48:45 2012 +0000

    vl.c: Fix broken -usb option
    
    Commit 094b287f0b accidentally broke the "-usb" command line
    option, so it would have no effect if the user had not specified
    any machine options at that point. (the return value from
    'qemu_opts_find(qemu_find_opts("machine"), 0);' is NULL if there
    are no user specified options, so it is only to be used for
    looking up an option, not when trying to set one.) Similarly,
    would '-usbdevice' no longer cause USB to default to enabled.
    
    Fix this regression by using the same style of code for forcing
    the usb=on machine option that we use for other aliases such as
    '-enable-kvm'.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 vl.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/vl.c b/vl.c
index c8e9c78..a3ab384 100644
--- a/vl.c
+++ b/vl.c
@@ -3273,16 +3273,12 @@ int main(int argc, char **argv, char **envp)
                 break;
             }
             case QEMU_OPTION_usb:
-                machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
-                if (machine_opts) {
-                    qemu_opt_set_bool(machine_opts, "usb", true);
-                }
+                olist = qemu_find_opts("machine");
+                qemu_opts_parse(olist, "usb=on", 0);
                 break;
             case QEMU_OPTION_usbdevice:
-                machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
-                if (machine_opts) {
-                    qemu_opt_set_bool(machine_opts, "usb", true);
-                }
+                olist = qemu_find_opts("machine");
+                qemu_opts_parse(olist, "usb=on", 0);
                 add_device_config(DEV_USB, optarg);
                 break;
             case QEMU_OPTION_device:
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:06 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQHe-0003rQ-H0; Tue, 11 Dec 2012 13:54:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHZ-0003r0-F8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:01 +0000
Received: from [85.158.139.83:46916] by server-9.bemta-5.messagelabs.com id
	02/EC-10690-8FA37C05; Tue, 11 Dec 2012 13:54:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1355234039!28669228!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28067 invoked from network); 11 Dec 2012 13:54:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHX-0001Sf-1Y
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHW-0005sj-Uz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:58 +0000
Date: Tue, 11 Dec 2012 13:53:58 +0000
Message-Id: <E1TiQHW-0005sj-Uz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-i386: cpu: add
	missing flags to Haswell CPU model
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3729406125881352222=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3729406125881352222==
Content-Type: text/plain

commit e1e54f3fbee6c0652e19182f4c747de172cbe8b1
Author: Eduardo Habkost <ehabkost@redhat.com>
Date:   Thu Nov 22 13:31:03 2012 -0200

    target-i386: cpu: add missing flags to Haswell CPU model
    
    When adding the Haswell CPU model, I intended to make it a superset of the
    features present on the SandyBridge model, but I have removed the SEP and
    RDTSCP features from the feature list by mistake. This patch adds the missing
    SEP and RDTSCP features (that are present on SandyBridge) to Haswell.
    
    Reported-by: Martin Kletzander <mkletzan@redhat.com>
    Acked-by: Andreas FÃ¤rber <afaerber@suse.de>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 target-i386/cpu.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 64c3491..4fdd4f7 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -657,7 +657,7 @@ static x86_def_t builtin_x86_defs[] = {
         .stepping = 1,
         .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
              CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
-             CPUID_PGE | CPUID_MTRR | CPUID_APIC | CPUID_CX8 |
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
              CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
              CPUID_DE | CPUID_FP87,
         .ext_features = CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
@@ -666,7 +666,8 @@ static x86_def_t builtin_x86_defs[] = {
              CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
              CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
              CPUID_EXT_PCID,
-        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX |
+             CPUID_EXT2_SYSCALL,
         .ext3_features = CPUID_EXT3_LAHF_LM,
         .cpuid_7_0_ebx_features = CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
             CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============3729406125881352222==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============3729406125881352222==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:06 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQHe-0003rQ-H0; Tue, 11 Dec 2012 13:54:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHZ-0003r0-F8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:01 +0000
Received: from [85.158.139.83:46916] by server-9.bemta-5.messagelabs.com id
	02/EC-10690-8FA37C05; Tue, 11 Dec 2012 13:54:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1355234039!28669228!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28067 invoked from network); 11 Dec 2012 13:54:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHX-0001Sf-1Y
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHW-0005sj-Uz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:53:58 +0000
Date: Tue, 11 Dec 2012 13:53:58 +0000
Message-Id: <E1TiQHW-0005sj-Uz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-i386: cpu: add
	missing flags to Haswell CPU model
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3729406125881352222=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3729406125881352222==
Content-Type: text/plain

commit e1e54f3fbee6c0652e19182f4c747de172cbe8b1
Author: Eduardo Habkost <ehabkost@redhat.com>
Date:   Thu Nov 22 13:31:03 2012 -0200

    target-i386: cpu: add missing flags to Haswell CPU model
    
    When adding the Haswell CPU model, I intended to make it a superset of the
    features present on the SandyBridge model, but I have removed the SEP and
    RDTSCP features from the feature list by mistake. This patch adds the missing
    SEP and RDTSCP features (that are present on SandyBridge) to Haswell.
    
    Reported-by: Martin Kletzander <mkletzan@redhat.com>
    Acked-by: Andreas FÃ¤rber <afaerber@suse.de>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 target-i386/cpu.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 64c3491..4fdd4f7 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -657,7 +657,7 @@ static x86_def_t builtin_x86_defs[] = {
         .stepping = 1,
         .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
              CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
-             CPUID_PGE | CPUID_MTRR | CPUID_APIC | CPUID_CX8 |
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
              CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
              CPUID_DE | CPUID_FP87,
         .ext_features = CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
@@ -666,7 +666,8 @@ static x86_def_t builtin_x86_defs[] = {
              CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
              CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
              CPUID_EXT_PCID,
-        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX |
+             CPUID_EXT2_SYSCALL,
         .ext3_features = CPUID_EXT3_LAHF_LM,
         .cpuid_7_0_ebx_features = CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
             CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============3729406125881352222==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============3729406125881352222==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQHl-0003su-Jw; Tue, 11 Dec 2012 13:54:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHj-0003sZ-Ug
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:12 +0000
Received: from [85.158.137.99:22624] by server-6.bemta-3.messagelabs.com id
	26/76-12154-30B37C05; Tue, 11 Dec 2012 13:54:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1355234049!18583142!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16179 invoked from network); 11 Dec 2012 13:54:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHh-0001TC-9N
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHh-0005tA-5M
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:09 +0000
Date: Tue, 11 Dec 2012 13:54:09 +0000
Message-Id: <E1TiQHh-0005tA-5M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qapi: handle
	visitor->type_size() in QapiDeallocVisitor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7130326279900818042=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7130326279900818042==
Content-Type: text/plain

commit 0c26f2eca40d6c65ea9edc62a10e510dc7f65cc8
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date:   Mon Nov 26 13:10:12 2012 +0100

    qapi: handle visitor->type_size() in QapiDeallocVisitor
    
    visit_type_size() requires either visitor->type_size() or
    visitor_uint64() to be implemented, otherwise a NULL function pointer is
    invoked.
    
    It is possible to trigger this crash as follows:
    
      $ qemu-system-x86_64 -netdev tap,sndbuf=0,id=netdev0 \
                           -device virtio-blk-pci,netdev=netdev0
    
    The 'sndbuf' option has type "size".
    
    Reviewed-by: Andreas FÃ¤rber <afaerber@suse.de>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qapi/qapi-dealloc-visitor.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index a154523..a07b171 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -132,6 +132,11 @@ static void qapi_dealloc_type_number(Visitor *v, double *obj, const char *name,
 {
 }
 
+static void qapi_dealloc_type_size(Visitor *v, size_t *obj, const char *name,
+                                   Error **errp)
+{
+}
+
 static void qapi_dealloc_type_enum(Visitor *v, int *obj, const char *strings[],
                                    const char *kind, const char *name,
                                    Error **errp)
@@ -164,6 +169,7 @@ QapiDeallocVisitor *qapi_dealloc_visitor_new(void)
     v->visitor.type_bool = qapi_dealloc_type_bool;
     v->visitor.type_str = qapi_dealloc_type_str;
     v->visitor.type_number = qapi_dealloc_type_number;
+    v->visitor.type_size = qapi_dealloc_type_size;
 
     QTAILQ_INIT(&v->stack);
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============7130326279900818042==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============7130326279900818042==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQHl-0003su-Jw; Tue, 11 Dec 2012 13:54:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHj-0003sZ-Ug
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:12 +0000
Received: from [85.158.137.99:22624] by server-6.bemta-3.messagelabs.com id
	26/76-12154-30B37C05; Tue, 11 Dec 2012 13:54:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1355234049!18583142!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16179 invoked from network); 11 Dec 2012 13:54:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHh-0001TC-9N
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHh-0005tA-5M
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:09 +0000
Date: Tue, 11 Dec 2012 13:54:09 +0000
Message-Id: <E1TiQHh-0005tA-5M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qapi: handle
	visitor->type_size() in QapiDeallocVisitor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7130326279900818042=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7130326279900818042==
Content-Type: text/plain

commit 0c26f2eca40d6c65ea9edc62a10e510dc7f65cc8
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date:   Mon Nov 26 13:10:12 2012 +0100

    qapi: handle visitor->type_size() in QapiDeallocVisitor
    
    visit_type_size() requires either visitor->type_size() or
    visitor_uint64() to be implemented, otherwise a NULL function pointer is
    invoked.
    
    It is possible to trigger this crash as follows:
    
      $ qemu-system-x86_64 -netdev tap,sndbuf=0,id=netdev0 \
                           -device virtio-blk-pci,netdev=netdev0
    
    The 'sndbuf' option has type "size".
    
    Reviewed-by: Andreas FÃ¤rber <afaerber@suse.de>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qapi/qapi-dealloc-visitor.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index a154523..a07b171 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -132,6 +132,11 @@ static void qapi_dealloc_type_number(Visitor *v, double *obj, const char *name,
 {
 }
 
+static void qapi_dealloc_type_size(Visitor *v, size_t *obj, const char *name,
+                                   Error **errp)
+{
+}
+
 static void qapi_dealloc_type_enum(Visitor *v, int *obj, const char *strings[],
                                    const char *kind, const char *name,
                                    Error **errp)
@@ -164,6 +169,7 @@ QapiDeallocVisitor *qapi_dealloc_visitor_new(void)
     v->visitor.type_bool = qapi_dealloc_type_bool;
     v->visitor.type_str = qapi_dealloc_type_str;
     v->visitor.type_number = qapi_dealloc_type_number;
+    v->visitor.type_size = qapi_dealloc_type_size;
 
     QTAILQ_INIT(&v->stack);
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============7130326279900818042==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============7130326279900818042==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQHx-0003vG-N2; Tue, 11 Dec 2012 13:54:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHw-0003uv-1l
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:24 +0000
Received: from [85.158.137.99:23652] by server-8.bemta-3.messagelabs.com id
	92/D2-01297-F0B37C05; Tue, 11 Dec 2012 13:54:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1355234059!18907184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4220 invoked from network); 11 Dec 2012 13:54:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHr-0001TK-Gt
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHr-0005tY-De
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:19 +0000
Date: Tue, 11 Dec 2012 13:54:19 +0000
Message-Id: <E1TiQHr-0005tY-De@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] i8259: Fix PIC_COMMON()
	macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0777117314996870189=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0777117314996870189==
Content-Type: text/plain

commit 25d87288b150032fedcf7b5380fb54fdbdd6788d
Author: Andreas FÃ¤rber <afaerber@suse.de>
Date:   Sun Nov 25 20:44:33 2012 +0100

    i8259: Fix PIC_COMMON() macro
    
    It used a wrong struct type name since its introduction in
    8f04ee0882aec9fe91fb70f767edf5dacff59835 (isa: pic: convert to QEMU
    Object Model), apparently it is unused so far.
    
    Signed-off-by: Andreas FÃ¤rber <afaerber@suse.de>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/i8259_internal.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/i8259_internal.h b/hw/i8259_internal.h
index 4137b61..8785b1d 100644
--- a/hw/i8259_internal.h
+++ b/hw/i8259_internal.h
@@ -33,7 +33,7 @@ typedef struct PICCommonState PICCommonState;
 
 #define TYPE_PIC_COMMON "pic-common"
 #define PIC_COMMON(obj) \
-     OBJECT_CHECK(PICCommon, (obj), TYPE_PIC_COMMON)
+     OBJECT_CHECK(PICCommonState, (obj), TYPE_PIC_COMMON)
 #define PIC_COMMON_CLASS(klass) \
      OBJECT_CLASS_CHECK(PICCommonClass, (klass), TYPE_PIC_COMMON)
 #define PIC_COMMON_GET_CLASS(obj) \
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============0777117314996870189==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0777117314996870189==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQHx-0003vG-N2; Tue, 11 Dec 2012 13:54:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHw-0003uv-1l
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:24 +0000
Received: from [85.158.137.99:23652] by server-8.bemta-3.messagelabs.com id
	92/D2-01297-F0B37C05; Tue, 11 Dec 2012 13:54:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1355234059!18907184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4220 invoked from network); 11 Dec 2012 13:54:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHr-0001TK-Gt
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQHr-0005tY-De
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:19 +0000
Date: Tue, 11 Dec 2012 13:54:19 +0000
Message-Id: <E1TiQHr-0005tY-De@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] i8259: Fix PIC_COMMON()
	macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0777117314996870189=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0777117314996870189==
Content-Type: text/plain

commit 25d87288b150032fedcf7b5380fb54fdbdd6788d
Author: Andreas FÃ¤rber <afaerber@suse.de>
Date:   Sun Nov 25 20:44:33 2012 +0100

    i8259: Fix PIC_COMMON() macro
    
    It used a wrong struct type name since its introduction in
    8f04ee0882aec9fe91fb70f767edf5dacff59835 (isa: pic: convert to QEMU
    Object Model), apparently it is unused so far.
    
    Signed-off-by: Andreas FÃ¤rber <afaerber@suse.de>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/i8259_internal.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/i8259_internal.h b/hw/i8259_internal.h
index 4137b61..8785b1d 100644
--- a/hw/i8259_internal.h
+++ b/hw/i8259_internal.h
@@ -33,7 +33,7 @@ typedef struct PICCommonState PICCommonState;
 
 #define TYPE_PIC_COMMON "pic-common"
 #define PIC_COMMON(obj) \
-     OBJECT_CHECK(PICCommon, (obj), TYPE_PIC_COMMON)
+     OBJECT_CHECK(PICCommonState, (obj), TYPE_PIC_COMMON)
 #define PIC_COMMON_CLASS(klass) \
      OBJECT_CLASS_CHECK(PICCommonClass, (klass), TYPE_PIC_COMMON)
 #define PIC_COMMON_GET_CLASS(obj) \
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============0777117314996870189==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0777117314996870189==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:36 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQI7-0003xC-QJ; Tue, 11 Dec 2012 13:54:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQI6-0003wt-OX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:34 +0000
Received: from [193.109.254.147:58941] by server-16.bemta-14.messagelabs.com
	id 81/7D-09215-A1B37C05; Tue, 11 Dec 2012 13:54:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1355234070!4490262!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14142 invoked from network); 11 Dec 2012 13:54:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQI1-0001TP-T5
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQI1-0005tx-Kc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:29 +0000
Date: Tue, 11 Dec 2012 13:54:29 +0000
Message-Id: <E1TiQI1-0005tx-Kc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-rng: use
	virtqueue_get_avail_bytes, fix migration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 14417039653d3293a795646730a7bf5055d78709
Author: Amit Shah <amit.shah@redhat.com>
Date:   Wed Nov 21 11:21:18 2012 +0530

    virtio-rng: use virtqueue_get_avail_bytes, fix migration
    
    Popping an elem from the vq just to find out its length causes problems
    with save/load later on.  Use the new virtqueue_get_avail_bytes()
    function instead, saves us the complexity in the migration code, as well
    as makes the migration endian-safe.
    
    Signed-off-by: Amit Shah <amit.shah@redhat.com>
    Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c |   76 ++++++++----------------------------------------------
 1 files changed, 12 insertions(+), 64 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index 3ca96c8..6c49bb2 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -22,14 +22,10 @@ typedef struct VirtIORNG {
 
     /* Only one vq - guest puts buffer(s) on it when it needs entropy */
     VirtQueue *vq;
-    VirtQueueElement elem;
 
     /* Config data for the device -- currently only chardev */
     VirtIORNGConf *conf;
 
-    /* Whether we've popped a vq element into 'elem' above */
-    bool popped;
-
     RngBackend *rng;
 
     /* We purposefully don't migrate this state.  The quota will reset on the
@@ -48,17 +44,12 @@ static bool is_guest_ready(VirtIORNG *vrng)
     return false;
 }
 
-static size_t pop_an_elem(VirtIORNG *vrng)
+static size_t get_request_size(VirtQueue *vq)
 {
-    size_t size;
+    unsigned int in, out;
 
-    if (!vrng->popped && !virtqueue_pop(vrng->vq, &vrng->elem)) {
-        return 0;
-    }
-    vrng->popped = true;
-
-    size = iov_size(vrng->elem.in_sg, vrng->elem.in_num);
-    return size;
+    virtqueue_get_avail_bytes(vq, &in, &out);
+    return in;
 }
 
 static void virtio_rng_process(VirtIORNG *vrng);
@@ -67,6 +58,7 @@ static void virtio_rng_process(VirtIORNG *vrng);
 static void chr_read(void *opaque, const void *buf, size_t size)
 {
     VirtIORNG *vrng = opaque;
+    VirtQueueElement elem;
     size_t len;
     int offset;
 
@@ -78,15 +70,14 @@ static void chr_read(void *opaque, const void *buf, size_t size)
 
     offset = 0;
     while (offset < size) {
-        if (!pop_an_elem(vrng)) {
+        if (!virtqueue_pop(vrng->vq, &elem)) {
             break;
         }
-        len = iov_from_buf(vrng->elem.in_sg, vrng->elem.in_num,
+        len = iov_from_buf(elem.in_sg, elem.in_num,
                            0, buf + offset, size - offset);
         offset += len;
 
-        virtqueue_push(vrng->vq, &vrng->elem, len);
-        vrng->popped = false;
+        virtqueue_push(vrng->vq, &elem, len);
     }
     virtio_notify(&vrng->vdev, vrng->vq);
 
@@ -100,21 +91,19 @@ static void chr_read(void *opaque, const void *buf, size_t size)
 
 static void virtio_rng_process(VirtIORNG *vrng)
 {
-    ssize_t size;
+    size_t size;
 
     if (!is_guest_ready(vrng)) {
         return;
     }
 
-    size = pop_an_elem(vrng);
+    size = get_request_size(vrng->vq);
     size = MIN(vrng->quota_remaining, size);
-
-    if (size > 0) {
+    if (size) {
         rng_backend_request_entropy(vrng->rng, size, chr_read, vrng);
     }
 }
 
-
 static void handle_input(VirtIODevice *vdev, VirtQueue *vq)
 {
     VirtIORNG *vrng = DO_UPCAST(VirtIORNG, vdev, vdev);
@@ -131,23 +120,6 @@ static void virtio_rng_save(QEMUFile *f, void *opaque)
     VirtIORNG *vrng = opaque;
 
     virtio_save(&vrng->vdev, f);
-
-    qemu_put_byte(f, vrng->popped);
-    if (vrng->popped) {
-        int i;
-
-        qemu_put_be32(f, vrng->elem.index);
-
-        qemu_put_be32(f, vrng->elem.in_num);
-        for (i = 0; i < vrng->elem.in_num; i++) {
-            qemu_put_be64(f, vrng->elem.in_addr[i]);
-        }
-
-        qemu_put_be32(f, vrng->elem.out_num);
-        for (i = 0; i < vrng->elem.out_num; i++) {
-            qemu_put_be64(f, vrng->elem.out_addr[i]);
-        }
-    }
 }
 
 static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id)
@@ -159,30 +131,6 @@ static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id)
     }
     virtio_load(&vrng->vdev, f);
 
-    vrng->popped = qemu_get_byte(f);
-    if (vrng->popped) {
-        int i;
-
-        vrng->elem.index = qemu_get_be32(f);
-
-        vrng->elem.in_num = qemu_get_be32(f);
-        g_assert(vrng->elem.in_num < VIRTQUEUE_MAX_SIZE);
-        for (i = 0; i < vrng->elem.in_num; i++) {
-            vrng->elem.in_addr[i] = qemu_get_be64(f);
-        }
-
-        vrng->elem.out_num = qemu_get_be32(f);
-        g_assert(vrng->elem.out_num < VIRTQUEUE_MAX_SIZE);
-        for (i = 0; i < vrng->elem.out_num; i++) {
-            vrng->elem.out_addr[i] = qemu_get_be64(f);
-        }
-
-        virtqueue_map_sg(vrng->elem.in_sg, vrng->elem.in_addr,
-                         vrng->elem.in_num, 1);
-        virtqueue_map_sg(vrng->elem.out_sg, vrng->elem.out_addr,
-                         vrng->elem.out_num, 0);
-    }
-
     /* We may have an element ready but couldn't process it due to a quota
        limit.  Make sure to try again after live migration when the quota may
        have been reset.
@@ -232,7 +180,7 @@ VirtIODevice *virtio_rng_init(DeviceState *dev, VirtIORNGConf *conf)
 
     vrng->qdev = dev;
     vrng->conf = conf;
-    vrng->popped = false;
+
     vrng->quota_remaining = vrng->conf->max_bytes;
 
     g_assert_cmpint(vrng->conf->max_bytes, <=, INT64_MAX);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:36 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQI7-0003xC-QJ; Tue, 11 Dec 2012 13:54:35 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQI6-0003wt-OX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:34 +0000
Received: from [193.109.254.147:58941] by server-16.bemta-14.messagelabs.com
	id 81/7D-09215-A1B37C05; Tue, 11 Dec 2012 13:54:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1355234070!4490262!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14142 invoked from network); 11 Dec 2012 13:54:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQI1-0001TP-T5
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQI1-0005tx-Kc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:29 +0000
Date: Tue, 11 Dec 2012 13:54:29 +0000
Message-Id: <E1TiQI1-0005tx-Kc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-rng: use
	virtqueue_get_avail_bytes, fix migration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 14417039653d3293a795646730a7bf5055d78709
Author: Amit Shah <amit.shah@redhat.com>
Date:   Wed Nov 21 11:21:18 2012 +0530

    virtio-rng: use virtqueue_get_avail_bytes, fix migration
    
    Popping an elem from the vq just to find out its length causes problems
    with save/load later on.  Use the new virtqueue_get_avail_bytes()
    function instead, saves us the complexity in the migration code, as well
    as makes the migration endian-safe.
    
    Signed-off-by: Amit Shah <amit.shah@redhat.com>
    Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c |   76 ++++++++----------------------------------------------
 1 files changed, 12 insertions(+), 64 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index 3ca96c8..6c49bb2 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -22,14 +22,10 @@ typedef struct VirtIORNG {
 
     /* Only one vq - guest puts buffer(s) on it when it needs entropy */
     VirtQueue *vq;
-    VirtQueueElement elem;
 
     /* Config data for the device -- currently only chardev */
     VirtIORNGConf *conf;
 
-    /* Whether we've popped a vq element into 'elem' above */
-    bool popped;
-
     RngBackend *rng;
 
     /* We purposefully don't migrate this state.  The quota will reset on the
@@ -48,17 +44,12 @@ static bool is_guest_ready(VirtIORNG *vrng)
     return false;
 }
 
-static size_t pop_an_elem(VirtIORNG *vrng)
+static size_t get_request_size(VirtQueue *vq)
 {
-    size_t size;
+    unsigned int in, out;
 
-    if (!vrng->popped && !virtqueue_pop(vrng->vq, &vrng->elem)) {
-        return 0;
-    }
-    vrng->popped = true;
-
-    size = iov_size(vrng->elem.in_sg, vrng->elem.in_num);
-    return size;
+    virtqueue_get_avail_bytes(vq, &in, &out);
+    return in;
 }
 
 static void virtio_rng_process(VirtIORNG *vrng);
@@ -67,6 +58,7 @@ static void virtio_rng_process(VirtIORNG *vrng);
 static void chr_read(void *opaque, const void *buf, size_t size)
 {
     VirtIORNG *vrng = opaque;
+    VirtQueueElement elem;
     size_t len;
     int offset;
 
@@ -78,15 +70,14 @@ static void chr_read(void *opaque, const void *buf, size_t size)
 
     offset = 0;
     while (offset < size) {
-        if (!pop_an_elem(vrng)) {
+        if (!virtqueue_pop(vrng->vq, &elem)) {
             break;
         }
-        len = iov_from_buf(vrng->elem.in_sg, vrng->elem.in_num,
+        len = iov_from_buf(elem.in_sg, elem.in_num,
                            0, buf + offset, size - offset);
         offset += len;
 
-        virtqueue_push(vrng->vq, &vrng->elem, len);
-        vrng->popped = false;
+        virtqueue_push(vrng->vq, &elem, len);
     }
     virtio_notify(&vrng->vdev, vrng->vq);
 
@@ -100,21 +91,19 @@ static void chr_read(void *opaque, const void *buf, size_t size)
 
 static void virtio_rng_process(VirtIORNG *vrng)
 {
-    ssize_t size;
+    size_t size;
 
     if (!is_guest_ready(vrng)) {
         return;
     }
 
-    size = pop_an_elem(vrng);
+    size = get_request_size(vrng->vq);
     size = MIN(vrng->quota_remaining, size);
-
-    if (size > 0) {
+    if (size) {
         rng_backend_request_entropy(vrng->rng, size, chr_read, vrng);
     }
 }
 
-
 static void handle_input(VirtIODevice *vdev, VirtQueue *vq)
 {
     VirtIORNG *vrng = DO_UPCAST(VirtIORNG, vdev, vdev);
@@ -131,23 +120,6 @@ static void virtio_rng_save(QEMUFile *f, void *opaque)
     VirtIORNG *vrng = opaque;
 
     virtio_save(&vrng->vdev, f);
-
-    qemu_put_byte(f, vrng->popped);
-    if (vrng->popped) {
-        int i;
-
-        qemu_put_be32(f, vrng->elem.index);
-
-        qemu_put_be32(f, vrng->elem.in_num);
-        for (i = 0; i < vrng->elem.in_num; i++) {
-            qemu_put_be64(f, vrng->elem.in_addr[i]);
-        }
-
-        qemu_put_be32(f, vrng->elem.out_num);
-        for (i = 0; i < vrng->elem.out_num; i++) {
-            qemu_put_be64(f, vrng->elem.out_addr[i]);
-        }
-    }
 }
 
 static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id)
@@ -159,30 +131,6 @@ static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id)
     }
     virtio_load(&vrng->vdev, f);
 
-    vrng->popped = qemu_get_byte(f);
-    if (vrng->popped) {
-        int i;
-
-        vrng->elem.index = qemu_get_be32(f);
-
-        vrng->elem.in_num = qemu_get_be32(f);
-        g_assert(vrng->elem.in_num < VIRTQUEUE_MAX_SIZE);
-        for (i = 0; i < vrng->elem.in_num; i++) {
-            vrng->elem.in_addr[i] = qemu_get_be64(f);
-        }
-
-        vrng->elem.out_num = qemu_get_be32(f);
-        g_assert(vrng->elem.out_num < VIRTQUEUE_MAX_SIZE);
-        for (i = 0; i < vrng->elem.out_num; i++) {
-            vrng->elem.out_addr[i] = qemu_get_be64(f);
-        }
-
-        virtqueue_map_sg(vrng->elem.in_sg, vrng->elem.in_addr,
-                         vrng->elem.in_num, 1);
-        virtqueue_map_sg(vrng->elem.out_sg, vrng->elem.out_addr,
-                         vrng->elem.out_num, 0);
-    }
-
     /* We may have an element ready but couldn't process it due to a quota
        limit.  Make sure to try again after live migration when the quota may
        have been reset.
@@ -232,7 +180,7 @@ VirtIODevice *virtio_rng_init(DeviceState *dev, VirtIORNGConf *conf)
 
     vrng->qdev = dev;
     vrng->conf = conf;
-    vrng->popped = false;
+
     vrng->quota_remaining = vrng->conf->max_bytes;
 
     g_assert_cmpint(vrng->conf->max_bytes, <=, INT64_MAX);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQIF-0003zC-Uz; Tue, 11 Dec 2012 13:54:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIE-0003yo-L0
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:42 +0000
Received: from [193.109.254.147:59361] by server-8.bemta-14.messagelabs.com id
	0C/92-05026-22B37C05; Tue, 11 Dec 2012 13:54:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1355234080!4959860!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24891 invoked from network); 11 Dec 2012 13:54:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIC-0001Tb-7T
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIC-0005uu-3I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:40 +0000
Date: Tue, 11 Dec 2012 13:54:40 +0000
Message-Id: <E1TiQIC-0005uu-3I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-rng: remove extra
	request for entropy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4621c1768ef5d12171cca2aa1473595ecb9f1c9e
Author: Amit Shah <amit.shah@redhat.com>
Date:   Wed Nov 21 11:21:19 2012 +0530

    virtio-rng: remove extra request for entropy
    
    If we got fewer bytes from the backend than requested, don't poke the
    backend for more bytes; the guest will ask for more (or if the guest has
    already asked for more, the backend knows about it via handle_input()).
    
    Signed-off-by: Amit Shah <amit.shah@redhat.com>
    Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index 6c49bb2..cf5a8ff 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -80,13 +80,6 @@ static void chr_read(void *opaque, const void *buf, size_t size)
         virtqueue_push(vrng->vq, &elem, len);
     }
     virtio_notify(&vrng->vdev, vrng->vq);
-
-    /*
-     * Lastly, if we had multiple elems queued by the guest, and we
-     * didn't have enough data to fill them all, indicate we want more
-     * data.
-     */
-    virtio_rng_process(vrng);
 }
 
 static void virtio_rng_process(VirtIORNG *vrng)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQIF-0003zC-Uz; Tue, 11 Dec 2012 13:54:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIE-0003yo-L0
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:42 +0000
Received: from [193.109.254.147:59361] by server-8.bemta-14.messagelabs.com id
	0C/92-05026-22B37C05; Tue, 11 Dec 2012 13:54:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1355234080!4959860!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24891 invoked from network); 11 Dec 2012 13:54:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIC-0001Tb-7T
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIC-0005uu-3I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:40 +0000
Date: Tue, 11 Dec 2012 13:54:40 +0000
Message-Id: <E1TiQIC-0005uu-3I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-rng: remove extra
	request for entropy
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4621c1768ef5d12171cca2aa1473595ecb9f1c9e
Author: Amit Shah <amit.shah@redhat.com>
Date:   Wed Nov 21 11:21:19 2012 +0530

    virtio-rng: remove extra request for entropy
    
    If we got fewer bytes from the backend than requested, don't poke the
    backend for more bytes; the guest will ask for more (or if the guest has
    already asked for more, the backend knows about it via handle_input()).
    
    Signed-off-by: Amit Shah <amit.shah@redhat.com>
    Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index 6c49bb2..cf5a8ff 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -80,13 +80,6 @@ static void chr_read(void *opaque, const void *buf, size_t size)
         virtqueue_push(vrng->vq, &elem, len);
     }
     virtio_notify(&vrng->vdev, vrng->vq);
-
-    /*
-     * Lastly, if we had multiple elems queued by the guest, and we
-     * didn't have enough data to fill them all, indicate we want more
-     * data.
-     */
-    virtio_rng_process(vrng);
 }
 
 static void virtio_rng_process(VirtIORNG *vrng)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQIQ-000412-1m; Tue, 11 Dec 2012 13:54:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIP-00040h-1G
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:53 +0000
Received: from [85.158.143.99:56949] by server-2.bemta-4.messagelabs.com id
	61/C0-30861-C2B37C05; Tue, 11 Dec 2012 13:54:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1355234090!28018637!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16263 invoked from network); 11 Dec 2012 13:54:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIM-0001Tk-HV
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIM-0005vI-CY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:50 +0000
Date: Tue, 11 Dec 2012 13:54:50 +0000
Message-Id: <E1TiQIM-0005vI-CY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-rng: disable timer
	on device removal
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8cc677435498561d8fe213bb44a02cf4f75cc685
Author: Amit Shah <amit.shah@redhat.com>
Date:   Wed Nov 21 11:21:20 2012 +0530

    virtio-rng: disable timer on device removal
    
    Disable the rate-limit timer on device remove (e.g. hot-unplug).
    
    Signed-off-by: Amit Shah <amit.shah@redhat.com>
    Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index cf5a8ff..c8a6da7 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -194,6 +194,8 @@ void virtio_rng_exit(VirtIODevice *vdev)
 {
     VirtIORNG *vrng = DO_UPCAST(VirtIORNG, vdev, vdev);
 
+    qemu_del_timer(vrng->rate_limit_timer);
+    qemu_free_timer(vrng->rate_limit_timer);
     unregister_savevm(vrng->qdev, "virtio-rng", vrng);
     virtio_cleanup(vdev);
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:54:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:54:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQIQ-000412-1m; Tue, 11 Dec 2012 13:54:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIP-00040h-1G
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:53 +0000
Received: from [85.158.143.99:56949] by server-2.bemta-4.messagelabs.com id
	61/C0-30861-C2B37C05; Tue, 11 Dec 2012 13:54:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1355234090!28018637!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16263 invoked from network); 11 Dec 2012 13:54:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:54:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIM-0001Tk-HV
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIM-0005vI-CY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:54:50 +0000
Date: Tue, 11 Dec 2012 13:54:50 +0000
Message-Id: <E1TiQIM-0005vI-CY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-rng: disable timer
	on device removal
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8cc677435498561d8fe213bb44a02cf4f75cc685
Author: Amit Shah <amit.shah@redhat.com>
Date:   Wed Nov 21 11:21:20 2012 +0530

    virtio-rng: disable timer on device removal
    
    Disable the rate-limit timer on device remove (e.g. hot-unplug).
    
    Signed-off-by: Amit Shah <amit.shah@redhat.com>
    Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index cf5a8ff..c8a6da7 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -194,6 +194,8 @@ void virtio_rng_exit(VirtIODevice *vdev)
 {
     VirtIORNG *vrng = DO_UPCAST(VirtIORNG, vdev, vdev);
 
+    qemu_del_timer(vrng->rate_limit_timer);
+    qemu_free_timer(vrng->rate_limit_timer);
     unregister_savevm(vrng->qdev, "virtio-rng", vrng);
     virtio_cleanup(vdev);
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:55:07 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:55:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQId-00043b-4o; Tue, 11 Dec 2012 13:55:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIb-00043E-Rf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:06 +0000
Received: from [85.158.139.211:54410] by server-5.bemta-5.messagelabs.com id
	42/5F-22648-93B37C05; Tue, 11 Dec 2012 13:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1355234102!18238138!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22831 invoked from network); 11 Dec 2012 13:55:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIX-0001Tt-1f
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIW-0005vi-MZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:00 +0000
Date: Tue, 11 Dec 2012 13:55:00 +0000
Message-Id: <E1TiQIW-0005vi-MZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-rng: fix typos,
	comments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 42015c9acb9fb418c97c42f6e0d44c84999c769d
Author: Amit Shah <amit.shah@redhat.com>
Date:   Wed Nov 21 11:21:21 2012 +0530

    virtio-rng: fix typos, comments
    
    Fix typos, whitespace and update comments to match current
    implementation.
    
    Signed-off-by: Amit Shah <amit.shah@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c    |    7 +++----
 include/qemu/rng.h |    6 +++---
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index c8a6da7..f4ed9cf 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -23,7 +23,6 @@ typedef struct VirtIORNG {
     /* Only one vq - guest puts buffer(s) on it when it needs entropy */
     VirtQueue *vq;
 
-    /* Config data for the device -- currently only chardev */
     VirtIORNGConf *conf;
 
     RngBackend *rng;
@@ -125,9 +124,9 @@ static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id)
     virtio_load(&vrng->vdev, f);
 
     /* We may have an element ready but couldn't process it due to a quota
-       limit.  Make sure to try again after live migration when the quota may
-       have been reset.
-    */
+     * limit.  Make sure to try again after live migration when the quota may
+     * have been reset.
+     */
     virtio_rng_process(vrng);
 
     return 0;
diff --git a/include/qemu/rng.h b/include/qemu/rng.h
index 7e9d672..d094bf8 100644
--- a/include/qemu/rng.h
+++ b/include/qemu/rng.h
@@ -61,10 +61,10 @@ struct RngBackend
  * This function is used by the front-end to request entropy from an entropy
  * source.  This function can be called multiple times before @receive_entropy
  * is invoked with different values of @receive_entropy and @opaque.  The
- * backend will queue each request and handle appropriate.
+ * backend will queue each request and handle appropriately.
  *
  * The backend does not need to pass the full amount of data to @receive_entropy
- * but will pass at a value greater than 0.
+ * but will pass a value greater than 0.
  */
 void rng_backend_request_entropy(RngBackend *s, size_t size,
                                  EntropyReceiveFunc *receive_entropy,
@@ -87,7 +87,7 @@ void rng_backend_cancel_requests(RngBackend *s);
  *
  * This function will open the backend if it is not already open.  Calling this
  * function on an already opened backend will not result in an error.
- */ 
+ */
 void rng_backend_open(RngBackend *s, Error **errp);
 
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:55:07 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:55:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQId-00043b-4o; Tue, 11 Dec 2012 13:55:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIb-00043E-Rf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:06 +0000
Received: from [85.158.139.211:54410] by server-5.bemta-5.messagelabs.com id
	42/5F-22648-93B37C05; Tue, 11 Dec 2012 13:55:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1355234102!18238138!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22831 invoked from network); 11 Dec 2012 13:55:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIX-0001Tt-1f
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIW-0005vi-MZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:00 +0000
Date: Tue, 11 Dec 2012 13:55:00 +0000
Message-Id: <E1TiQIW-0005vi-MZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-rng: fix typos,
	comments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 42015c9acb9fb418c97c42f6e0d44c84999c769d
Author: Amit Shah <amit.shah@redhat.com>
Date:   Wed Nov 21 11:21:21 2012 +0530

    virtio-rng: fix typos, comments
    
    Fix typos, whitespace and update comments to match current
    implementation.
    
    Signed-off-by: Amit Shah <amit.shah@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c    |    7 +++----
 include/qemu/rng.h |    6 +++---
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index c8a6da7..f4ed9cf 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -23,7 +23,6 @@ typedef struct VirtIORNG {
     /* Only one vq - guest puts buffer(s) on it when it needs entropy */
     VirtQueue *vq;
 
-    /* Config data for the device -- currently only chardev */
     VirtIORNGConf *conf;
 
     RngBackend *rng;
@@ -125,9 +124,9 @@ static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id)
     virtio_load(&vrng->vdev, f);
 
     /* We may have an element ready but couldn't process it due to a quota
-       limit.  Make sure to try again after live migration when the quota may
-       have been reset.
-    */
+     * limit.  Make sure to try again after live migration when the quota may
+     * have been reset.
+     */
     virtio_rng_process(vrng);
 
     return 0;
diff --git a/include/qemu/rng.h b/include/qemu/rng.h
index 7e9d672..d094bf8 100644
--- a/include/qemu/rng.h
+++ b/include/qemu/rng.h
@@ -61,10 +61,10 @@ struct RngBackend
  * This function is used by the front-end to request entropy from an entropy
  * source.  This function can be called multiple times before @receive_entropy
  * is invoked with different values of @receive_entropy and @opaque.  The
- * backend will queue each request and handle appropriate.
+ * backend will queue each request and handle appropriately.
  *
  * The backend does not need to pass the full amount of data to @receive_entropy
- * but will pass at a value greater than 0.
+ * but will pass a value greater than 0.
  */
 void rng_backend_request_entropy(RngBackend *s, size_t size,
                                  EntropyReceiveFunc *receive_entropy,
@@ -87,7 +87,7 @@ void rng_backend_cancel_requests(RngBackend *s);
  *
  * This function will open the backend if it is not already open.  Calling this
  * function on an already opened backend will not result in an error.
- */ 
+ */
 void rng_backend_open(RngBackend *s, Error **errp);
 
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQIo-00045W-7z; Tue, 11 Dec 2012 13:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIm-00045D-P3
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:16 +0000
Received: from [85.158.143.99:55293] by server-1.bemta-4.messagelabs.com id
	1E/81-28401-44B37C05; Tue, 11 Dec 2012 13:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1355234111!21958488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6217 invoked from network); 11 Dec 2012 13:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIh-0001UY-9U
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIh-0005wG-5u
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:11 +0000
Date: Tue, 11 Dec 2012 13:55:11 +0000
Message-Id: <E1TiQIh-0005wG-5u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Update version for
	1.3.0-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1e1d71a582c60b7c435b05934423c87f83eab542
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 15:13:31 2012 -0600

    Update version for 1.3.0-rc1
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 VERSION |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/VERSION b/VERSION
index 2d04904..1ec5aef 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.90
+1.2.91
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQIo-00045W-7z; Tue, 11 Dec 2012 13:55:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIm-00045D-P3
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:16 +0000
Received: from [85.158.143.99:55293] by server-1.bemta-4.messagelabs.com id
	1E/81-28401-44B37C05; Tue, 11 Dec 2012 13:55:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1355234111!21958488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6217 invoked from network); 11 Dec 2012 13:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIh-0001UY-9U
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIh-0005wG-5u
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:11 +0000
Date: Tue, 11 Dec 2012 13:55:11 +0000
Message-Id: <E1TiQIh-0005wG-5u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Update version for
	1.3.0-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1e1d71a582c60b7c435b05934423c87f83eab542
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Nov 26 15:13:31 2012 -0600

    Update version for 1.3.0-rc1
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 VERSION |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/VERSION b/VERSION
index 2d04904..1ec5aef 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.90
+1.2.91
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:55:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQIw-00046r-B8; Tue, 11 Dec 2012 13:55:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIu-00046Y-Qz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:25 +0000
Received: from [85.158.138.51:20656] by server-14.bemta-3.messagelabs.com id
	F0/A1-27443-C4B37C05; Tue, 11 Dec 2012 13:55:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1355234122!9742318!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15223 invoked from network); 11 Dec 2012 13:55:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIr-0001Ub-NE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIr-0005we-EY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:21 +0000
Date: Tue, 11 Dec 2012 13:55:21 +0000
Message-Id: <E1TiQIr-0005we-EY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tests: make threadpool
	cancellation test looser
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d60478c59a348886d82492861c5cd4fba572ebd5
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Tue Nov 27 09:51:48 2012 +0100

    tests: make threadpool cancellation test looser
    
    The cancellation test is failing on the buildbots.  While the failure
    merits a little more investigation to understand what is going on,
    the logs show that the failure is not impacting the coverage
    provided by the test.  Hence, loosen a bit the assertions in a
    way that should let the test proceed and hopefully pass.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 tests/test-thread-pool.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/test-thread-pool.c b/tests/test-thread-pool.c
index 484c5b3..fea0445 100644
--- a/tests/test-thread-pool.c
+++ b/tests/test-thread-pool.c
@@ -134,6 +134,7 @@ static void test_submit_many(void)
 static void test_cancel(void)
 {
     WorkerTestData data[100];
+    int num_canceled;
     int i;
 
     /* Start more work items than there will be threads, to ensure
@@ -163,15 +164,17 @@ static void test_cancel(void)
     g_assert_cmpint(active, >, 50);
 
     /* Cancel the jobs that haven't been started yet.  */
+    num_canceled = 0;
     for (i = 0; i < 100; i++) {
         if (__sync_val_compare_and_swap(&data[i].n, 0, 3) == 0) {
             data[i].ret = -ECANCELED;
             bdrv_aio_cancel(data[i].aiocb);
             active--;
+            num_canceled++;
         }
     }
-    g_assert_cmpint(active, >, 5);
-    g_assert_cmpint(active, <, 95);
+    g_assert_cmpint(active, >, 0);
+    g_assert_cmpint(num_canceled, <, 100);
 
     /* Canceling the others will be a blocking operation.  */
     for (i = 0; i < 100; i++) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:55:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQIw-00046r-B8; Tue, 11 Dec 2012 13:55:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIu-00046Y-Qz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:25 +0000
Received: from [85.158.138.51:20656] by server-14.bemta-3.messagelabs.com id
	F0/A1-27443-C4B37C05; Tue, 11 Dec 2012 13:55:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1355234122!9742318!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15223 invoked from network); 11 Dec 2012 13:55:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIr-0001Ub-NE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQIr-0005we-EY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:21 +0000
Date: Tue, 11 Dec 2012 13:55:21 +0000
Message-Id: <E1TiQIr-0005we-EY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] tests: make threadpool
	cancellation test looser
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d60478c59a348886d82492861c5cd4fba572ebd5
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Tue Nov 27 09:51:48 2012 +0100

    tests: make threadpool cancellation test looser
    
    The cancellation test is failing on the buildbots.  While the failure
    merits a little more investigation to understand what is going on,
    the logs show that the failure is not impacting the coverage
    provided by the test.  Hence, loosen a bit the assertions in a
    way that should let the test proceed and hopefully pass.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 tests/test-thread-pool.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/test-thread-pool.c b/tests/test-thread-pool.c
index 484c5b3..fea0445 100644
--- a/tests/test-thread-pool.c
+++ b/tests/test-thread-pool.c
@@ -134,6 +134,7 @@ static void test_submit_many(void)
 static void test_cancel(void)
 {
     WorkerTestData data[100];
+    int num_canceled;
     int i;
 
     /* Start more work items than there will be threads, to ensure
@@ -163,15 +164,17 @@ static void test_cancel(void)
     g_assert_cmpint(active, >, 50);
 
     /* Cancel the jobs that haven't been started yet.  */
+    num_canceled = 0;
     for (i = 0; i < 100; i++) {
         if (__sync_val_compare_and_swap(&data[i].n, 0, 3) == 0) {
             data[i].ret = -ECANCELED;
             bdrv_aio_cancel(data[i].aiocb);
             active--;
+            num_canceled++;
         }
     }
-    g_assert_cmpint(active, >, 5);
-    g_assert_cmpint(active, <, 95);
+    g_assert_cmpint(active, >, 0);
+    g_assert_cmpint(num_canceled, <, 100);
 
     /* Canceling the others will be a blocking operation.  */
     for (i = 0; i < 100; i++) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:55:48 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQJI-0004AL-ES; Tue, 11 Dec 2012 13:55:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJH-0004A8-QE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:47 +0000
Received: from [85.158.143.35:37243] by server-3.bemta-4.messagelabs.com id
	A0/B9-18211-36B37C05; Tue, 11 Dec 2012 13:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1355234143!10201667!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14957 invoked from network); 11 Dec 2012 13:55:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJC-0001Up-Sh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJC-0005yD-GU
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:42 +0000
Date: Tue, 11 Dec 2012 13:55:42 +0000
Message-Id: <E1TiQJC-0005yD-GU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] rtc: Only call
	rtc_set_cmos when Register B SET flag is disabled.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 02c6ccc6dde90dcbf5975b1cfe2ab199e525ec11
Author: Alex Horn <alex.horn@cs.ox.ac.uk>
Date:   Mon Nov 26 17:32:54 2012 +0100

    rtc: Only call rtc_set_cmos when Register B SET flag is disabled.
    
    This bug occurs when the SET flag of Register B is enabled. When an RTC
    data register (i.e. any of the ten time/calender CMOS bytes) is set, the
    data is (as expected) correctly stored in the cmos_data array. However,
    since the SET flag is enabled, the function rtc_set_time is not invoked.
    As a result, the field base_rtc in RTCState remains uninitialized. This
    causes a problem on subsequent writes which can end up overwriting data.
    To see this, consider writing data to Register A after having written
    data to any of the RTC data registers; the following figure illustrates
    the call stack for the Register A write operation:
    
     +- cmos_io_port_write
     +-- check_update_timer
     +---- get_next_alarm
     +------ rtc_update_time
    
    In rtc_update_time, get_guest_rtc calculates the wrong time and
    overwrites the previously written RTC data register values.
    
    Signed-off-by: Alex Horn <alex.horn@cs.ox.ac.uk>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/mc146818rtc.c |    6 +++++-
 tests/rtc-test.c |   40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 7d84ce3..c79fca7 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -570,7 +570,11 @@ static void rtc_update_time(RTCState *s)
     guest_nsec = get_guest_rtc_ns(s);
     guest_sec = guest_nsec / NSEC_PER_SEC;
     gmtime_r(&guest_sec, &ret);
-    rtc_set_cmos(s, &ret);
+
+    /* Is SET flag of Register B disabled? */
+    if ((s->cmos_data[RTC_REG_B] & REG_B_SET) == 0) {
+        rtc_set_cmos(s, &ret);
+    }
 }
 
 static int update_in_progress(RTCState *s)
diff --git a/tests/rtc-test.c b/tests/rtc-test.c
index 7fdc94a..02edbf5 100644
--- a/tests/rtc-test.c
+++ b/tests/rtc-test.c
@@ -327,6 +327,45 @@ static void fuzz_registers(void)
     }
 }
 
+static void register_b_set_flag(void)
+{
+    /* Enable binary-coded decimal (BCD) mode and SET flag in Register B*/
+    cmos_write(RTC_REG_B, (cmos_read(RTC_REG_B) & ~REG_B_DM) | REG_B_SET);
+
+    cmos_write(RTC_REG_A, 0x76);
+    cmos_write(RTC_YEAR, 0x11);
+    cmos_write(RTC_CENTURY, 0x20);
+    cmos_write(RTC_MONTH, 0x02);
+    cmos_write(RTC_DAY_OF_MONTH, 0x02);
+    cmos_write(RTC_HOURS, 0x02);
+    cmos_write(RTC_MINUTES, 0x04);
+    cmos_write(RTC_SECONDS, 0x58);
+    cmos_write(RTC_REG_A, 0x26);
+
+    /* Since SET flag is still enabled, these are equality checks. */
+    g_assert_cmpint(cmos_read(RTC_HOURS), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_MINUTES), ==, 0x04);
+    g_assert_cmpint(cmos_read(RTC_SECONDS), ==, 0x58);
+    g_assert_cmpint(cmos_read(RTC_DAY_OF_MONTH), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_MONTH), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x11);
+    g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x20);
+
+    /* Disable SET flag in Register B */
+    cmos_write(RTC_REG_B, cmos_read(RTC_REG_B) & ~REG_B_SET);
+
+    g_assert_cmpint(cmos_read(RTC_HOURS), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_MINUTES), ==, 0x04);
+
+    /* Since SET flag is disabled, this is an inequality check.
+     * We (reasonably) assume that no (sexagesimal) overflow occurs. */
+    g_assert_cmpint(cmos_read(RTC_SECONDS), >=, 0x58);
+    g_assert_cmpint(cmos_read(RTC_DAY_OF_MONTH), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_MONTH), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x11);
+    g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x20);
+}
+
 int main(int argc, char **argv)
 {
     QTestState *s = NULL;
@@ -342,6 +381,7 @@ int main(int argc, char **argv)
     qtest_add_func("/rtc/alarm-time", alarm_time);
     qtest_add_func("/rtc/set-year/20xx", set_year_20xx);
     qtest_add_func("/rtc/set-year/1980", set_year_1980);
+    qtest_add_func("/rtc/register_b_set_flag", register_b_set_flag);
     qtest_add_func("/rtc/fuzz-registers", fuzz_registers);
     ret = g_test_run();
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:55:48 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQJI-0004AL-ES; Tue, 11 Dec 2012 13:55:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJH-0004A8-QE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:47 +0000
Received: from [85.158.143.35:37243] by server-3.bemta-4.messagelabs.com id
	A0/B9-18211-36B37C05; Tue, 11 Dec 2012 13:55:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1355234143!10201667!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14957 invoked from network); 11 Dec 2012 13:55:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJC-0001Up-Sh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJC-0005yD-GU
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:42 +0000
Date: Tue, 11 Dec 2012 13:55:42 +0000
Message-Id: <E1TiQJC-0005yD-GU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] rtc: Only call
	rtc_set_cmos when Register B SET flag is disabled.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 02c6ccc6dde90dcbf5975b1cfe2ab199e525ec11
Author: Alex Horn <alex.horn@cs.ox.ac.uk>
Date:   Mon Nov 26 17:32:54 2012 +0100

    rtc: Only call rtc_set_cmos when Register B SET flag is disabled.
    
    This bug occurs when the SET flag of Register B is enabled. When an RTC
    data register (i.e. any of the ten time/calender CMOS bytes) is set, the
    data is (as expected) correctly stored in the cmos_data array. However,
    since the SET flag is enabled, the function rtc_set_time is not invoked.
    As a result, the field base_rtc in RTCState remains uninitialized. This
    causes a problem on subsequent writes which can end up overwriting data.
    To see this, consider writing data to Register A after having written
    data to any of the RTC data registers; the following figure illustrates
    the call stack for the Register A write operation:
    
     +- cmos_io_port_write
     +-- check_update_timer
     +---- get_next_alarm
     +------ rtc_update_time
    
    In rtc_update_time, get_guest_rtc calculates the wrong time and
    overwrites the previously written RTC data register values.
    
    Signed-off-by: Alex Horn <alex.horn@cs.ox.ac.uk>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/mc146818rtc.c |    6 +++++-
 tests/rtc-test.c |   40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 7d84ce3..c79fca7 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -570,7 +570,11 @@ static void rtc_update_time(RTCState *s)
     guest_nsec = get_guest_rtc_ns(s);
     guest_sec = guest_nsec / NSEC_PER_SEC;
     gmtime_r(&guest_sec, &ret);
-    rtc_set_cmos(s, &ret);
+
+    /* Is SET flag of Register B disabled? */
+    if ((s->cmos_data[RTC_REG_B] & REG_B_SET) == 0) {
+        rtc_set_cmos(s, &ret);
+    }
 }
 
 static int update_in_progress(RTCState *s)
diff --git a/tests/rtc-test.c b/tests/rtc-test.c
index 7fdc94a..02edbf5 100644
--- a/tests/rtc-test.c
+++ b/tests/rtc-test.c
@@ -327,6 +327,45 @@ static void fuzz_registers(void)
     }
 }
 
+static void register_b_set_flag(void)
+{
+    /* Enable binary-coded decimal (BCD) mode and SET flag in Register B*/
+    cmos_write(RTC_REG_B, (cmos_read(RTC_REG_B) & ~REG_B_DM) | REG_B_SET);
+
+    cmos_write(RTC_REG_A, 0x76);
+    cmos_write(RTC_YEAR, 0x11);
+    cmos_write(RTC_CENTURY, 0x20);
+    cmos_write(RTC_MONTH, 0x02);
+    cmos_write(RTC_DAY_OF_MONTH, 0x02);
+    cmos_write(RTC_HOURS, 0x02);
+    cmos_write(RTC_MINUTES, 0x04);
+    cmos_write(RTC_SECONDS, 0x58);
+    cmos_write(RTC_REG_A, 0x26);
+
+    /* Since SET flag is still enabled, these are equality checks. */
+    g_assert_cmpint(cmos_read(RTC_HOURS), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_MINUTES), ==, 0x04);
+    g_assert_cmpint(cmos_read(RTC_SECONDS), ==, 0x58);
+    g_assert_cmpint(cmos_read(RTC_DAY_OF_MONTH), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_MONTH), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x11);
+    g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x20);
+
+    /* Disable SET flag in Register B */
+    cmos_write(RTC_REG_B, cmos_read(RTC_REG_B) & ~REG_B_SET);
+
+    g_assert_cmpint(cmos_read(RTC_HOURS), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_MINUTES), ==, 0x04);
+
+    /* Since SET flag is disabled, this is an inequality check.
+     * We (reasonably) assume that no (sexagesimal) overflow occurs. */
+    g_assert_cmpint(cmos_read(RTC_SECONDS), >=, 0x58);
+    g_assert_cmpint(cmos_read(RTC_DAY_OF_MONTH), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_MONTH), ==, 0x02);
+    g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x11);
+    g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x20);
+}
+
 int main(int argc, char **argv)
 {
     QTestState *s = NULL;
@@ -342,6 +381,7 @@ int main(int argc, char **argv)
     qtest_add_func("/rtc/alarm-time", alarm_time);
     qtest_add_func("/rtc/set-year/20xx", set_year_20xx);
     qtest_add_func("/rtc/set-year/1980", set_year_1980);
+    qtest_add_func("/rtc/register_b_set_flag", register_b_set_flag);
     qtest_add_func("/rtc/fuzz-registers", fuzz_registers);
     ret = g_test_run();
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:55:58 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:55:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQJR-0004Bl-HP; Tue, 11 Dec 2012 13:55:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJQ-0004BT-Oy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:56 +0000
Received: from [85.158.137.99:18025] by server-2.bemta-3.messagelabs.com id
	CB/EC-11239-B6B37C05; Tue, 11 Dec 2012 13:55:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1355234153!18583502!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27510 invoked from network); 11 Dec 2012 13:55:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJN-0001Uv-9K
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJN-0005yb-23
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:53 +0000
Date: Tue, 11 Dec 2012 13:55:53 +0000
Message-Id: <E1TiQJN-0005yb-23@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] build: compile translate.o
	with -fno-gcse option on GCC 4.6.x and 4.7.[012]
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cbdd1999daf2341b33d3ba8036fd84898e1e7c31
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Wed Nov 28 09:40:23 2012 +0100

    build: compile translate.o with -fno-gcse option on GCC 4.6.x and 4.7.[012]
    
    These versions of GCC require insane (>2GB) amounts of memory to compile
    translate.o.  As a countermeasure, disable the culprit optimization pass.
    This should fix the buildbot failure for default_x86_64_fedora16.  Anyway
    this is a good thing to do because people will try to compile 1.3 with
    less than 2GB of memory and complain.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 Makefile.target |    3 +++
 configure       |   16 ++++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/Makefile.target b/Makefile.target
index 8b658c0..927347b 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -143,6 +143,9 @@ GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
 
 endif # CONFIG_SOFTMMU
 
+# Workaround for http://gcc.gnu.org/PR55489, see configure.
+%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
+
 nested-vars += obj-y
 
 # This resolves all nested paths, so it must come last
diff --git a/configure b/configure
index 780b19a..994f731 100755
--- a/configure
+++ b/configure
@@ -1183,6 +1183,21 @@ for flag in $gcc_flags; do
     fi
 done
 
+# Workaround for http://gcc.gnu.org/PR55489.  Happens with -fPIE/-fPIC and
+# large functions that use global variables.  The bug is in all releases of
+# GCC, but it became particularly acute in 4.6.x and 4.7.x.  It is fixed in
+# 4.7.3 and 4.8.0.  We should be able to delete this at the end of 2013.
+cat > $TMPC << EOF
+#if __GNUC__ == 4 && (__GNUC_MINOR__ == 6 || (__GNUC_MINOR__ == 7 && __GNUC_PATCHLEVEL__ <= 2))
+int main(void) { return 0; }
+#else
+#error No bug in this compiler.
+#endif
+EOF
+if compile_prog "-Werror -fno-gcse" "" ; then
+  TRANSLATE_OPT_CFLAGS=-fno-gcse
+fi
+
 if test "$static" = "yes" ; then
   if test "$pie" = "yes" ; then
     echo "static and pie are mutually incompatible"
@@ -3662,6 +3677,7 @@ echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
 echo "EXESUF=$EXESUF" >> $config_host_mak
 echo "LIBS_QGA+=$libs_qga" >> $config_host_mak
 echo "POD2MAN=$POD2MAN" >> $config_host_mak
+echo "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak
 
 # generate list of library paths for linker script
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:55:58 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:55:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQJR-0004Bl-HP; Tue, 11 Dec 2012 13:55:57 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJQ-0004BT-Oy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:56 +0000
Received: from [85.158.137.99:18025] by server-2.bemta-3.messagelabs.com id
	CB/EC-11239-B6B37C05; Tue, 11 Dec 2012 13:55:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1355234153!18583502!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27510 invoked from network); 11 Dec 2012 13:55:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJN-0001Uv-9K
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJN-0005yb-23
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:53 +0000
Date: Tue, 11 Dec 2012 13:55:53 +0000
Message-Id: <E1TiQJN-0005yb-23@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] build: compile translate.o
	with -fno-gcse option on GCC 4.6.x and 4.7.[012]
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cbdd1999daf2341b33d3ba8036fd84898e1e7c31
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Wed Nov 28 09:40:23 2012 +0100

    build: compile translate.o with -fno-gcse option on GCC 4.6.x and 4.7.[012]
    
    These versions of GCC require insane (>2GB) amounts of memory to compile
    translate.o.  As a countermeasure, disable the culprit optimization pass.
    This should fix the buildbot failure for default_x86_64_fedora16.  Anyway
    this is a good thing to do because people will try to compile 1.3 with
    less than 2GB of memory and complain.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 Makefile.target |    3 +++
 configure       |   16 ++++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/Makefile.target b/Makefile.target
index 8b658c0..927347b 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -143,6 +143,9 @@ GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
 
 endif # CONFIG_SOFTMMU
 
+# Workaround for http://gcc.gnu.org/PR55489, see configure.
+%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
+
 nested-vars += obj-y
 
 # This resolves all nested paths, so it must come last
diff --git a/configure b/configure
index 780b19a..994f731 100755
--- a/configure
+++ b/configure
@@ -1183,6 +1183,21 @@ for flag in $gcc_flags; do
     fi
 done
 
+# Workaround for http://gcc.gnu.org/PR55489.  Happens with -fPIE/-fPIC and
+# large functions that use global variables.  The bug is in all releases of
+# GCC, but it became particularly acute in 4.6.x and 4.7.x.  It is fixed in
+# 4.7.3 and 4.8.0.  We should be able to delete this at the end of 2013.
+cat > $TMPC << EOF
+#if __GNUC__ == 4 && (__GNUC_MINOR__ == 6 || (__GNUC_MINOR__ == 7 && __GNUC_PATCHLEVEL__ <= 2))
+int main(void) { return 0; }
+#else
+#error No bug in this compiler.
+#endif
+EOF
+if compile_prog "-Werror -fno-gcse" "" ; then
+  TRANSLATE_OPT_CFLAGS=-fno-gcse
+fi
+
 if test "$static" = "yes" ; then
   if test "$pie" = "yes" ; then
     echo "static and pie are mutually incompatible"
@@ -3662,6 +3677,7 @@ echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
 echo "EXESUF=$EXESUF" >> $config_host_mak
 echo "LIBS_QGA+=$libs_qga" >> $config_host_mak
 echo "POD2MAN=$POD2MAN" >> $config_host_mak
+echo "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak
 
 # generate list of library paths for linker script
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:56:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:56:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQJr-0004EX-LY; Tue, 11 Dec 2012 13:56:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJq-0004EI-Iw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:22 +0000
Received: from [85.158.137.99:54698] by server-6.bemta-3.messagelabs.com id
	65/F9-12154-58B37C05; Tue, 11 Dec 2012 13:56:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1355234174!15716684!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31802 invoked from network); 11 Dec 2012 13:56:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJi-0001Va-3f
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJi-0005zo-19
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:14 +0000
Date: Tue, 11 Dec 2012 13:56:14 +0000
Message-Id: <E1TiQJi-0005zo-19@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-i386: Enable SSSE3
	TCG support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4111414557210686693=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4111414557210686693==
Content-Type: text/plain

commit a0a7068104cc9908d0875404b0fa2ebf46e40f97
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sat Nov 24 15:07:01 2012 +0100

    target-i386: Enable SSSE3 TCG support
    
    SSSE3 support has been added to TCG more than 4 years ago in commit
    4242b1bd8acc19aaaacffdaad4ac23213d72a72b. It has been disabled by
    mistake in commit 551a2dec8fa55006a68393b9d6fb63577d2b3f1c.
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
    Signed-off-by: Andreas FÃ¤rber <afaerber@suse.de>
---
 target-i386/cpu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 4fdd4f7..c6c2ca0 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -315,7 +315,7 @@ typedef struct x86_def_t {
           /* missing:
           CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */
 #define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | \
-          CPUID_EXT_CX16 | CPUID_EXT_POPCNT | \
+          CPUID_EXT_SSSE3 | CPUID_EXT_CX16 | CPUID_EXT_POPCNT | \
           CPUID_EXT_HYPERVISOR)
           /* missing:
           CPUID_EXT_DTES64, CPUID_EXT_DSCPL, CPUID_EXT_VMX, CPUID_EXT_EST,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============4111414557210686693==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============4111414557210686693==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:56:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:56:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQJr-0004EX-LY; Tue, 11 Dec 2012 13:56:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJq-0004EI-Iw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:22 +0000
Received: from [85.158.137.99:54698] by server-6.bemta-3.messagelabs.com id
	65/F9-12154-58B37C05; Tue, 11 Dec 2012 13:56:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1355234174!15716684!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31802 invoked from network); 11 Dec 2012 13:56:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJi-0001Va-3f
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJi-0005zo-19
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:14 +0000
Date: Tue, 11 Dec 2012 13:56:14 +0000
Message-Id: <E1TiQJi-0005zo-19@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-i386: Enable SSSE3
	TCG support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4111414557210686693=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4111414557210686693==
Content-Type: text/plain

commit a0a7068104cc9908d0875404b0fa2ebf46e40f97
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sat Nov 24 15:07:01 2012 +0100

    target-i386: Enable SSSE3 TCG support
    
    SSSE3 support has been added to TCG more than 4 years ago in commit
    4242b1bd8acc19aaaacffdaad4ac23213d72a72b. It has been disabled by
    mistake in commit 551a2dec8fa55006a68393b9d6fb63577d2b3f1c.
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
    Signed-off-by: Andreas FÃ¤rber <afaerber@suse.de>
---
 target-i386/cpu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 4fdd4f7..c6c2ca0 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -315,7 +315,7 @@ typedef struct x86_def_t {
           /* missing:
           CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */
 #define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | \
-          CPUID_EXT_CX16 | CPUID_EXT_POPCNT | \
+          CPUID_EXT_SSSE3 | CPUID_EXT_CX16 | CPUID_EXT_POPCNT | \
           CPUID_EXT_HYPERVISOR)
           /* missing:
           CPUID_EXT_DTES64, CPUID_EXT_DSCPL, CPUID_EXT_VMX, CPUID_EXT_EST,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============4111414557210686693==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============4111414557210686693==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:56:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:56:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQK5-0004GI-Qu; Tue, 11 Dec 2012 13:56:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQK5-0004GA-27
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:37 +0000
Received: from [85.158.143.35:32769] by server-2.bemta-4.messagelabs.com id
	6E/E2-30861-49B37C05; Tue, 11 Dec 2012 13:56:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1355234164!4259214!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16321 invoked from network); 11 Dec 2012 13:56:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJX-0001VU-TN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJX-0005zJ-MY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:03 +0000
Date: Tue, 11 Dec 2012 13:56:03 +0000
Message-Id: <E1TiQJX-0005zJ-MY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-i386/cpu: Add
	missing flags to Haswell CPU model
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7998684341301041447=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7998684341301041447==
Content-Type: text/plain

commit 80ae416058d8941824f450343781183618555415
Author: Eduardo Habkost <ehabkost@redhat.com>
Date:   Thu Nov 22 13:31:03 2012 -0200

    target-i386/cpu: Add missing flags to Haswell CPU model
    
    When adding the Haswell CPU model, I intended to make it a superset of the
    features present on the SandyBridge model, but I have removed the SEP and
    RDTSCP features from the feature list by mistake. This patch adds the
    missing SEP and RDTSCP features (that are present on SandyBridge) to
    Haswell.
    
    Reported-by: Martin Kletzander <mkletzan@redhat.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas FÃ¤rber <afaerber@suse.de>
---
 target-i386/cpu.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 64c3491..4fdd4f7 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -657,7 +657,7 @@ static x86_def_t builtin_x86_defs[] = {
         .stepping = 1,
         .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
              CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
-             CPUID_PGE | CPUID_MTRR | CPUID_APIC | CPUID_CX8 |
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
              CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
              CPUID_DE | CPUID_FP87,
         .ext_features = CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
@@ -666,7 +666,8 @@ static x86_def_t builtin_x86_defs[] = {
              CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
              CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
              CPUID_EXT_PCID,
-        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX |
+             CPUID_EXT2_SYSCALL,
         .ext3_features = CPUID_EXT3_LAHF_LM,
         .cpuid_7_0_ebx_features = CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
             CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============7998684341301041447==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============7998684341301041447==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:56:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:56:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQK5-0004GI-Qu; Tue, 11 Dec 2012 13:56:37 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQK5-0004GA-27
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:37 +0000
Received: from [85.158.143.35:32769] by server-2.bemta-4.messagelabs.com id
	6E/E2-30861-49B37C05; Tue, 11 Dec 2012 13:56:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1355234164!4259214!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16321 invoked from network); 11 Dec 2012 13:56:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJX-0001VU-TN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJX-0005zJ-MY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:03 +0000
Date: Tue, 11 Dec 2012 13:56:03 +0000
Message-Id: <E1TiQJX-0005zJ-MY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] target-i386/cpu: Add
	missing flags to Haswell CPU model
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7998684341301041447=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7998684341301041447==
Content-Type: text/plain

commit 80ae416058d8941824f450343781183618555415
Author: Eduardo Habkost <ehabkost@redhat.com>
Date:   Thu Nov 22 13:31:03 2012 -0200

    target-i386/cpu: Add missing flags to Haswell CPU model
    
    When adding the Haswell CPU model, I intended to make it a superset of the
    features present on the SandyBridge model, but I have removed the SEP and
    RDTSCP features from the feature list by mistake. This patch adds the
    missing SEP and RDTSCP features (that are present on SandyBridge) to
    Haswell.
    
    Reported-by: Martin Kletzander <mkletzan@redhat.com>
    Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andreas FÃ¤rber <afaerber@suse.de>
---
 target-i386/cpu.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 64c3491..4fdd4f7 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -657,7 +657,7 @@ static x86_def_t builtin_x86_defs[] = {
         .stepping = 1,
         .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
              CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
-             CPUID_PGE | CPUID_MTRR | CPUID_APIC | CPUID_CX8 |
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
              CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
              CPUID_DE | CPUID_FP87,
         .ext_features = CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
@@ -666,7 +666,8 @@ static x86_def_t builtin_x86_defs[] = {
              CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
              CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
              CPUID_EXT_PCID,
-        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX |
+             CPUID_EXT2_SYSCALL,
         .ext3_features = CPUID_EXT3_LAHF_LM,
         .cpuid_7_0_ebx_features = CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
             CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============7998684341301041447==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============7998684341301041447==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:56:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:56:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQK8-0004H3-TY; Tue, 11 Dec 2012 13:56:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQK7-0004Gl-K2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:39 +0000
Received: from [193.109.254.147:25989] by server-7.bemta-14.messagelabs.com id
	AD/E8-02272-69B37C05; Tue, 11 Dec 2012 13:56:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1355234195!8680224!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27560 invoked from network); 11 Dec 2012 13:56:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQK3-0001Vl-6F
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQK3-000628-1N
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:35 +0000
Date: Tue, 11 Dec 2012 13:56:35 +0000
Message-Id: <E1TiQK3-000628-1N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] hw/ide/macio: Fix segfault
	caused by NULL DMAContext*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8727240850163554772=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8727240850163554772==
Content-Type: text/plain

commit d688e5239aad2a1f991147974832ce026f78c1a3
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Tue Nov 20 08:16:51 2012 +0000

    hw/ide/macio: Fix segfault caused by NULL DMAContext*
    
    Pass qemu_sglist_init the global dma_context_memory rather than a NULL
    pointer; this fixes a segfault in dma_memory_map() when the guest
    starts using DMA.
    
    Reported-by: Amadeusz SÅ‚awiÅ„ski <amade@asmblr.net>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/ide/macio.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 720af6e..d2edcc0 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -76,7 +76,8 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
 
     s->io_buffer_size = io->len;
 
-    qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1, NULL);
+    qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1,
+                     &dma_context_memory);
     qemu_sglist_add(&s->sg, io->addr, io->len);
     io->addr += io->len;
     io->len = 0;
@@ -132,7 +133,8 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
     s->io_buffer_index = 0;
     s->io_buffer_size = io->len;
 
-    qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1, NULL);
+    qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1,
+                     &dma_context_memory);
     qemu_sglist_add(&s->sg, io->addr, io->len);
     io->addr += io->len;
     io->len = 0;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============8727240850163554772==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============8727240850163554772==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:56:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:56:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQK8-0004H3-TY; Tue, 11 Dec 2012 13:56:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQK7-0004Gl-K2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:39 +0000
Received: from [193.109.254.147:25989] by server-7.bemta-14.messagelabs.com id
	AD/E8-02272-69B37C05; Tue, 11 Dec 2012 13:56:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1355234195!8680224!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27560 invoked from network); 11 Dec 2012 13:56:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQK3-0001Vl-6F
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQK3-000628-1N
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:35 +0000
Date: Tue, 11 Dec 2012 13:56:35 +0000
Message-Id: <E1TiQK3-000628-1N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] hw/ide/macio: Fix segfault
	caused by NULL DMAContext*
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8727240850163554772=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8727240850163554772==
Content-Type: text/plain

commit d688e5239aad2a1f991147974832ce026f78c1a3
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Tue Nov 20 08:16:51 2012 +0000

    hw/ide/macio: Fix segfault caused by NULL DMAContext*
    
    Pass qemu_sglist_init the global dma_context_memory rather than a NULL
    pointer; this fixes a segfault in dma_memory_map() when the guest
    starts using DMA.
    
    Reported-by: Amadeusz SÅ‚awiÅ„ski <amade@asmblr.net>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/ide/macio.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 720af6e..d2edcc0 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -76,7 +76,8 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
 
     s->io_buffer_size = io->len;
 
-    qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1, NULL);
+    qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1,
+                     &dma_context_memory);
     qemu_sglist_add(&s->sg, io->addr, io->len);
     io->addr += io->len;
     io->len = 0;
@@ -132,7 +133,8 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
     s->io_buffer_index = 0;
     s->io_buffer_size = io->len;
 
-    qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1, NULL);
+    qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1,
+                     &dma_context_memory);
     qemu_sglist_add(&s->sg, io->addr, io->len);
     io->addr += io->len;
     io->len = 0;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============8727240850163554772==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============8727240850163554772==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:56:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:56:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQKI-0004Ig-0c; Tue, 11 Dec 2012 13:56:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKG-0004IJ-PP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:48 +0000
Received: from [85.158.139.211:9602] by server-12.bemta-5.messagelabs.com id
	D2/46-02275-F9B37C05; Tue, 11 Dec 2012 13:56:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1355234205!20038189!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28490 invoked from network); 11 Dec 2012 13:56:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKD-0001Vr-KB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKD-00062l-BN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:45 +0000
Date: Tue, 11 Dec 2012 13:56:45 +0000
Message-Id: <E1TiQKD-00062l-BN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] PPC: Fix missing TRACE
	exception
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f0cc4aa8450376ca2aee3ebb09db71f9f2ff333b
Author: Julio Guerra <guerr@julio.in>
Date:   Fri Oct 19 00:17:13 2012 +0000

    PPC: Fix missing TRACE exception
    
    This patch fixes bug 1031698 :
    https://bugs.launchpad.net/qemu/+bug/1031698
    
    If we look at the (truncated) translation of the conditional branch
    instruction in the test submitted in the bug post, the call to the
    exception helper is missing in the "bne-false" chunk of translated
    code :
    
    IN:
    bne-    0x1800278
    
    OUT:
    0xb544236d:  jne    0xb5442396
    
    0xb5442373:  mov    %ebp,(%esp)
    0xb5442376:  mov    $0x44,%ebx
    0xb544237b:  mov    %ebx,0x4(%esp)
    0xb544237f:  mov    $0x1800278,%ebx
    0xb5442384:  mov    %ebx,0x25c(%ebp)
    0xb544238a:  call   0x827475a
                         ^^^^^^^^^^^^^^^^^^
    
    0xb5442396:  mov    %ebp,(%esp)
    0xb5442399:  mov    $0x44,%ebx
    0xb544239e:  mov    %ebx,0x4(%esp)
    0xb54423a2:  mov    $0x1800270,%ebx
    0xb54423a7:  mov    %ebx,0x25c(%ebp)
    
    Indeed, gen_exception(ctx, excp) called by gen_goto_tb (called by
    gen_bcond) changes ctx->exception's value to excp's :
    
    gen_bcond()
    {
      gen_goto_tb(ctx, 0, ctx->nip + li - 4);
      /* ctx->exception value is POWERPC_EXCP_BRANCH */
    
      gen_goto_tb(ctx, 1, ctx->nip);
      /* ctx->exception now value is POWERPC_EXCP_TRACE */
    }
    
    Making the following gen_goto_tb()'s test false during the second call :
    
    if ((ctx->singlestep_enabled &
        (CPU_BRANCH_STEP | CPU_SINGLE_STEP)) &&
        ctx->exception == POWERPC_EXCP_BRANCH /* false...*/) {
             target_ulong tmp = ctx->nip;
             ctx->nip = dest;
             /* ... and this is the missing call */
             gen_exception(ctx, POWERPC_EXCP_TRACE);
             ctx->nip = tmp;
    }
    
    So the patch simply adds the missing matching case, fixing our problem.
    
    Signed-off-by: Julio Guerra <guerr@julio.in>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 target-ppc/translate.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 16b9c5d..987b04e 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -3473,7 +3473,8 @@ static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
         if (unlikely(ctx->singlestep_enabled)) {
             if ((ctx->singlestep_enabled &
                 (CPU_BRANCH_STEP | CPU_SINGLE_STEP)) &&
-                ctx->exception == POWERPC_EXCP_BRANCH) {
+                (ctx->exception == POWERPC_EXCP_BRANCH ||
+                 ctx->exception == POWERPC_EXCP_TRACE)) {
                 target_ulong tmp = ctx->nip;
                 ctx->nip = dest;
                 gen_exception(ctx, POWERPC_EXCP_TRACE);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:56:50 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:56:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQKI-0004Ig-0c; Tue, 11 Dec 2012 13:56:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKG-0004IJ-PP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:48 +0000
Received: from [85.158.139.211:9602] by server-12.bemta-5.messagelabs.com id
	D2/46-02275-F9B37C05; Tue, 11 Dec 2012 13:56:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1355234205!20038189!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28490 invoked from network); 11 Dec 2012 13:56:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKD-0001Vr-KB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKD-00062l-BN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:45 +0000
Date: Tue, 11 Dec 2012 13:56:45 +0000
Message-Id: <E1TiQKD-00062l-BN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] PPC: Fix missing TRACE
	exception
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f0cc4aa8450376ca2aee3ebb09db71f9f2ff333b
Author: Julio Guerra <guerr@julio.in>
Date:   Fri Oct 19 00:17:13 2012 +0000

    PPC: Fix missing TRACE exception
    
    This patch fixes bug 1031698 :
    https://bugs.launchpad.net/qemu/+bug/1031698
    
    If we look at the (truncated) translation of the conditional branch
    instruction in the test submitted in the bug post, the call to the
    exception helper is missing in the "bne-false" chunk of translated
    code :
    
    IN:
    bne-    0x1800278
    
    OUT:
    0xb544236d:  jne    0xb5442396
    
    0xb5442373:  mov    %ebp,(%esp)
    0xb5442376:  mov    $0x44,%ebx
    0xb544237b:  mov    %ebx,0x4(%esp)
    0xb544237f:  mov    $0x1800278,%ebx
    0xb5442384:  mov    %ebx,0x25c(%ebp)
    0xb544238a:  call   0x827475a
                         ^^^^^^^^^^^^^^^^^^
    
    0xb5442396:  mov    %ebp,(%esp)
    0xb5442399:  mov    $0x44,%ebx
    0xb544239e:  mov    %ebx,0x4(%esp)
    0xb54423a2:  mov    $0x1800270,%ebx
    0xb54423a7:  mov    %ebx,0x25c(%ebp)
    
    Indeed, gen_exception(ctx, excp) called by gen_goto_tb (called by
    gen_bcond) changes ctx->exception's value to excp's :
    
    gen_bcond()
    {
      gen_goto_tb(ctx, 0, ctx->nip + li - 4);
      /* ctx->exception value is POWERPC_EXCP_BRANCH */
    
      gen_goto_tb(ctx, 1, ctx->nip);
      /* ctx->exception now value is POWERPC_EXCP_TRACE */
    }
    
    Making the following gen_goto_tb()'s test false during the second call :
    
    if ((ctx->singlestep_enabled &
        (CPU_BRANCH_STEP | CPU_SINGLE_STEP)) &&
        ctx->exception == POWERPC_EXCP_BRANCH /* false...*/) {
             target_ulong tmp = ctx->nip;
             ctx->nip = dest;
             /* ... and this is the missing call */
             gen_exception(ctx, POWERPC_EXCP_TRACE);
             ctx->nip = tmp;
    }
    
    So the patch simply adds the missing matching case, fixing our problem.
    
    Signed-off-by: Julio Guerra <guerr@julio.in>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 target-ppc/translate.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 16b9c5d..987b04e 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -3473,7 +3473,8 @@ static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
         if (unlikely(ctx->singlestep_enabled)) {
             if ((ctx->singlestep_enabled &
                 (CPU_BRANCH_STEP | CPU_SINGLE_STEP)) &&
-                ctx->exception == POWERPC_EXCP_BRANCH) {
+                (ctx->exception == POWERPC_EXCP_BRANCH ||
+                 ctx->exception == POWERPC_EXCP_TRACE)) {
                 target_ulong tmp = ctx->nip;
                 ctx->nip = dest;
                 gen_exception(ctx, POWERPC_EXCP_TRACE);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:00 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQKS-0004Kh-3S; Tue, 11 Dec 2012 13:57:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKQ-0004KM-RK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:59 +0000
Received: from [85.158.139.211:16334] by server-16.bemta-5.messagelabs.com id
	CA/F7-09208-9AB37C05; Tue, 11 Dec 2012 13:56:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1355234216!20038221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29172 invoked from network); 11 Dec 2012 13:56:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKN-0001W7-R5
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKN-00063F-P1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:55 +0000
Date: Tue, 11 Dec 2012 13:56:55 +0000
Message-Id: <E1TiQKN-00063F-P1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] kvm: fix incorrect length
	in a loop over kvm dirty pages map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 752ced0488806830f18f96b60ae6f3d1fadfd089
Author: Alexey Kardashevskiy <aik@ozlabs.ru>
Date:   Mon Nov 19 15:40:47 2012 +0000

    kvm: fix incorrect length in a loop over kvm dirty pages map
    
    QEMU allocates a map enough for 4k pages. However the system page size
    can be 64K (for example on POWER) and the host kernel uses only a small
    part of it as one big stores a dirty flag for 16 pages 4K each,
    the hpratio variable stores this ratio and
    the kvm_get_dirty_pages_log_range function handles it correctly.
    
    However kvm_get_dirty_pages_log_range still goes beyond the data
    provided by the host kernel which is not correct. It does not cause
    errors at the moment as the whole bitmap is zeroed before doing KVM ioctl.
    
    The patch reduces number of iterations over the map.
    
    Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 kvm-all.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 3bc3347..8e9a8d8 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -364,7 +364,7 @@ static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,
     unsigned int i, j;
     unsigned long page_number, c;
     hwaddr addr, addr1;
-    unsigned int len = ((section->size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;
+    unsigned int len = ((section->size / getpagesize()) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;
     unsigned long hpratio = getpagesize() / TARGET_PAGE_SIZE;
 
     /*
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:00 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQKS-0004Kh-3S; Tue, 11 Dec 2012 13:57:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKQ-0004KM-RK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:59 +0000
Received: from [85.158.139.211:16334] by server-16.bemta-5.messagelabs.com id
	CA/F7-09208-9AB37C05; Tue, 11 Dec 2012 13:56:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1355234216!20038221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29172 invoked from network); 11 Dec 2012 13:56:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKN-0001W7-R5
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKN-00063F-P1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:55 +0000
Date: Tue, 11 Dec 2012 13:56:55 +0000
Message-Id: <E1TiQKN-00063F-P1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] kvm: fix incorrect length
	in a loop over kvm dirty pages map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 752ced0488806830f18f96b60ae6f3d1fadfd089
Author: Alexey Kardashevskiy <aik@ozlabs.ru>
Date:   Mon Nov 19 15:40:47 2012 +0000

    kvm: fix incorrect length in a loop over kvm dirty pages map
    
    QEMU allocates a map enough for 4k pages. However the system page size
    can be 64K (for example on POWER) and the host kernel uses only a small
    part of it as one big stores a dirty flag for 16 pages 4K each,
    the hpratio variable stores this ratio and
    the kvm_get_dirty_pages_log_range function handles it correctly.
    
    However kvm_get_dirty_pages_log_range still goes beyond the data
    provided by the host kernel which is not correct. It does not cause
    errors at the moment as the whole bitmap is zeroed before doing KVM ioctl.
    
    The patch reduces number of iterations over the map.
    
    Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 kvm-all.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 3bc3347..8e9a8d8 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -364,7 +364,7 @@ static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,
     unsigned int i, j;
     unsigned long page_number, c;
     hwaddr addr, addr1;
-    unsigned int len = ((section->size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;
+    unsigned int len = ((section->size / getpagesize()) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;
     unsigned long hpratio = getpagesize() / TARGET_PAGE_SIZE;
 
     /*
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQKo-0004O9-7H; Tue, 11 Dec 2012 13:57:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKm-0004Nu-CS
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:20 +0000
Received: from [85.158.143.99:11476] by server-3.bemta-4.messagelabs.com id
	31/DB-18211-FBB37C05; Tue, 11 Dec 2012 13:57:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1355234236!28376343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5890 invoked from network); 11 Dec 2012 13:57:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKi-0001Wg-6V
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKi-000646-4b
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:16 +0000
Date: Tue, 11 Dec 2012 13:57:16 +0000
Message-Id: <E1TiQKi-000646-4b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] vl.c: Fix broken -usb
	option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4d88267ae76810420295a1682cf779c49f3ddec
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Thu Nov 22 06:48:45 2012 +0000

    vl.c: Fix broken -usb option
    
    Commit 094b287f0b accidentally broke the "-usb" command line
    option, so it would have no effect if the user had not specified
    any machine options at that point. (the return value from
    'qemu_opts_find(qemu_find_opts("machine"), 0);' is NULL if there
    are no user specified options, so it is only to be used for
    looking up an option, not when trying to set one.) Similarly,
    would '-usbdevice' no longer cause USB to default to enabled.
    
    Fix this regression by using the same style of code for forcing
    the usb=on machine option that we use for other aliases such as
    '-enable-kvm'.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 vl.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/vl.c b/vl.c
index c8e9c78..a3ab384 100644
--- a/vl.c
+++ b/vl.c
@@ -3273,16 +3273,12 @@ int main(int argc, char **argv, char **envp)
                 break;
             }
             case QEMU_OPTION_usb:
-                machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
-                if (machine_opts) {
-                    qemu_opt_set_bool(machine_opts, "usb", true);
-                }
+                olist = qemu_find_opts("machine");
+                qemu_opts_parse(olist, "usb=on", 0);
                 break;
             case QEMU_OPTION_usbdevice:
-                machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
-                if (machine_opts) {
-                    qemu_opt_set_bool(machine_opts, "usb", true);
-                }
+                olist = qemu_find_opts("machine");
+                qemu_opts_parse(olist, "usb=on", 0);
                 add_device_config(DEV_USB, optarg);
                 break;
             case QEMU_OPTION_device:
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQKo-0004O9-7H; Tue, 11 Dec 2012 13:57:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKm-0004Nu-CS
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:20 +0000
Received: from [85.158.143.99:11476] by server-3.bemta-4.messagelabs.com id
	31/DB-18211-FBB37C05; Tue, 11 Dec 2012 13:57:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1355234236!28376343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5890 invoked from network); 11 Dec 2012 13:57:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKi-0001Wg-6V
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKi-000646-4b
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:16 +0000
Date: Tue, 11 Dec 2012 13:57:16 +0000
Message-Id: <E1TiQKi-000646-4b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] vl.c: Fix broken -usb
	option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c4d88267ae76810420295a1682cf779c49f3ddec
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Thu Nov 22 06:48:45 2012 +0000

    vl.c: Fix broken -usb option
    
    Commit 094b287f0b accidentally broke the "-usb" command line
    option, so it would have no effect if the user had not specified
    any machine options at that point. (the return value from
    'qemu_opts_find(qemu_find_opts("machine"), 0);' is NULL if there
    are no user specified options, so it is only to be used for
    looking up an option, not when trying to set one.) Similarly,
    would '-usbdevice' no longer cause USB to default to enabled.
    
    Fix this regression by using the same style of code for forcing
    the usb=on machine option that we use for other aliases such as
    '-enable-kvm'.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 vl.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/vl.c b/vl.c
index c8e9c78..a3ab384 100644
--- a/vl.c
+++ b/vl.c
@@ -3273,16 +3273,12 @@ int main(int argc, char **argv, char **envp)
                 break;
             }
             case QEMU_OPTION_usb:
-                machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
-                if (machine_opts) {
-                    qemu_opt_set_bool(machine_opts, "usb", true);
-                }
+                olist = qemu_find_opts("machine");
+                qemu_opts_parse(olist, "usb=on", 0);
                 break;
             case QEMU_OPTION_usbdevice:
-                machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
-                if (machine_opts) {
-                    qemu_opt_set_bool(machine_opts, "usb", true);
-                }
+                olist = qemu_find_opts("machine");
+                qemu_opts_parse(olist, "usb=on", 0);
                 add_device_config(DEV_USB, optarg);
                 break;
             case QEMU_OPTION_device:
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQKx-0004PY-AY; Tue, 11 Dec 2012 13:57:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKw-0004PM-Dv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:30 +0000
Received: from [193.109.254.147:7551] by server-10.bemta-14.messagelabs.com id
	B6/CB-31741-9CB37C05; Tue, 11 Dec 2012 13:57:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1355234226!10083622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7393 invoked from network); 11 Dec 2012 13:57:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKX-0001Wd-W8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKX-00063g-Uj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:05 +0000
Date: Tue, 11 Dec 2012 13:57:05 +0000
Message-Id: <E1TiQKX-00063g-Uj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] pseries: Fix bug in PCI
	MSI allocation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 70c68cf638b4cf44a42a937622deac3ad3c7833c
Author: Alexey Kardashevskiy <aik@ozlabs.ru>
Date:   Mon Nov 12 16:46:59 2012 +0000

    pseries: Fix bug in PCI MSI allocation
    
    In one of the recent reworks to the XICS code, a bug was introduced where
    we use the wrong sense and allocate level interrupts instead of message
    interrupts for PCI MSIs.  This patch fixes it.
    
    Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/spapr_pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
index a08ed11..3c5b855 100644
--- a/hw/spapr_pci.c
+++ b/hw/spapr_pci.c
@@ -351,7 +351,7 @@ static void rtas_ibm_change_msi(sPAPREnvironment *spapr,
 
     /* There is no cached config, allocate MSIs */
     if (!phb->msi_table[ndev].nvec) {
-        irq = spapr_allocate_irq_block(req_num, true);
+        irq = spapr_allocate_irq_block(req_num, false);
         if (irq < 0) {
             fprintf(stderr, "Cannot allocate MSIs for device#%d", ndev);
             rtas_st(rets, 0, -1); /* Hardware error */
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQKx-0004PY-AY; Tue, 11 Dec 2012 13:57:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKw-0004PM-Dv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:30 +0000
Received: from [193.109.254.147:7551] by server-10.bemta-14.messagelabs.com id
	B6/CB-31741-9CB37C05; Tue, 11 Dec 2012 13:57:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1355234226!10083622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7393 invoked from network); 11 Dec 2012 13:57:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKX-0001Wd-W8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKX-00063g-Uj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:05 +0000
Date: Tue, 11 Dec 2012 13:57:05 +0000
Message-Id: <E1TiQKX-00063g-Uj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] pseries: Fix bug in PCI
	MSI allocation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 70c68cf638b4cf44a42a937622deac3ad3c7833c
Author: Alexey Kardashevskiy <aik@ozlabs.ru>
Date:   Mon Nov 12 16:46:59 2012 +0000

    pseries: Fix bug in PCI MSI allocation
    
    In one of the recent reworks to the XICS code, a bug was introduced where
    we use the wrong sense and allocate level interrupts instead of message
    interrupts for PCI MSIs.  This patch fixes it.
    
    Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/spapr_pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c
index a08ed11..3c5b855 100644
--- a/hw/spapr_pci.c
+++ b/hw/spapr_pci.c
@@ -351,7 +351,7 @@ static void rtas_ibm_change_msi(sPAPREnvironment *spapr,
 
     /* There is no cached config, allocate MSIs */
     if (!phb->msi_table[ndev].nvec) {
-        irq = spapr_allocate_irq_block(req_num, true);
+        irq = spapr_allocate_irq_block(req_num, false);
         if (irq < 0) {
             fprintf(stderr, "Cannot allocate MSIs for device#%d", ndev);
             rtas_st(rets, 0, -1); /* Hardware error */
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQL7-0004Qz-Dr; Tue, 11 Dec 2012 13:57:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQL6-0004Qj-8s
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:40 +0000
Received: from [85.158.139.211:32030] by server-7.bemta-5.messagelabs.com id
	84/34-08009-3DB37C05; Tue, 11 Dec 2012 13:57:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355234257!18526951!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11087 invoked from network); 11 Dec 2012 13:57:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQL2-0001Wr-MR
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQL2-00065g-L2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:36 +0000
Date: Tue, 11 Dec 2012 13:57:36 +0000
Message-Id: <E1TiQL2-00065g-L2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'agraf/ppc-for-upstream-1.3' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7e68494b0be4310c48996e9334373ef5771e3d15
Merge: f3d44eb53c10b4dddfb3762c3e005be38adfc0ed 6e72719e721a40fe1224701ca10edc1caf0cd708
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed Nov 28 13:19:06 2012 -0600

    Merge remote-tracking branch 'agraf/ppc-for-upstream-1.3' into staging
    
    * agraf/ppc-for-upstream-1.3:
      fbdev: fix pixman compile on old pixman
      vl.c: Fix broken -usb option
      pseries: Fix bug in PCI MSI allocation
      kvm: fix incorrect length in a loop over kvm dirty pages map
      PPC: Fix missing TRACE exception
      hw/ide/macio: Fix segfault caused by NULL DMAContext*
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 hw/ide/macio.c         |    6 ++++--
 hw/spapr_pci.c         |    2 +-
 kvm-all.c              |    2 +-
 qemu-pixman.c          |    2 ++
 target-ppc/translate.c |    3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQL7-0004Qz-Dr; Tue, 11 Dec 2012 13:57:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQL6-0004Qj-8s
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:40 +0000
Received: from [85.158.139.211:32030] by server-7.bemta-5.messagelabs.com id
	84/34-08009-3DB37C05; Tue, 11 Dec 2012 13:57:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355234257!18526951!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11087 invoked from network); 11 Dec 2012 13:57:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQL2-0001Wr-MR
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQL2-00065g-L2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:36 +0000
Date: Tue, 11 Dec 2012 13:57:36 +0000
Message-Id: <E1TiQL2-00065g-L2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'agraf/ppc-for-upstream-1.3' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7e68494b0be4310c48996e9334373ef5771e3d15
Merge: f3d44eb53c10b4dddfb3762c3e005be38adfc0ed 6e72719e721a40fe1224701ca10edc1caf0cd708
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed Nov 28 13:19:06 2012 -0600

    Merge remote-tracking branch 'agraf/ppc-for-upstream-1.3' into staging
    
    * agraf/ppc-for-upstream-1.3:
      fbdev: fix pixman compile on old pixman
      vl.c: Fix broken -usb option
      pseries: Fix bug in PCI MSI allocation
      kvm: fix incorrect length in a loop over kvm dirty pages map
      PPC: Fix missing TRACE exception
      hw/ide/macio: Fix segfault caused by NULL DMAContext*
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 hw/ide/macio.c         |    6 ++++--
 hw/spapr_pci.c         |    2 +-
 kvm-all.c              |    2 +-
 qemu-pixman.c          |    2 ++
 target-ppc/translate.c |    3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLH-0004SW-Gp; Tue, 11 Dec 2012 13:57:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLG-0004SL-BQ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:50 +0000
Received: from [85.158.139.211:32934] by server-8.bemta-5.messagelabs.com id
	09/28-15003-DDB37C05; Tue, 11 Dec 2012 13:57:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1355234267!18501740!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5311 invoked from network); 11 Dec 2012 13:57:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKs-0001Wj-GY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKs-00064V-B6
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:26 +0000
Date: Tue, 11 Dec 2012 13:57:26 +0000
Message-Id: <E1TiQKs-00064V-B6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] fbdev: fix pixman compile
	on old pixman
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0498446127253563913=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0498446127253563913==
Content-Type: text/plain

commit 6e72719e721a40fe1224701ca10edc1caf0cd708
Author: Alexander Graf <agraf@suse.de>
Date:   Mon Nov 26 19:49:58 2012 +0100

    fbdev: fix pixman compile on old pixman
    
    My QEMU compile failed with the following error:
    
    qemu-pixman.c: In function â€˜qemu_pixman_get_typeâ€™:
    qemu-pixman.c:24: error: â€˜PIXMAN_TYPE_BGRAâ€™ undeclared (first use in this function)
    qemu-pixman.c:24: error: (Each undeclared identifier is reported only once
    qemu-pixman.c:24: error: for each function it appears in.)
    
    Guard the PIXMAN_TYPE_BGRA branch like in the case right above the failing
    case, so that compilation is fixed. Functionality on such old pixman is a
    different question ;-).
    
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 qemu-pixman.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu-pixman.c b/qemu-pixman.c
index ac7bc01..e46e180 100644
--- a/qemu-pixman.c
+++ b/qemu-pixman.c
@@ -21,7 +21,9 @@ int qemu_pixman_get_type(int rshift, int gshift, int bshift)
         if (rshift == 0) {
             type = PIXMAN_TYPE_ABGR;
         } else {
+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0, 21, 8)
             type = PIXMAN_TYPE_BGRA;
+#endif
         }
     }
     return type;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============0498446127253563913==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0498446127253563913==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLH-0004SW-Gp; Tue, 11 Dec 2012 13:57:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLG-0004SL-BQ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:50 +0000
Received: from [85.158.139.211:32934] by server-8.bemta-5.messagelabs.com id
	09/28-15003-DDB37C05; Tue, 11 Dec 2012 13:57:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1355234267!18501740!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5311 invoked from network); 11 Dec 2012 13:57:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKs-0001Wj-GY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQKs-00064V-B6
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:26 +0000
Date: Tue, 11 Dec 2012 13:57:26 +0000
Message-Id: <E1TiQKs-00064V-B6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] fbdev: fix pixman compile
	on old pixman
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0498446127253563913=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0498446127253563913==
Content-Type: text/plain

commit 6e72719e721a40fe1224701ca10edc1caf0cd708
Author: Alexander Graf <agraf@suse.de>
Date:   Mon Nov 26 19:49:58 2012 +0100

    fbdev: fix pixman compile on old pixman
    
    My QEMU compile failed with the following error:
    
    qemu-pixman.c: In function â€˜qemu_pixman_get_typeâ€™:
    qemu-pixman.c:24: error: â€˜PIXMAN_TYPE_BGRAâ€™ undeclared (first use in this function)
    qemu-pixman.c:24: error: (Each undeclared identifier is reported only once
    qemu-pixman.c:24: error: for each function it appears in.)
    
    Guard the PIXMAN_TYPE_BGRA branch like in the case right above the failing
    case, so that compilation is fixed. Functionality on such old pixman is a
    different question ;-).
    
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 qemu-pixman.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qemu-pixman.c b/qemu-pixman.c
index ac7bc01..e46e180 100644
--- a/qemu-pixman.c
+++ b/qemu-pixman.c
@@ -21,7 +21,9 @@ int qemu_pixman_get_type(int rshift, int gshift, int bshift)
         if (rshift == 0) {
             type = PIXMAN_TYPE_ABGR;
         } else {
+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0, 21, 8)
             type = PIXMAN_TYPE_BGRA;
+#endif
         }
     }
     return type;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git


--===============0498446127253563913==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0498446127253563913==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLJ-0004TG-Lt; Tue, 11 Dec 2012 13:57:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLI-0004Sm-DO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:52 +0000
Received: from [85.158.139.83:61676] by server-12.bemta-5.messagelabs.com id
	74/19-02275-FDB37C05; Tue, 11 Dec 2012 13:57:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1355234267!28670037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16589 invoked from network); 11 Dec 2012 13:57:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLD-0001X0-4W
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLD-00066L-1i
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:47 +0000
Date: Tue, 11 Dec 2012 13:57:47 +0000
Message-Id: <E1TiQLD-00066L-1i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] s390: Fix ram_size
	updating in machine init
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8c7c3c58e3e33c80d1eef1514db3c705a4de692e
Author: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Date:   Mon Nov 19 23:28:34 2012 +0000

    s390: Fix ram_size updating in machine init
    
    The global variable 'ram_size' is hidden by the local variable
    declaration in s390_init(). Since we want to update the global
    ram size in certain cases we must not use a local ram_size
    variable.
    - This fixes booting with unusual ram sizes like -m 67001
    - This changes behaviour back to the situation before commit
      5f072e1f3075bd869e0ace9f2545a85992ac0084
      (create struct for machine initialization arguments)
    
    Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/s390-virtio.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index 685cb54..ca1bb09 100644
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -155,7 +155,6 @@ unsigned s390_del_running_cpu(CPUS390XState *env)
 static void s390_init(QEMUMachineInitArgs *args)
 {
     ram_addr_t my_ram_size = args->ram_size;
-    ram_addr_t ram_size = args->ram_size;
     const char *cpu_model = args->cpu_model;
     const char *kernel_filename = args->kernel_filename;
     const char *kernel_cmdline = args->kernel_cmdline;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:57:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:57:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLJ-0004TG-Lt; Tue, 11 Dec 2012 13:57:53 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLI-0004Sm-DO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:52 +0000
Received: from [85.158.139.83:61676] by server-12.bemta-5.messagelabs.com id
	74/19-02275-FDB37C05; Tue, 11 Dec 2012 13:57:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1355234267!28670037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16589 invoked from network); 11 Dec 2012 13:57:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLD-0001X0-4W
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLD-00066L-1i
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:47 +0000
Date: Tue, 11 Dec 2012 13:57:47 +0000
Message-Id: <E1TiQLD-00066L-1i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] s390: Fix ram_size
	updating in machine init
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8c7c3c58e3e33c80d1eef1514db3c705a4de692e
Author: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Date:   Mon Nov 19 23:28:34 2012 +0000

    s390: Fix ram_size updating in machine init
    
    The global variable 'ram_size' is hidden by the local variable
    declaration in s390_init(). Since we want to update the global
    ram size in certain cases we must not use a local ram_size
    variable.
    - This fixes booting with unusual ram sizes like -m 67001
    - This changes behaviour back to the situation before commit
      5f072e1f3075bd869e0ace9f2545a85992ac0084
      (create struct for machine initialization arguments)
    
    Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/s390-virtio.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index 685cb54..ca1bb09 100644
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -155,7 +155,6 @@ unsigned s390_del_running_cpu(CPUS390XState *env)
 static void s390_init(QEMUMachineInitArgs *args)
 {
     ram_addr_t my_ram_size = args->ram_size;
-    ram_addr_t ram_size = args->ram_size;
     const char *cpu_model = args->cpu_model;
     const char *kernel_filename = args->kernel_filename;
     const char *kernel_cmdline = args->kernel_cmdline;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:02 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLR-0004VI-Of; Tue, 11 Dec 2012 13:58:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLQ-0004Uq-6W
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:00 +0000
Received: from [85.158.143.99:16557] by server-1.bemta-4.messagelabs.com id
	06/05-28401-7EB37C05; Tue, 11 Dec 2012 13:57:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1355234277!25630996!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24398 invoked from network); 11 Dec 2012 13:57:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLN-0001XI-9z
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLN-00066j-8Y
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:57 +0000
Date: Tue, 11 Dec 2012 13:57:57 +0000
Message-Id: <E1TiQLN-00066j-8Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] sclp: Fix uninitialized
	var in handle_write_event_buf().
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 773de5c786a6050bbf3b33c0e29d1bd519a40b4b
Author: Cornelia Huck <cornelia.huck@de.ibm.com>
Date:   Fri Nov 23 00:18:12 2012 +0000

    sclp: Fix uninitialized var in handle_write_event_buf().
    
    Some gcc versions rightly complain about a possibly unitialized rc,
    so let's move setting it before the QTAILQ_FOREACH().
    
    Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
    Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/s390x/event-facility.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index 9367660..bc9cea9 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -112,12 +112,13 @@ static uint16_t handle_write_event_buf(SCLPEventFacility *ef,
     SCLPEvent *event;
     SCLPEventClass *ec;
 
+    rc = SCLP_RC_INVALID_FUNCTION;
+
     QTAILQ_FOREACH(kid, &ef->sbus.qbus.children, sibling) {
         DeviceState *qdev = kid->child;
         event = (SCLPEvent *) qdev;
         ec = SCLP_EVENT_GET_CLASS(event);
 
-        rc = SCLP_RC_INVALID_FUNCTION;
         if (ec->write_event_data &&
             ec->event_type() == event_buf->type) {
             rc = ec->write_event_data(event, event_buf);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:02 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLR-0004VI-Of; Tue, 11 Dec 2012 13:58:01 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLQ-0004Uq-6W
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:00 +0000
Received: from [85.158.143.99:16557] by server-1.bemta-4.messagelabs.com id
	06/05-28401-7EB37C05; Tue, 11 Dec 2012 13:57:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1355234277!25630996!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24398 invoked from network); 11 Dec 2012 13:57:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:57:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLN-0001XI-9z
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLN-00066j-8Y
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:57:57 +0000
Date: Tue, 11 Dec 2012 13:57:57 +0000
Message-Id: <E1TiQLN-00066j-8Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] sclp: Fix uninitialized
	var in handle_write_event_buf().
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 773de5c786a6050bbf3b33c0e29d1bd519a40b4b
Author: Cornelia Huck <cornelia.huck@de.ibm.com>
Date:   Fri Nov 23 00:18:12 2012 +0000

    sclp: Fix uninitialized var in handle_write_event_buf().
    
    Some gcc versions rightly complain about a possibly unitialized rc,
    so let's move setting it before the QTAILQ_FOREACH().
    
    Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
    Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
    Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/s390x/event-facility.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index 9367660..bc9cea9 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -112,12 +112,13 @@ static uint16_t handle_write_event_buf(SCLPEventFacility *ef,
     SCLPEvent *event;
     SCLPEventClass *ec;
 
+    rc = SCLP_RC_INVALID_FUNCTION;
+
     QTAILQ_FOREACH(kid, &ef->sbus.qbus.children, sibling) {
         DeviceState *qdev = kid->child;
         event = (SCLPEvent *) qdev;
         ec = SCLP_EVENT_GET_CLASS(event);
 
-        rc = SCLP_RC_INVALID_FUNCTION;
         if (ec->write_event_data &&
             ec->event_type() == event_buf->type) {
             rc = ec->write_event_data(event, event_buf);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:12 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLb-0004Y2-St; Tue, 11 Dec 2012 13:58:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLa-0004Xd-90
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:10 +0000
Received: from [85.158.137.99:58665] by server-15.bemta-3.messagelabs.com id
	B1/03-07921-1FB37C05; Tue, 11 Dec 2012 13:58:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1355234287!18231142!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15921 invoked from network); 11 Dec 2012 13:58:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:58:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLX-0001Xr-Eo
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLX-000677-DR
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:07 +0000
Date: Tue, 11 Dec 2012 13:58:07 +0000
Message-Id: <E1TiQLX-000677-DR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'agraf/s390-for-upstream-1.3' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a6b2ac0cf92a4411cce38a22703d7a34a5b3601
Merge: 7e68494b0be4310c48996e9334373ef5771e3d15 773de5c786a6050bbf3b33c0e29d1bd519a40b4b
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed Nov 28 13:19:16 2012 -0600

    Merge remote-tracking branch 'agraf/s390-for-upstream-1.3' into staging
    
    * agraf/s390-for-upstream-1.3:
      sclp: Fix uninitialized var in handle_write_event_buf().
      s390: Fix ram_size updating in machine init
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 hw/s390-virtio.c          |    1 -
 hw/s390x/event-facility.c |    3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:12 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLb-0004Y2-St; Tue, 11 Dec 2012 13:58:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLa-0004Xd-90
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:10 +0000
Received: from [85.158.137.99:58665] by server-15.bemta-3.messagelabs.com id
	B1/03-07921-1FB37C05; Tue, 11 Dec 2012 13:58:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1355234287!18231142!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15921 invoked from network); 11 Dec 2012 13:58:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:58:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLX-0001Xr-Eo
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLX-000677-DR
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:07 +0000
Date: Tue, 11 Dec 2012 13:58:07 +0000
Message-Id: <E1TiQLX-000677-DR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'agraf/s390-for-upstream-1.3' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a6b2ac0cf92a4411cce38a22703d7a34a5b3601
Merge: 7e68494b0be4310c48996e9334373ef5771e3d15 773de5c786a6050bbf3b33c0e29d1bd519a40b4b
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed Nov 28 13:19:16 2012 -0600

    Merge remote-tracking branch 'agraf/s390-for-upstream-1.3' into staging
    
    * agraf/s390-for-upstream-1.3:
      sclp: Fix uninitialized var in handle_write_event_buf().
      s390: Fix ram_size updating in machine init
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 hw/s390-virtio.c          |    1 -
 hw/s390x/event-facility.c |    3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLv-0004bQ-WE; Tue, 11 Dec 2012 13:58:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLv-0004b7-Dy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:31 +0000
Received: from [193.109.254.147:15408] by server-4.bemta-14.messagelabs.com id
	5B/0A-18856-60C37C05; Tue, 11 Dec 2012 13:58:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1355234308!9727842!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20557 invoked from network); 11 Dec 2012 13:58:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:58:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLs-0001Y5-61
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLs-00068a-4b
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:28 +0000
Date: Tue, 11 Dec 2012 13:58:28 +0000
Message-Id: <E1TiQLs-00068a-4b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] iscsi: fix deadlock during
	login
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e829b0bb054ed3389e5b22dad61875e51674e629
Author: Peter Lieven <pl@dlhnet.de>
Date:   Sat Nov 17 14:37:39 2012 +0100

    iscsi: fix deadlock during login
    
    If the connection is interrupted before the first login is successfully
    completed qemu-kvm is waiting forever in qemu_aio_wait().
    
    This is fixed by performing an sync login to the target. If the
    connection breaks after the first successful login errors are
    handled internally by libiscsi.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/iscsi.c |  251 ++++++++++++++++-----------------------------------------
 1 files changed, 70 insertions(+), 181 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index 5cd8b49..01340e1 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -65,13 +65,6 @@ typedef struct IscsiAIOCB {
 #endif
 } IscsiAIOCB;
 
-struct IscsiTask {
-    IscsiLun *iscsilun;
-    BlockDriverState *bs;
-    int status;
-    int complete;
-};
-
 static void
 iscsi_bh_cb(void *p)
 {
@@ -380,7 +373,7 @@ iscsi_aio_readv(BlockDriverState *bs, int64_t sector_num,
         *(uint16_t *)&acb->task->cdb[7] = htons(num_sectors);
         break;
     }
-    
+
     if (iscsi_scsi_command_async(iscsi, iscsilun->lun, acb->task,
                                  iscsi_aio_read16_cb,
                                  NULL,
@@ -665,163 +658,6 @@ iscsi_getlength(BlockDriverState *bs)
     return len;
 }
 
-static void
-iscsi_readcapacity16_cb(struct iscsi_context *iscsi, int status,
-                        void *command_data, void *opaque)
-{
-    struct IscsiTask *itask = opaque;
-    struct scsi_readcapacity16 *rc16;
-    struct scsi_task *task = command_data;
-
-    if (status != 0) {
-        error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",
-                     iscsi_get_error(iscsi));
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    rc16 = scsi_datain_unmarshall(task);
-    if (rc16 == NULL) {
-        error_report("iSCSI: Failed to unmarshall readcapacity16 data.");
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    itask->iscsilun->block_size = rc16->block_length;
-    itask->iscsilun->num_blocks = rc16->returned_lba + 1;
-    itask->bs->total_sectors    = itask->iscsilun->num_blocks *
-                               itask->iscsilun->block_size / BDRV_SECTOR_SIZE ;
-
-    itask->status   = 0;
-    itask->complete = 1;
-    scsi_free_scsi_task(task);
-}
-
-static void
-iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status,
-                        void *command_data, void *opaque)
-{
-    struct IscsiTask *itask = opaque;
-    struct scsi_readcapacity10 *rc10;
-    struct scsi_task *task = command_data;
-
-    if (status != 0) {
-        error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",
-                     iscsi_get_error(iscsi));
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    rc10 = scsi_datain_unmarshall(task);
-    if (rc10 == NULL) {
-        error_report("iSCSI: Failed to unmarshall readcapacity10 data.");
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    itask->iscsilun->block_size = rc10->block_size;
-    if (rc10->lba == 0) {
-        /* blank disk loaded */
-        itask->iscsilun->num_blocks = 0;
-    } else {
-        itask->iscsilun->num_blocks = rc10->lba + 1;
-    }
-    itask->bs->total_sectors    = itask->iscsilun->num_blocks *
-                               itask->iscsilun->block_size / BDRV_SECTOR_SIZE ;
-
-    itask->status   = 0;
-    itask->complete = 1;
-    scsi_free_scsi_task(task);
-}
-
-static void
-iscsi_inquiry_cb(struct iscsi_context *iscsi, int status, void *command_data,
-                 void *opaque)
-{
-    struct IscsiTask *itask = opaque;
-    struct scsi_task *task = command_data;
-    struct scsi_inquiry_standard *inq;
-
-    if (status != 0) {
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    inq = scsi_datain_unmarshall(task);
-    if (inq == NULL) {
-        error_report("iSCSI: Failed to unmarshall inquiry data.");
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    itask->iscsilun->type = inq->periperal_device_type;
-
-    scsi_free_scsi_task(task);
-
-    switch (itask->iscsilun->type) {
-    case TYPE_DISK:
-        task = iscsi_readcapacity16_task(iscsi, itask->iscsilun->lun,
-                                   iscsi_readcapacity16_cb, opaque);
-        if (task == NULL) {
-            error_report("iSCSI: failed to send readcapacity16 command.");
-            itask->status   = 1;
-            itask->complete = 1;
-            return;
-        }
-        break;
-    case TYPE_ROM:
-        task = iscsi_readcapacity10_task(iscsi, itask->iscsilun->lun,
-                                   0, 0,
-                                   iscsi_readcapacity10_cb, opaque);
-        if (task == NULL) {
-            error_report("iSCSI: failed to send readcapacity16 command.");
-            itask->status   = 1;
-            itask->complete = 1;
-            return;
-        }
-        break;
-    default:
-        itask->status   = 0;
-        itask->complete = 1;
-    }
-}
-
-static void
-iscsi_connect_cb(struct iscsi_context *iscsi, int status, void *command_data,
-                 void *opaque)
-{
-    struct IscsiTask *itask = opaque;
-    struct scsi_task *task;
-
-    if (status != 0) {
-        itask->status   = 1;
-        itask->complete = 1;
-        return;
-    }
-
-    task = iscsi_inquiry_task(iscsi, itask->iscsilun->lun,
-                              0, 0, 36,
-                              iscsi_inquiry_cb, opaque);
-    if (task == NULL) {
-        error_report("iSCSI: failed to send inquiry command.");
-        itask->status   = 1;
-        itask->complete = 1;
-        return;
-    }
-}
-
 static int parse_chap(struct iscsi_context *iscsi, const char *target)
 {
     QemuOptsList *list;
@@ -934,7 +770,10 @@ static int iscsi_open(BlockDriverState *bs, const char *filename, int flags)
     IscsiLun *iscsilun = bs->opaque;
     struct iscsi_context *iscsi = NULL;
     struct iscsi_url *iscsi_url = NULL;
-    struct IscsiTask task;
+    struct scsi_task *task = NULL;
+    struct scsi_inquiry_standard *inq = NULL;
+    struct scsi_readcapacity10 *rc10 = NULL;
+    struct scsi_readcapacity16 *rc16 = NULL;
     char *initiator_name = NULL;
     int ret;
 
@@ -997,33 +836,80 @@ static int iscsi_open(BlockDriverState *bs, const char *filename, int flags)
     /* check if we got HEADER_DIGEST via the options */
     parse_header_digest(iscsi, iscsi_url->target);
 
-    task.iscsilun = iscsilun;
-    task.status = 0;
-    task.complete = 0;
-    task.bs = bs;
+    if (iscsi_full_connect_sync(iscsi, iscsi_url->portal, iscsi_url->lun) != 0) {
+        error_report("iSCSI: Failed to connect to LUN : %s",
+            iscsi_get_error(iscsi));
+        ret = -EINVAL;
+        goto out;
+    }
 
     iscsilun->iscsi = iscsi;
     iscsilun->lun   = iscsi_url->lun;
 
-    if (iscsi_full_connect_async(iscsi, iscsi_url->portal, iscsi_url->lun,
-                                 iscsi_connect_cb, &task)
-        != 0) {
-        error_report("iSCSI: Failed to start async connect.");
+    task = iscsi_inquiry_sync(iscsi, iscsilun->lun, 0, 0, 36);
+
+    if (task == NULL || task->status != SCSI_STATUS_GOOD) {
+        error_report("iSCSI: failed to send inquiry command.");
         ret = -EINVAL;
         goto out;
     }
 
-    while (!task.complete) {
-        iscsi_set_events(iscsilun);
-        qemu_aio_wait();
-    }
-    if (task.status != 0) {
-        error_report("iSCSI: Failed to connect to LUN : %s",
-                     iscsi_get_error(iscsi));
+    inq = scsi_datain_unmarshall(task);
+    if (inq == NULL) {
+        error_report("iSCSI: Failed to unmarshall inquiry data.");
         ret = -EINVAL;
         goto out;
     }
 
+    iscsilun->type = inq->periperal_device_type;
+
+    scsi_free_scsi_task(task);
+
+    switch (iscsilun->type) {
+    case TYPE_DISK:
+        task = iscsi_readcapacity16_sync(iscsi, iscsilun->lun);
+        if (task == NULL || task->status != SCSI_STATUS_GOOD) {
+            error_report("iSCSI: failed to send readcapacity16 command.");
+            ret = -EINVAL;
+            goto out;
+        }
+        rc16 = scsi_datain_unmarshall(task);
+        if (rc16 == NULL) {
+            error_report("iSCSI: Failed to unmarshall readcapacity16 data.");
+            ret = -EINVAL;
+            goto out;
+        }
+        iscsilun->block_size = rc16->block_length;
+        iscsilun->num_blocks = rc16->returned_lba + 1;
+        break;
+    case TYPE_ROM:
+        task = iscsi_readcapacity10_sync(iscsi, iscsilun->lun, 0, 0);
+        if (task == NULL || task->status != SCSI_STATUS_GOOD) {
+            error_report("iSCSI: failed to send readcapacity10 command.");
+            ret = -EINVAL;
+            goto out;
+        }
+        rc10 = scsi_datain_unmarshall(task);
+        if (rc10 == NULL) {
+            error_report("iSCSI: Failed to unmarshall readcapacity10 data.");
+            ret = -EINVAL;
+            goto out;
+        }
+        iscsilun->block_size = rc10->block_size;
+        if (rc10->lba == 0) {
+            /* blank disk loaded */
+            iscsilun->num_blocks = 0;
+        } else {
+            iscsilun->num_blocks = rc10->lba + 1;
+        }
+        break;
+    default:
+        break;
+    }
+
+    bs->total_sectors    = iscsilun->num_blocks *
+                           iscsilun->block_size / BDRV_SECTOR_SIZE ;
+
     /* Medium changer or tape. We dont have any emulation for this so this must
      * be sg ioctl compatible. We force it to be sg, otherwise qemu will try
      * to read from the device to guess the image format.
@@ -1042,6 +928,9 @@ out:
     if (iscsi_url != NULL) {
         iscsi_destroy_url(iscsi_url);
     }
+    if (task != NULL) {
+        scsi_free_scsi_task(task);
+    }
 
     if (ret) {
         if (iscsi != NULL) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLv-0004bQ-WE; Tue, 11 Dec 2012 13:58:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLv-0004b7-Dy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:31 +0000
Received: from [193.109.254.147:15408] by server-4.bemta-14.messagelabs.com id
	5B/0A-18856-60C37C05; Tue, 11 Dec 2012 13:58:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1355234308!9727842!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20557 invoked from network); 11 Dec 2012 13:58:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:58:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLs-0001Y5-61
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLs-00068a-4b
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:28 +0000
Date: Tue, 11 Dec 2012 13:58:28 +0000
Message-Id: <E1TiQLs-00068a-4b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] iscsi: fix deadlock during
	login
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e829b0bb054ed3389e5b22dad61875e51674e629
Author: Peter Lieven <pl@dlhnet.de>
Date:   Sat Nov 17 14:37:39 2012 +0100

    iscsi: fix deadlock during login
    
    If the connection is interrupted before the first login is successfully
    completed qemu-kvm is waiting forever in qemu_aio_wait().
    
    This is fixed by performing an sync login to the target. If the
    connection breaks after the first successful login errors are
    handled internally by libiscsi.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/iscsi.c |  251 ++++++++++++++++-----------------------------------------
 1 files changed, 70 insertions(+), 181 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index 5cd8b49..01340e1 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -65,13 +65,6 @@ typedef struct IscsiAIOCB {
 #endif
 } IscsiAIOCB;
 
-struct IscsiTask {
-    IscsiLun *iscsilun;
-    BlockDriverState *bs;
-    int status;
-    int complete;
-};
-
 static void
 iscsi_bh_cb(void *p)
 {
@@ -380,7 +373,7 @@ iscsi_aio_readv(BlockDriverState *bs, int64_t sector_num,
         *(uint16_t *)&acb->task->cdb[7] = htons(num_sectors);
         break;
     }
-    
+
     if (iscsi_scsi_command_async(iscsi, iscsilun->lun, acb->task,
                                  iscsi_aio_read16_cb,
                                  NULL,
@@ -665,163 +658,6 @@ iscsi_getlength(BlockDriverState *bs)
     return len;
 }
 
-static void
-iscsi_readcapacity16_cb(struct iscsi_context *iscsi, int status,
-                        void *command_data, void *opaque)
-{
-    struct IscsiTask *itask = opaque;
-    struct scsi_readcapacity16 *rc16;
-    struct scsi_task *task = command_data;
-
-    if (status != 0) {
-        error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",
-                     iscsi_get_error(iscsi));
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    rc16 = scsi_datain_unmarshall(task);
-    if (rc16 == NULL) {
-        error_report("iSCSI: Failed to unmarshall readcapacity16 data.");
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    itask->iscsilun->block_size = rc16->block_length;
-    itask->iscsilun->num_blocks = rc16->returned_lba + 1;
-    itask->bs->total_sectors    = itask->iscsilun->num_blocks *
-                               itask->iscsilun->block_size / BDRV_SECTOR_SIZE ;
-
-    itask->status   = 0;
-    itask->complete = 1;
-    scsi_free_scsi_task(task);
-}
-
-static void
-iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status,
-                        void *command_data, void *opaque)
-{
-    struct IscsiTask *itask = opaque;
-    struct scsi_readcapacity10 *rc10;
-    struct scsi_task *task = command_data;
-
-    if (status != 0) {
-        error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",
-                     iscsi_get_error(iscsi));
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    rc10 = scsi_datain_unmarshall(task);
-    if (rc10 == NULL) {
-        error_report("iSCSI: Failed to unmarshall readcapacity10 data.");
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    itask->iscsilun->block_size = rc10->block_size;
-    if (rc10->lba == 0) {
-        /* blank disk loaded */
-        itask->iscsilun->num_blocks = 0;
-    } else {
-        itask->iscsilun->num_blocks = rc10->lba + 1;
-    }
-    itask->bs->total_sectors    = itask->iscsilun->num_blocks *
-                               itask->iscsilun->block_size / BDRV_SECTOR_SIZE ;
-
-    itask->status   = 0;
-    itask->complete = 1;
-    scsi_free_scsi_task(task);
-}
-
-static void
-iscsi_inquiry_cb(struct iscsi_context *iscsi, int status, void *command_data,
-                 void *opaque)
-{
-    struct IscsiTask *itask = opaque;
-    struct scsi_task *task = command_data;
-    struct scsi_inquiry_standard *inq;
-
-    if (status != 0) {
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    inq = scsi_datain_unmarshall(task);
-    if (inq == NULL) {
-        error_report("iSCSI: Failed to unmarshall inquiry data.");
-        itask->status   = 1;
-        itask->complete = 1;
-        scsi_free_scsi_task(task);
-        return;
-    }
-
-    itask->iscsilun->type = inq->periperal_device_type;
-
-    scsi_free_scsi_task(task);
-
-    switch (itask->iscsilun->type) {
-    case TYPE_DISK:
-        task = iscsi_readcapacity16_task(iscsi, itask->iscsilun->lun,
-                                   iscsi_readcapacity16_cb, opaque);
-        if (task == NULL) {
-            error_report("iSCSI: failed to send readcapacity16 command.");
-            itask->status   = 1;
-            itask->complete = 1;
-            return;
-        }
-        break;
-    case TYPE_ROM:
-        task = iscsi_readcapacity10_task(iscsi, itask->iscsilun->lun,
-                                   0, 0,
-                                   iscsi_readcapacity10_cb, opaque);
-        if (task == NULL) {
-            error_report("iSCSI: failed to send readcapacity16 command.");
-            itask->status   = 1;
-            itask->complete = 1;
-            return;
-        }
-        break;
-    default:
-        itask->status   = 0;
-        itask->complete = 1;
-    }
-}
-
-static void
-iscsi_connect_cb(struct iscsi_context *iscsi, int status, void *command_data,
-                 void *opaque)
-{
-    struct IscsiTask *itask = opaque;
-    struct scsi_task *task;
-
-    if (status != 0) {
-        itask->status   = 1;
-        itask->complete = 1;
-        return;
-    }
-
-    task = iscsi_inquiry_task(iscsi, itask->iscsilun->lun,
-                              0, 0, 36,
-                              iscsi_inquiry_cb, opaque);
-    if (task == NULL) {
-        error_report("iSCSI: failed to send inquiry command.");
-        itask->status   = 1;
-        itask->complete = 1;
-        return;
-    }
-}
-
 static int parse_chap(struct iscsi_context *iscsi, const char *target)
 {
     QemuOptsList *list;
@@ -934,7 +770,10 @@ static int iscsi_open(BlockDriverState *bs, const char *filename, int flags)
     IscsiLun *iscsilun = bs->opaque;
     struct iscsi_context *iscsi = NULL;
     struct iscsi_url *iscsi_url = NULL;
-    struct IscsiTask task;
+    struct scsi_task *task = NULL;
+    struct scsi_inquiry_standard *inq = NULL;
+    struct scsi_readcapacity10 *rc10 = NULL;
+    struct scsi_readcapacity16 *rc16 = NULL;
     char *initiator_name = NULL;
     int ret;
 
@@ -997,33 +836,80 @@ static int iscsi_open(BlockDriverState *bs, const char *filename, int flags)
     /* check if we got HEADER_DIGEST via the options */
     parse_header_digest(iscsi, iscsi_url->target);
 
-    task.iscsilun = iscsilun;
-    task.status = 0;
-    task.complete = 0;
-    task.bs = bs;
+    if (iscsi_full_connect_sync(iscsi, iscsi_url->portal, iscsi_url->lun) != 0) {
+        error_report("iSCSI: Failed to connect to LUN : %s",
+            iscsi_get_error(iscsi));
+        ret = -EINVAL;
+        goto out;
+    }
 
     iscsilun->iscsi = iscsi;
     iscsilun->lun   = iscsi_url->lun;
 
-    if (iscsi_full_connect_async(iscsi, iscsi_url->portal, iscsi_url->lun,
-                                 iscsi_connect_cb, &task)
-        != 0) {
-        error_report("iSCSI: Failed to start async connect.");
+    task = iscsi_inquiry_sync(iscsi, iscsilun->lun, 0, 0, 36);
+
+    if (task == NULL || task->status != SCSI_STATUS_GOOD) {
+        error_report("iSCSI: failed to send inquiry command.");
         ret = -EINVAL;
         goto out;
     }
 
-    while (!task.complete) {
-        iscsi_set_events(iscsilun);
-        qemu_aio_wait();
-    }
-    if (task.status != 0) {
-        error_report("iSCSI: Failed to connect to LUN : %s",
-                     iscsi_get_error(iscsi));
+    inq = scsi_datain_unmarshall(task);
+    if (inq == NULL) {
+        error_report("iSCSI: Failed to unmarshall inquiry data.");
         ret = -EINVAL;
         goto out;
     }
 
+    iscsilun->type = inq->periperal_device_type;
+
+    scsi_free_scsi_task(task);
+
+    switch (iscsilun->type) {
+    case TYPE_DISK:
+        task = iscsi_readcapacity16_sync(iscsi, iscsilun->lun);
+        if (task == NULL || task->status != SCSI_STATUS_GOOD) {
+            error_report("iSCSI: failed to send readcapacity16 command.");
+            ret = -EINVAL;
+            goto out;
+        }
+        rc16 = scsi_datain_unmarshall(task);
+        if (rc16 == NULL) {
+            error_report("iSCSI: Failed to unmarshall readcapacity16 data.");
+            ret = -EINVAL;
+            goto out;
+        }
+        iscsilun->block_size = rc16->block_length;
+        iscsilun->num_blocks = rc16->returned_lba + 1;
+        break;
+    case TYPE_ROM:
+        task = iscsi_readcapacity10_sync(iscsi, iscsilun->lun, 0, 0);
+        if (task == NULL || task->status != SCSI_STATUS_GOOD) {
+            error_report("iSCSI: failed to send readcapacity10 command.");
+            ret = -EINVAL;
+            goto out;
+        }
+        rc10 = scsi_datain_unmarshall(task);
+        if (rc10 == NULL) {
+            error_report("iSCSI: Failed to unmarshall readcapacity10 data.");
+            ret = -EINVAL;
+            goto out;
+        }
+        iscsilun->block_size = rc10->block_size;
+        if (rc10->lba == 0) {
+            /* blank disk loaded */
+            iscsilun->num_blocks = 0;
+        } else {
+            iscsilun->num_blocks = rc10->lba + 1;
+        }
+        break;
+    default:
+        break;
+    }
+
+    bs->total_sectors    = iscsilun->num_blocks *
+                           iscsilun->block_size / BDRV_SECTOR_SIZE ;
+
     /* Medium changer or tape. We dont have any emulation for this so this must
      * be sg ioctl compatible. We force it to be sg, otherwise qemu will try
      * to read from the device to guess the image format.
@@ -1042,6 +928,9 @@ out:
     if (iscsi_url != NULL) {
         iscsi_destroy_url(iscsi_url);
     }
+    if (task != NULL) {
+        scsi_free_scsi_task(task);
+    }
 
     if (ret) {
         if (iscsi != NULL) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLw-0004bX-2J; Tue, 11 Dec 2012 13:58:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLv-0004bD-Ke
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:31 +0000
Received: from [193.109.254.147:53750] by server-3.bemta-14.messagelabs.com id
	B8/79-01317-60C37C05; Tue, 11 Dec 2012 13:58:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1355234298!2498229!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5179 invoked from network); 11 Dec 2012 13:58:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:58:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLi-0001Y0-0A
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLh-00068B-TF
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:17 +0000
Date: Tue, 11 Dec 2012 13:58:17 +0000
Message-Id: <E1TiQLh-00068B-TF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] iscsi: fix segfault in url
	parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8da1e18b0cf46b6c95c88bbad1cc50d6dd1bef4b
Author: Peter Lieven <pl@dlhnet.de>
Date:   Thu Nov 15 15:42:06 2012 +0100

    iscsi: fix segfault in url parsing
    
    If an invalid URL is specified iscsi_get_error(iscsi) is called
    with iscsi == NULL.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/iscsi.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index a6a819d..5cd8b49 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -947,8 +947,7 @@ static int iscsi_open(BlockDriverState *bs, const char *filename, int flags)
 
     iscsi_url = iscsi_parse_full_url(iscsi, filename);
     if (iscsi_url == NULL) {
-        error_report("Failed to parse URL : %s %s", filename,
-                     iscsi_get_error(iscsi));
+        error_report("Failed to parse URL : %s", filename);
         ret = -EINVAL;
         goto out;
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQLw-0004bX-2J; Tue, 11 Dec 2012 13:58:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLv-0004bD-Ke
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:31 +0000
Received: from [193.109.254.147:53750] by server-3.bemta-14.messagelabs.com id
	B8/79-01317-60C37C05; Tue, 11 Dec 2012 13:58:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1355234298!2498229!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5179 invoked from network); 11 Dec 2012 13:58:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:58:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLi-0001Y0-0A
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQLh-00068B-TF
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:17 +0000
Date: Tue, 11 Dec 2012 13:58:17 +0000
Message-Id: <E1TiQLh-00068B-TF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] iscsi: fix segfault in url
	parsing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8da1e18b0cf46b6c95c88bbad1cc50d6dd1bef4b
Author: Peter Lieven <pl@dlhnet.de>
Date:   Thu Nov 15 15:42:06 2012 +0100

    iscsi: fix segfault in url parsing
    
    If an invalid URL is specified iscsi_get_error(iscsi) is called
    with iscsi == NULL.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/iscsi.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index a6a819d..5cd8b49 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -947,8 +947,7 @@ static int iscsi_open(BlockDriverState *bs, const char *filename, int flags)
 
     iscsi_url = iscsi_parse_full_url(iscsi, filename);
     if (iscsi_url == NULL) {
-        error_report("Failed to parse URL : %s %s", filename,
-                     iscsi_get_error(iscsi));
+        error_report("Failed to parse URL : %s", filename);
         ret = -EINVAL;
         goto out;
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQM9-0004ed-5R; Tue, 11 Dec 2012 13:58:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQM8-0004eN-CX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:44 +0000
Received: from [85.158.139.83:31151] by server-12.bemta-5.messagelabs.com id
	97/FA-02275-31C37C05; Tue, 11 Dec 2012 13:58:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1355234318!22012931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15371 invoked from network); 11 Dec 2012 13:58:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:58:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQM2-0001YE-Dq
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQM2-00069a-9V
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:38 +0000
Date: Tue, 11 Dec 2012 13:58:38 +0000
Message-Id: <E1TiQM2-00069a-9V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] iscsi: do not assume
	device is zero initialized
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f807ecd5741325fe0d281199ff22cdda0acb6a7a
Author: Peter Lieven <pl@dlhnet.de>
Date:   Sat Nov 17 16:20:28 2012 +0100

    iscsi: do not assume device is zero initialized
    
    Without any complex checks we can't assume that an
    iscsi target is initialized to zero.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/iscsi.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index 01340e1..c0b70b3 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -951,6 +951,11 @@ static void iscsi_close(BlockDriverState *bs)
     memset(iscsilun, 0, sizeof(IscsiLun));
 }
 
+static int iscsi_has_zero_init(BlockDriverState *bs)
+{
+    return 0;
+}
+
 static BlockDriver bdrv_iscsi = {
     .format_name     = "iscsi",
     .protocol_name   = "iscsi",
@@ -966,6 +971,7 @@ static BlockDriver bdrv_iscsi = {
     .bdrv_aio_flush  = iscsi_aio_flush,
 
     .bdrv_aio_discard = iscsi_aio_discard,
+    .bdrv_has_zero_init = iscsi_has_zero_init,
 
 #ifdef __linux__
     .bdrv_ioctl       = iscsi_ioctl,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQM9-0004ed-5R; Tue, 11 Dec 2012 13:58:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQM8-0004eN-CX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:44 +0000
Received: from [85.158.139.83:31151] by server-12.bemta-5.messagelabs.com id
	97/FA-02275-31C37C05; Tue, 11 Dec 2012 13:58:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1355234318!22012931!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15371 invoked from network); 11 Dec 2012 13:58:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:58:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQM2-0001YE-Dq
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQM2-00069a-9V
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:38 +0000
Date: Tue, 11 Dec 2012 13:58:38 +0000
Message-Id: <E1TiQM2-00069a-9V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] iscsi: do not assume
	device is zero initialized
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f807ecd5741325fe0d281199ff22cdda0acb6a7a
Author: Peter Lieven <pl@dlhnet.de>
Date:   Sat Nov 17 16:20:28 2012 +0100

    iscsi: do not assume device is zero initialized
    
    Without any complex checks we can't assume that an
    iscsi target is initialized to zero.
    
    Signed-off-by: Peter Lieven <pl@kamp.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/iscsi.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index 01340e1..c0b70b3 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -951,6 +951,11 @@ static void iscsi_close(BlockDriverState *bs)
     memset(iscsilun, 0, sizeof(IscsiLun));
 }
 
+static int iscsi_has_zero_init(BlockDriverState *bs)
+{
+    return 0;
+}
+
 static BlockDriver bdrv_iscsi = {
     .format_name     = "iscsi",
     .protocol_name   = "iscsi",
@@ -966,6 +971,7 @@ static BlockDriver bdrv_iscsi = {
     .bdrv_aio_flush  = iscsi_aio_flush,
 
     .bdrv_aio_discard = iscsi_aio_discard,
+    .bdrv_has_zero_init = iscsi_has_zero_init,
 
 #ifdef __linux__
     .bdrv_ioctl       = iscsi_ioctl,
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMH-0004gF-AA; Tue, 11 Dec 2012 13:58:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMF-0004fo-Qf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:52 +0000
Received: from [85.158.137.99:22732] by server-5.bemta-3.messagelabs.com id
	C4/44-15136-B1C37C05; Tue, 11 Dec 2012 13:58:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1355234329!18897944!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 800 invoked from network); 11 Dec 2012 13:58:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:58:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMC-0001YK-M4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMC-0006A6-Hd
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:48 +0000
Date: Tue, 11 Dec 2012 13:58:48 +0000
Message-Id: <E1TiQMC-0006A6-Hd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-scsi: Fix some
	endian bugs with virtio-scsi
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 474ee55a18765e7de8f0b2cc00db5d26286bb24d
Author: David Gibson <david@gibson.dropbear.id.au>
Date:   Fri Nov 23 16:08:44 2012 +1100

    virtio-scsi: Fix some endian bugs with virtio-scsi
    
    The virtio-scsi specification does not specify the correct endianness for
    fields in the request structure.  It's therefore best to assume that it is
    "guest native" endian since that's the (stupid and poorly defined) norm in
    virtio.
    
    However, the qemu device for virtio-scsi has no byteswaps at all, and so
    will break if the guest has different endianness from the host.  This patch
    fixes it by adding tswap() calls for the sense_len and resid fields in
    the request structure.  In theory status_qualifier needs swaps as well,
    but that field is never actually touched.  The tag field is a uint64_t, but
    since its value is completely arbitrary, it might as well be uint8_t[8]
    and so it does not need swapping.
    
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Paul 'Rusty' Russell <rusty@rustcorp.com.au>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/virtio-scsi.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index 7d546f6..924fc69 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -424,15 +424,17 @@ static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status,
                                          size_t resid)
 {
     VirtIOSCSIReq *req = r->hba_private;
+    uint32_t sense_len;
 
     req->resp.cmd->response = VIRTIO_SCSI_S_OK;
     req->resp.cmd->status = status;
     if (req->resp.cmd->status == GOOD) {
-        req->resp.cmd->resid = resid;
+        req->resp.cmd->resid = tswap32(resid);
     } else {
         req->resp.cmd->resid = 0;
-        req->resp.cmd->sense_len =
-            scsi_req_get_sense(r, req->resp.cmd->sense, VIRTIO_SCSI_SENSE_SIZE);
+        sense_len = scsi_req_get_sense(r, req->resp.cmd->sense,
+                                       VIRTIO_SCSI_SENSE_SIZE);
+        req->resp.cmd->sense_len = tswap32(sense_len);
     }
     virtio_scsi_complete_req(req);
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:58:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:58:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMH-0004gF-AA; Tue, 11 Dec 2012 13:58:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMF-0004fo-Qf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:52 +0000
Received: from [85.158.137.99:22732] by server-5.bemta-3.messagelabs.com id
	C4/44-15136-B1C37C05; Tue, 11 Dec 2012 13:58:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1355234329!18897944!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 800 invoked from network); 11 Dec 2012 13:58:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:58:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMC-0001YK-M4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMC-0006A6-Hd
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:48 +0000
Date: Tue, 11 Dec 2012 13:58:48 +0000
Message-Id: <E1TiQMC-0006A6-Hd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-scsi: Fix some
	endian bugs with virtio-scsi
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 474ee55a18765e7de8f0b2cc00db5d26286bb24d
Author: David Gibson <david@gibson.dropbear.id.au>
Date:   Fri Nov 23 16:08:44 2012 +1100

    virtio-scsi: Fix some endian bugs with virtio-scsi
    
    The virtio-scsi specification does not specify the correct endianness for
    fields in the request structure.  It's therefore best to assume that it is
    "guest native" endian since that's the (stupid and poorly defined) norm in
    virtio.
    
    However, the qemu device for virtio-scsi has no byteswaps at all, and so
    will break if the guest has different endianness from the host.  This patch
    fixes it by adding tswap() calls for the sense_len and resid fields in
    the request structure.  In theory status_qualifier needs swaps as well,
    but that field is never actually touched.  The tag field is a uint64_t, but
    since its value is completely arbitrary, it might as well be uint8_t[8]
    and so it does not need swapping.
    
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Paul 'Rusty' Russell <rusty@rustcorp.com.au>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/virtio-scsi.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index 7d546f6..924fc69 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -424,15 +424,17 @@ static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status,
                                          size_t resid)
 {
     VirtIOSCSIReq *req = r->hba_private;
+    uint32_t sense_len;
 
     req->resp.cmd->response = VIRTIO_SCSI_S_OK;
     req->resp.cmd->status = status;
     if (req->resp.cmd->status == GOOD) {
-        req->resp.cmd->resid = resid;
+        req->resp.cmd->resid = tswap32(resid);
     } else {
         req->resp.cmd->resid = 0;
-        req->resp.cmd->sense_len =
-            scsi_req_get_sense(r, req->resp.cmd->sense, VIRTIO_SCSI_SENSE_SIZE);
+        sense_len = scsi_req_get_sense(r, req->resp.cmd->sense,
+                                       VIRTIO_SCSI_SENSE_SIZE);
+        req->resp.cmd->sense_len = tswap32(sense_len);
     }
     virtio_scsi_complete_req(req);
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:03 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMR-0004iN-FP; Tue, 11 Dec 2012 13:59:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMP-0004i1-Uj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:02 +0000
Received: from [85.158.143.35:52174] by server-3.bemta-4.messagelabs.com id
	DC/6E-18211-52C37C05; Tue, 11 Dec 2012 13:59:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1355234132!12449086!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16106 invoked from network); 11 Dec 2012 13:55:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJ2-0001Uj-83
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJ1-0005xn-TK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:31 +0000
Date: Tue, 11 Dec 2012 13:55:31 +0000
Message-Id: <E1TiQJ1-0005xn-TK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-rng: do not use
	g_assert_cmpint
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 03a36f17d7788e4a1e07b3341b18028aa0206845
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Tue Nov 27 09:16:24 2012 +0100

    virtio-rng: do not use g_assert_cmpint
    
    g_assert_cmpint is not available on glib 2.12, which is the minimum
    version required to build QEMU (we only require 2.16 to run tests,
    since that is the first version including GTester).  Do not use it
    in hardware models, use a normal assertion instead.
    
    This fixes the buildbot failure for default_x86_64_rhel5.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index f4ed9cf..df329f2 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -173,10 +173,9 @@ VirtIODevice *virtio_rng_init(DeviceState *dev, VirtIORNGConf *conf)
     vrng->qdev = dev;
     vrng->conf = conf;
 
+    assert(vrng->conf->max_bytes <= INT64_MAX);
     vrng->quota_remaining = vrng->conf->max_bytes;
 
-    g_assert_cmpint(vrng->conf->max_bytes, <=, INT64_MAX);
-
     vrng->rate_limit_timer = qemu_new_timer_ms(vm_clock,
                                                check_rate_limit, vrng);
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:03 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMR-0004iN-FP; Tue, 11 Dec 2012 13:59:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMP-0004i1-Uj
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:02 +0000
Received: from [85.158.143.35:52174] by server-3.bemta-4.messagelabs.com id
	DC/6E-18211-52C37C05; Tue, 11 Dec 2012 13:59:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1355234132!12449086!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16106 invoked from network); 11 Dec 2012 13:55:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:55:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJ2-0001Uj-83
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJ1-0005xn-TK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:55:31 +0000
Date: Tue, 11 Dec 2012 13:55:31 +0000
Message-Id: <E1TiQJ1-0005xn-TK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-rng: do not use
	g_assert_cmpint
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 03a36f17d7788e4a1e07b3341b18028aa0206845
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Tue Nov 27 09:16:24 2012 +0100

    virtio-rng: do not use g_assert_cmpint
    
    g_assert_cmpint is not available on glib 2.12, which is the minimum
    version required to build QEMU (we only require 2.16 to run tests,
    since that is the first version including GTester).  Do not use it
    in hardware models, use a normal assertion instead.
    
    This fixes the buildbot failure for default_x86_64_rhel5.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index f4ed9cf..df329f2 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -173,10 +173,9 @@ VirtIODevice *virtio_rng_init(DeviceState *dev, VirtIORNGConf *conf)
     vrng->qdev = dev;
     vrng->conf = conf;
 
+    assert(vrng->conf->max_bytes <= INT64_MAX);
     vrng->quota_remaining = vrng->conf->max_bytes;
 
-    g_assert_cmpint(vrng->conf->max_bytes, <=, INT64_MAX);
-
     vrng->rate_limit_timer = qemu_new_timer_ms(vm_clock,
                                                check_rate_limit, vrng);
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:05 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMT-0004jA-Hz; Tue, 11 Dec 2012 13:59:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMR-0004i0-Pv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:04 +0000
Received: from [85.158.137.99:10857] by server-14.bemta-3.messagelabs.com id
	F1/99-27443-52C37C05; Tue, 11 Dec 2012 13:59:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1355234339!15716984!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10491 invoked from network); 11 Dec 2012 13:59:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMM-0001YT-SB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMM-0006AT-Q5
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:58 +0000
Date: Tue, 11 Dec 2012 13:58:58 +0000
Message-Id: <E1TiQMM-0006AT-Q5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-scsi: Fix subtle
	(guest) endian bug
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 863d1050c96cff91dd478767c0da9cc288575919
Author: David Gibson <david@gibson.dropbear.id.au>
Date:   Mon Nov 26 12:33:52 2012 +1100

    virtio-scsi: Fix subtle (guest) endian bug
    
    The virtio-scsi config space is, by specification, in guest endian (which
    is ill-defined, but there you go).  In virtio_scsi_get_config() we set up
    all the fields in there, using stl_raw().  Which is a problem for the
    max_channel and max_target fields, which are 16-bit, not 32-bit.  For
    little-endian targets we get away with it by accident, since the first
    two bytes will still be correct, and the extra two bytes written (with
    zeroes) will be overwritten correctly by the next store.
    
    But for big-endian guests, this means the max_target field ends up as zero,
    which means the guest will only recognize a single disk on the virtio-scsi
    bus.  This patch fixes the problem.
    
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Paul 'Rusty' Russell <rusty@rustcorp.com.au>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/virtio-scsi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index 924fc69..bfe1860 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -534,8 +534,8 @@ static void virtio_scsi_get_config(VirtIODevice *vdev,
     stl_raw(&scsiconf->event_info_size, sizeof(VirtIOSCSIEvent));
     stl_raw(&scsiconf->sense_size, s->sense_size);
     stl_raw(&scsiconf->cdb_size, s->cdb_size);
-    stl_raw(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL);
-    stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET);
+    stw_raw(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL);
+    stw_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET);
     stl_raw(&scsiconf->max_lun, VIRTIO_SCSI_MAX_LUN);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:05 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMT-0004jA-Hz; Tue, 11 Dec 2012 13:59:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMR-0004i0-Pv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:04 +0000
Received: from [85.158.137.99:10857] by server-14.bemta-3.messagelabs.com id
	F1/99-27443-52C37C05; Tue, 11 Dec 2012 13:59:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1355234339!15716984!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10491 invoked from network); 11 Dec 2012 13:59:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMM-0001YT-SB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMM-0006AT-Q5
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:58:58 +0000
Date: Tue, 11 Dec 2012 13:58:58 +0000
Message-Id: <E1TiQMM-0006AT-Q5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio-scsi: Fix subtle
	(guest) endian bug
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 863d1050c96cff91dd478767c0da9cc288575919
Author: David Gibson <david@gibson.dropbear.id.au>
Date:   Mon Nov 26 12:33:52 2012 +1100

    virtio-scsi: Fix subtle (guest) endian bug
    
    The virtio-scsi config space is, by specification, in guest endian (which
    is ill-defined, but there you go).  In virtio_scsi_get_config() we set up
    all the fields in there, using stl_raw().  Which is a problem for the
    max_channel and max_target fields, which are 16-bit, not 32-bit.  For
    little-endian targets we get away with it by accident, since the first
    two bytes will still be correct, and the extra two bytes written (with
    zeroes) will be overwritten correctly by the next store.
    
    But for big-endian guests, this means the max_target field ends up as zero,
    which means the guest will only recognize a single disk on the virtio-scsi
    bus.  This patch fixes the problem.
    
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Paul 'Rusty' Russell <rusty@rustcorp.com.au>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/virtio-scsi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index 924fc69..bfe1860 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -534,8 +534,8 @@ static void virtio_scsi_get_config(VirtIODevice *vdev,
     stl_raw(&scsiconf->event_info_size, sizeof(VirtIOSCSIEvent));
     stl_raw(&scsiconf->sense_size, s->sense_size);
     stl_raw(&scsiconf->cdb_size, s->cdb_size);
-    stl_raw(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL);
-    stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET);
+    stw_raw(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL);
+    stw_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET);
     stl_raw(&scsiconf->max_lun, VIRTIO_SCSI_MAX_LUN);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMg-0004mE-Ks; Tue, 11 Dec 2012 13:59:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMf-0004li-CC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:17 +0000
Received: from [193.109.254.147:59017] by server-2.bemta-14.messagelabs.com id
	E2/1B-20829-43C37C05; Tue, 11 Dec 2012 13:59:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1355234349!9973209!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27370 invoked from network); 11 Dec 2012 13:59:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMX-0001Z5-1H
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMW-0006Av-W7
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:09 +0000
Date: Tue, 11 Dec 2012 13:59:08 +0000
Message-Id: <E1TiQMW-0006Av-W7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'bonzini/scsi-next' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6451fd372bbac8123414a88ed6d3296b66d4b5d
Merge: 0a6b2ac0cf92a4411cce38a22703d7a34a5b3601 863d1050c96cff91dd478767c0da9cc288575919
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed Nov 28 13:19:24 2012 -0600

    Merge remote-tracking branch 'bonzini/scsi-next' into staging
    
    * bonzini/scsi-next:
      virtio-scsi: Fix subtle (guest) endian bug
      virtio-scsi: Fix some endian bugs with virtio-scsi
      iscsi: do not assume device is zero initialized
      iscsi: fix deadlock during login
      iscsi: fix segfault in url parsing
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 block/iscsi.c    |  260 ++++++++++++++++--------------------------------------
 hw/virtio-scsi.c |   12 ++-
 2 files changed, 84 insertions(+), 188 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMg-0004mE-Ks; Tue, 11 Dec 2012 13:59:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMf-0004li-CC
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:17 +0000
Received: from [193.109.254.147:59017] by server-2.bemta-14.messagelabs.com id
	E2/1B-20829-43C37C05; Tue, 11 Dec 2012 13:59:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1355234349!9973209!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27370 invoked from network); 11 Dec 2012 13:59:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMX-0001Z5-1H
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMW-0006Av-W7
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:09 +0000
Date: Tue, 11 Dec 2012 13:59:08 +0000
Message-Id: <E1TiQMW-0006Av-W7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'bonzini/scsi-next' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6451fd372bbac8123414a88ed6d3296b66d4b5d
Merge: 0a6b2ac0cf92a4411cce38a22703d7a34a5b3601 863d1050c96cff91dd478767c0da9cc288575919
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed Nov 28 13:19:24 2012 -0600

    Merge remote-tracking branch 'bonzini/scsi-next' into staging
    
    * bonzini/scsi-next:
      virtio-scsi: Fix subtle (guest) endian bug
      virtio-scsi: Fix some endian bugs with virtio-scsi
      iscsi: do not assume device is zero initialized
      iscsi: fix deadlock during login
      iscsi: fix segfault in url parsing
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 block/iscsi.c    |  260 ++++++++++++++++--------------------------------------
 hw/virtio-scsi.c |   12 ++-
 2 files changed, 84 insertions(+), 188 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMl-0004nL-NV; Tue, 11 Dec 2012 13:59:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMk-0004n7-KO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:22 +0000
Received: from [85.158.137.99:29264] by server-11.bemta-3.messagelabs.com id
	38/94-13335-93C37C05; Tue, 11 Dec 2012 13:59:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1355234359!18018956!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32383 invoked from network); 11 Dec 2012 13:59:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMh-0001Z8-Hc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMh-0006Bc-Ck
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:19 +0000
Date: Tue, 11 Dec 2012 13:59:19 +0000
Message-Id: <E1TiQMh-0006Bc-Ck@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] nbd: fix use of two
	uninitialized bytes when connecting to a named export
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ffaaba0e939f2a284bb23d1f6f7f9e2104a97e2
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Mon Nov 26 15:19:31 2012 +0100

    nbd: fix use of two uninitialized bytes when connecting to a named export
    
    Reported-by: Michal Privoznik <mprivoznik@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 nbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/nbd.c b/nbd.c
index 97a5914..01976e8 100644
--- a/nbd.c
+++ b/nbd.c
@@ -397,6 +397,7 @@ static int nbd_send_negotiate(NBDClient *client)
     rc = -EINVAL;
 
     TRACE("Beginning negotiation.");
+    memset(buf, 0, sizeof(buf));
     memcpy(buf, "NBDMAGIC", 8);
     if (client->exp) {
         assert ((client->exp->nbdflags & ~65535) == 0);
@@ -406,7 +407,6 @@ static int nbd_send_negotiate(NBDClient *client)
     } else {
         cpu_to_be64w((uint64_t*)(buf + 8), NBD_OPTS_MAGIC);
     }
-    memset(buf + 28, 0, 124);
 
     if (client->exp) {
         if (write_sync(csock, buf, sizeof(buf)) != sizeof(buf)) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMl-0004nL-NV; Tue, 11 Dec 2012 13:59:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMk-0004n7-KO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:22 +0000
Received: from [85.158.137.99:29264] by server-11.bemta-3.messagelabs.com id
	38/94-13335-93C37C05; Tue, 11 Dec 2012 13:59:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1355234359!18018956!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32383 invoked from network); 11 Dec 2012 13:59:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMh-0001Z8-Hc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMh-0006Bc-Ck
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:19 +0000
Date: Tue, 11 Dec 2012 13:59:19 +0000
Message-Id: <E1TiQMh-0006Bc-Ck@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] nbd: fix use of two
	uninitialized bytes when connecting to a named export
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ffaaba0e939f2a284bb23d1f6f7f9e2104a97e2
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Mon Nov 26 15:19:31 2012 +0100

    nbd: fix use of two uninitialized bytes when connecting to a named export
    
    Reported-by: Michal Privoznik <mprivoznik@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 nbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/nbd.c b/nbd.c
index 97a5914..01976e8 100644
--- a/nbd.c
+++ b/nbd.c
@@ -397,6 +397,7 @@ static int nbd_send_negotiate(NBDClient *client)
     rc = -EINVAL;
 
     TRACE("Beginning negotiation.");
+    memset(buf, 0, sizeof(buf));
     memcpy(buf, "NBDMAGIC", 8);
     if (client->exp) {
         assert ((client->exp->nbdflags & ~65535) == 0);
@@ -406,7 +407,6 @@ static int nbd_send_negotiate(NBDClient *client)
     } else {
         cpu_to_be64w((uint64_t*)(buf + 8), NBD_OPTS_MAGIC);
     }
-    memset(buf + 28, 0, 124);
 
     if (client->exp) {
         if (write_sync(csock, buf, sizeof(buf)) != sizeof(buf)) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMv-0004pe-Qg; Tue, 11 Dec 2012 13:59:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMu-0004pH-5N
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:32 +0000
Received: from [193.109.254.147:62447] by server-10.bemta-14.messagelabs.com
	id 18/8E-31741-34C37C05; Tue, 11 Dec 2012 13:59:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1355234369!8680594!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4302 invoked from network); 11 Dec 2012 13:59:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMr-0001ZG-NE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMr-0006C0-Kh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:29 +0000
Date: Tue, 11 Dec 2012 13:59:29 +0000
Message-Id: <E1TiQMr-0006C0-Kh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] nbd-server-add: Fix the
	default for 'writable'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f3313d23a061648c99609a4c127ed13c820f831d
Author: Michal Privoznik <mprivozn@redhat.com>
Date:   Wed Nov 28 11:46:39 2012 +0100

    nbd-server-add: Fix the default for 'writable'
    
    The documentation to this monitor command tells, that 'writable'
    argument is optional and defaults to false. However, the code sets
    true as the default. But since some applications may already been
    using this, it's safer to fix the code and not documentation which
    would break those applications.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 blockdev-nbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index d1721a3..6b26bbf 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -99,7 +99,7 @@ void qmp_nbd_server_add(const char *device, bool has_writable, bool writable,
     }
 
     if (!has_writable) {
-        writable = true;
+        writable = false;
     }
     if (bdrv_is_read_only(bs)) {
         writable = false;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQMv-0004pe-Qg; Tue, 11 Dec 2012 13:59:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMu-0004pH-5N
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:32 +0000
Received: from [193.109.254.147:62447] by server-10.bemta-14.messagelabs.com
	id 18/8E-31741-34C37C05; Tue, 11 Dec 2012 13:59:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1355234369!8680594!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4302 invoked from network); 11 Dec 2012 13:59:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMr-0001ZG-NE
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQMr-0006C0-Kh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:29 +0000
Date: Tue, 11 Dec 2012 13:59:29 +0000
Message-Id: <E1TiQMr-0006C0-Kh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] nbd-server-add: Fix the
	default for 'writable'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f3313d23a061648c99609a4c127ed13c820f831d
Author: Michal Privoznik <mprivozn@redhat.com>
Date:   Wed Nov 28 11:46:39 2012 +0100

    nbd-server-add: Fix the default for 'writable'
    
    The documentation to this monitor command tells, that 'writable'
    argument is optional and defaults to false. However, the code sets
    true as the default. But since some applications may already been
    using this, it's safer to fix the code and not documentation which
    would break those applications.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 blockdev-nbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index d1721a3..6b26bbf 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -99,7 +99,7 @@ void qmp_nbd_server_add(const char *device, bool has_writable, bool writable,
     }
 
     if (!has_writable) {
-        writable = true;
+        writable = false;
     }
     if (bdrv_is_read_only(bs)) {
         writable = false;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:44 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQN5-0004rq-Ts; Tue, 11 Dec 2012 13:59:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQN4-0004rS-U2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:43 +0000
Received: from [85.158.138.51:11453] by server-15.bemta-3.messagelabs.com id
	78/06-07921-E4C37C05; Tue, 11 Dec 2012 13:59:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1355234380!28104467!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25329 invoked from network); 11 Dec 2012 13:59:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQN1-0001ZM-Sh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQN1-0006DC-RL
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:39 +0000
Date: Tue, 11 Dec 2012 13:59:39 +0000
Message-Id: <E1TiQN1-0006DC-RL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'bonzini/nbd-next' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 264ac41ca171c53eead7e037bc78babb3f0f1bc3
Merge: e6451fd372bbac8123414a88ed6d3296b66d4b5d f3313d23a061648c99609a4c127ed13c820f831d
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed Nov 28 13:19:30 2012 -0600

    Merge remote-tracking branch 'bonzini/nbd-next' into staging
    
    * bonzini/nbd-next:
      nbd-server-add: Fix the default for 'writable'
      nbd: fix use of two uninitialized bytes when connecting to a named export
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 blockdev-nbd.c |    2 +-
 nbd.c          |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:44 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQN5-0004rq-Ts; Tue, 11 Dec 2012 13:59:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQN4-0004rS-U2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:43 +0000
Received: from [85.158.138.51:11453] by server-15.bemta-3.messagelabs.com id
	78/06-07921-E4C37C05; Tue, 11 Dec 2012 13:59:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1355234380!28104467!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25329 invoked from network); 11 Dec 2012 13:59:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQN1-0001ZM-Sh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQN1-0006DC-RL
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:39 +0000
Date: Tue, 11 Dec 2012 13:59:39 +0000
Message-Id: <E1TiQN1-0006DC-RL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'bonzini/nbd-next' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 264ac41ca171c53eead7e037bc78babb3f0f1bc3
Merge: e6451fd372bbac8123414a88ed6d3296b66d4b5d f3313d23a061648c99609a4c127ed13c820f831d
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed Nov 28 13:19:30 2012 -0600

    Merge remote-tracking branch 'bonzini/nbd-next' into staging
    
    * bonzini/nbd-next:
      nbd-server-add: Fix the default for 'writable'
      nbd: fix use of two uninitialized bytes when connecting to a named export
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 blockdev-nbd.c |    2 +-
 nbd.c          |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQN9-0004sp-0W; Tue, 11 Dec 2012 13:59:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQN7-0004sL-GI
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:45 +0000
Received: from [85.158.143.35:54556] by server-3.bemta-4.messagelabs.com id
	9C/9F-18211-05C37C05; Tue, 11 Dec 2012 13:59:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1355234184!13573365!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9429 invoked from network); 11 Dec 2012 13:56:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJs-0001Vd-Hy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJs-00060J-7n
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:24 +0000
Date: Tue, 11 Dec 2012 13:56:24 +0000
Message-Id: <E1TiQJs-00060J-7n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'afaerber/qom-cpu-1.3' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f3d44eb53c10b4dddfb3762c3e005be38adfc0ed
Merge: cbdd1999daf2341b33d3ba8036fd84898e1e7c31 a0a7068104cc9908d0875404b0fa2ebf46e40f97
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed Nov 28 13:18:56 2012 -0600

    Merge remote-tracking branch 'afaerber/qom-cpu-1.3' into staging
    
    * afaerber/qom-cpu-1.3:
      target-i386: Enable SSSE3 TCG support
      target-i386/cpu: Add missing flags to Haswell CPU model
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 target-i386/cpu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQN9-0004sp-0W; Tue, 11 Dec 2012 13:59:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQN7-0004sL-GI
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:45 +0000
Received: from [85.158.143.35:54556] by server-3.bemta-4.messagelabs.com id
	9C/9F-18211-05C37C05; Tue, 11 Dec 2012 13:59:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1355234184!13573365!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9429 invoked from network); 11 Dec 2012 13:56:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:56:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJs-0001Vd-Hy
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQJs-00060J-7n
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:56:24 +0000
Date: Tue, 11 Dec 2012 13:56:24 +0000
Message-Id: <E1TiQJs-00060J-7n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'afaerber/qom-cpu-1.3' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f3d44eb53c10b4dddfb3762c3e005be38adfc0ed
Merge: cbdd1999daf2341b33d3ba8036fd84898e1e7c31 a0a7068104cc9908d0875404b0fa2ebf46e40f97
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed Nov 28 13:18:56 2012 -0600

    Merge remote-tracking branch 'afaerber/qom-cpu-1.3' into staging
    
    * afaerber/qom-cpu-1.3:
      target-i386: Enable SSSE3 TCG support
      target-i386/cpu: Add missing flags to Haswell CPU model
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 target-i386/cpu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQNG-0004uf-3N; Tue, 11 Dec 2012 13:59:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNE-0004uJ-Un
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:53 +0000
Received: from [85.158.138.51:12451] by server-15.bemta-3.messagelabs.com id
	B6/66-07921-85C37C05; Tue, 11 Dec 2012 13:59:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1355234390!20327155!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23714 invoked from network); 11 Dec 2012 13:59:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNC-0001ZV-1g
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNC-0006DY-02
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:50 +0000
Date: Tue, 11 Dec 2012 13:59:50 +0000
Message-Id: <E1TiQNC-0006DY-02@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] event notifier: Fix setup
	for win32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e9bff10f8db94912b1b0e6e2e3394cae02faf614
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Thu Nov 22 20:56:11 2012 +0100

    event notifier: Fix setup for win32
    
    The event notifier state is only reset by test_and_clear. But we created
    the windows event object with auto-reset, which subtly swallowed events.
    
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 event_notifier-win32.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/event_notifier-win32.c b/event_notifier-win32.c
index c723dad..4ed21c2 100644
--- a/event_notifier-win32.c
+++ b/event_notifier-win32.c
@@ -16,7 +16,7 @@
 
 int event_notifier_init(EventNotifier *e, int active)
 {
-    e->event = CreateEvent(NULL, FALSE, FALSE, NULL);
+    e->event = CreateEvent(NULL, TRUE, FALSE, NULL);
     assert(e->event);
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 13:59:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 13:59:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQNG-0004uf-3N; Tue, 11 Dec 2012 13:59:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNE-0004uJ-Un
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:53 +0000
Received: from [85.158.138.51:12451] by server-15.bemta-3.messagelabs.com id
	B6/66-07921-85C37C05; Tue, 11 Dec 2012 13:59:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1355234390!20327155!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23714 invoked from network); 11 Dec 2012 13:59:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:59:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNC-0001ZV-1g
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNC-0006DY-02
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:59:50 +0000
Date: Tue, 11 Dec 2012 13:59:50 +0000
Message-Id: <E1TiQNC-0006DY-02@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] event notifier: Fix setup
	for win32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e9bff10f8db94912b1b0e6e2e3394cae02faf614
Author: Jan Kiszka <jan.kiszka@siemens.com>
Date:   Thu Nov 22 20:56:11 2012 +0100

    event notifier: Fix setup for win32
    
    The event notifier state is only reset by test_and_clear. But we created
    the windows event object with auto-reset, which subtly swallowed events.
    
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 event_notifier-win32.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/event_notifier-win32.c b/event_notifier-win32.c
index c723dad..4ed21c2 100644
--- a/event_notifier-win32.c
+++ b/event_notifier-win32.c
@@ -16,7 +16,7 @@
 
 int event_notifier_init(EventNotifier *e, int active)
 {
-    e->event = CreateEvent(NULL, FALSE, FALSE, NULL);
+    e->event = CreateEvent(NULL, TRUE, FALSE, NULL);
     assert(e->event);
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:00:05 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:00:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQNR-00051A-6S; Tue, 11 Dec 2012 14:00:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNP-00050d-G0
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:03 +0000
Received: from [85.158.137.99:48342] by server-7.bemta-3.messagelabs.com id
	26/C7-23008-26C37C05; Tue, 11 Dec 2012 14:00:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1355234400!12639406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18725 invoked from network); 11 Dec 2012 14:00:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNM-0001Zb-7e
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNM-0006Dw-5C
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:00 +0000
Date: Tue, 11 Dec 2012 14:00:00 +0000
Message-Id: <E1TiQNM-0006Dw-5C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qdev: relax bus type check
	in qdev_device_add() (v2)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e912c96f7d2e5ccd8a6352ee74f5beee2a7d9976
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Thu Nov 29 07:46:23 2012 -0600

    qdev: relax bus type check in qdev_device_add() (v2)
    
    We are currently checking for an exact type match.  Use QOM dynamic_cast to
    check for a compatible type instead.
    
    Cc: Konrad Frederic <fred.konrad@greensocs.com>
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    ---
    v1 -> v2:
     - also add cast to qbus_find_recursive (Peter)
     - simplify by doing object_dynamic_cast instead of messing with classes
---
 hw/qdev-monitor.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index 479eecd..a1b4d6a 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -289,8 +289,7 @@ static BusState *qbus_find_recursive(BusState *bus, const char *name,
     if (name && (strcmp(bus->name, name) != 0)) {
         match = 0;
     }
-    if (bus_typename &&
-        (strcmp(object_get_typename(OBJECT(bus)), bus_typename) != 0)) {
+    if (bus_typename && !object_dynamic_cast(OBJECT(bus), bus_typename)) {
         match = 0;
     }
     if (match) {
@@ -435,7 +434,7 @@ DeviceState *qdev_device_add(QemuOpts *opts)
         if (!bus) {
             return NULL;
         }
-        if (strcmp(object_get_typename(OBJECT(bus)), k->bus_type) != 0) {
+        if (!object_dynamic_cast(OBJECT(bus), k->bus_type)) {
             qerror_report(QERR_BAD_BUS_FOR_DEVICE,
                           driver, object_get_typename(OBJECT(bus)));
             return NULL;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:00:05 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:00:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQNR-00051A-6S; Tue, 11 Dec 2012 14:00:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNP-00050d-G0
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:03 +0000
Received: from [85.158.137.99:48342] by server-7.bemta-3.messagelabs.com id
	26/C7-23008-26C37C05; Tue, 11 Dec 2012 14:00:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1355234400!12639406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18725 invoked from network); 11 Dec 2012 14:00:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNM-0001Zb-7e
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNM-0006Dw-5C
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:00 +0000
Date: Tue, 11 Dec 2012 14:00:00 +0000
Message-Id: <E1TiQNM-0006Dw-5C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qdev: relax bus type check
	in qdev_device_add() (v2)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e912c96f7d2e5ccd8a6352ee74f5beee2a7d9976
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Thu Nov 29 07:46:23 2012 -0600

    qdev: relax bus type check in qdev_device_add() (v2)
    
    We are currently checking for an exact type match.  Use QOM dynamic_cast to
    check for a compatible type instead.
    
    Cc: Konrad Frederic <fred.konrad@greensocs.com>
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    ---
    v1 -> v2:
     - also add cast to qbus_find_recursive (Peter)
     - simplify by doing object_dynamic_cast instead of messing with classes
---
 hw/qdev-monitor.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index 479eecd..a1b4d6a 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -289,8 +289,7 @@ static BusState *qbus_find_recursive(BusState *bus, const char *name,
     if (name && (strcmp(bus->name, name) != 0)) {
         match = 0;
     }
-    if (bus_typename &&
-        (strcmp(object_get_typename(OBJECT(bus)), bus_typename) != 0)) {
+    if (bus_typename && !object_dynamic_cast(OBJECT(bus), bus_typename)) {
         match = 0;
     }
     if (match) {
@@ -435,7 +434,7 @@ DeviceState *qdev_device_add(QemuOpts *opts)
         if (!bus) {
             return NULL;
         }
-        if (strcmp(object_get_typename(OBJECT(bus)), k->bus_type) != 0) {
+        if (!object_dynamic_cast(OBJECT(bus), k->bus_type)) {
             qerror_report(QERR_BAD_BUS_FOR_DEVICE,
                           driver, object_get_typename(OBJECT(bus)));
             return NULL;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:00:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:00:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQNe-00053l-9Y; Tue, 11 Dec 2012 14:00:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNc-00053V-TN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:17 +0000
Received: from [85.158.138.51:26847] by server-12.bemta-3.messagelabs.com id
	B6/99-27559-07C37C05; Tue, 11 Dec 2012 14:00:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1355234410!28104610!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28727 invoked from network); 11 Dec 2012 14:00:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNW-0001fd-Ex
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNW-0006FI-Ai
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:10 +0000
Date: Tue, 11 Dec 2012 14:00:10 +0000
Message-Id: <E1TiQNW-0006FI-Ai@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qemu-tech.texi: update
	implemented xtensa features list
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 044d003db9b6a588be2c9d0ec9de694ba3848551
Author: Max Filippov <jcmvbkbc@gmail.com>
Date:   Thu Nov 29 19:53:20 2012 +0400

    qemu-tech.texi: update implemented xtensa features list
    
    Debug option is available since QEMU-1.2; FP coprocessor and
    coprocessor context is available since QEMU-1.3.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qemu-tech.texi |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/qemu-tech.texi b/qemu-tech.texi
index d73dda8..8aefa74 100644
--- a/qemu-tech.texi
+++ b/qemu-tech.texi
@@ -262,16 +262,16 @@ Current QEMU limitations:
 
 @item Core Xtensa ISA emulation, including most options: code density,
 loop, extended L32R, 16- and 32-bit multiplication, 32-bit division,
-MAC16, miscellaneous operations, boolean, multiprocessor synchronization,
+MAC16, miscellaneous operations, boolean, FP coprocessor, coprocessor
+context, debug, multiprocessor synchronization,
 conditional store, exceptions, relocatable vectors, unaligned exception,
 interrupts (including high priority and timer), hardware alignment,
 region protection, region translation, MMU, windowed registers, thread
 pointer, processor ID.
 
-@item Not implemented options: FP coprocessor, coprocessor context,
-data/instruction cache (including cache prefetch and locking), XLMI,
-processor interface, debug. Also options not covered by the core ISA
-(e.g. FLIX, wide branches) are not implemented.
+@item Not implemented options: data/instruction cache (including cache
+prefetch and locking), XLMI, processor interface. Also options not
+covered by the core ISA (e.g. FLIX, wide branches) are not implemented.
 
 @item Can run most Xtensa Linux binaries.
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:00:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:00:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQNe-00053l-9Y; Tue, 11 Dec 2012 14:00:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNc-00053V-TN
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:17 +0000
Received: from [85.158.138.51:26847] by server-12.bemta-3.messagelabs.com id
	B6/99-27559-07C37C05; Tue, 11 Dec 2012 14:00:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1355234410!28104610!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28727 invoked from network); 11 Dec 2012 14:00:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNW-0001fd-Ex
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNW-0006FI-Ai
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:10 +0000
Date: Tue, 11 Dec 2012 14:00:10 +0000
Message-Id: <E1TiQNW-0006FI-Ai@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qemu-tech.texi: update
	implemented xtensa features list
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 044d003db9b6a588be2c9d0ec9de694ba3848551
Author: Max Filippov <jcmvbkbc@gmail.com>
Date:   Thu Nov 29 19:53:20 2012 +0400

    qemu-tech.texi: update implemented xtensa features list
    
    Debug option is available since QEMU-1.2; FP coprocessor and
    coprocessor context is available since QEMU-1.3.
    
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qemu-tech.texi |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/qemu-tech.texi b/qemu-tech.texi
index d73dda8..8aefa74 100644
--- a/qemu-tech.texi
+++ b/qemu-tech.texi
@@ -262,16 +262,16 @@ Current QEMU limitations:
 
 @item Core Xtensa ISA emulation, including most options: code density,
 loop, extended L32R, 16- and 32-bit multiplication, 32-bit division,
-MAC16, miscellaneous operations, boolean, multiprocessor synchronization,
+MAC16, miscellaneous operations, boolean, FP coprocessor, coprocessor
+context, debug, multiprocessor synchronization,
 conditional store, exceptions, relocatable vectors, unaligned exception,
 interrupts (including high priority and timer), hardware alignment,
 region protection, region translation, MMU, windowed registers, thread
 pointer, processor ID.
 
-@item Not implemented options: FP coprocessor, coprocessor context,
-data/instruction cache (including cache prefetch and locking), XLMI,
-processor interface, debug. Also options not covered by the core ISA
-(e.g. FLIX, wide branches) are not implemented.
+@item Not implemented options: data/instruction cache (including cache
+prefetch and locking), XLMI, processor interface. Also options not
+covered by the core ISA (e.g. FLIX, wide branches) are not implemented.
 
 @item Can run most Xtensa Linux binaries.
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:00:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:00:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQO5-00057V-3T; Tue, 11 Dec 2012 14:00:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQO4-00057H-52
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:44 +0000
Received: from [85.158.139.83:49404] by server-9.bemta-5.messagelabs.com id
	49/CC-10690-B8C37C05; Tue, 11 Dec 2012 14:00:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1355234421!18099559!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1878 invoked from network); 11 Dec 2012 14:00:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNg-0001fm-RK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNg-0006G6-Lk
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:20 +0000
Date: Tue, 11 Dec 2012 14:00:20 +0000
Message-Id: <E1TiQNg-0006G6-Lk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio: limit avail bytes
	lookahead
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e1f7b4812eab992de46c98b3726745afb042a7f0
Author: Michael S. Tsirkin <mst@redhat.com>
Date:   Fri Nov 30 00:02:56 2012 +0200

    virtio: limit avail bytes lookahead
    
    Commit 0d8d7690850eb0cf2b2b60933cf47669a6b6f18f introduced
    a regression in virtio-net performance because it looks
    into the ring aggressively while we really only care
    about a single packet worth of buffers.
    Reported as bugzilla 1066055 in launchpad.
    
    To fix, add parameters limiting lookahead, and
    use in virtqueue_avail_bytes.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Reported-by: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br>
    Tested-by: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c        |   12 +++++++++---
 hw/virtio-serial-bus.c |    2 +-
 hw/virtio.c            |   15 ++++++++-------
 hw/virtio.h            |    3 ++-
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index df329f2..a73ef8e 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -43,11 +43,11 @@ static bool is_guest_ready(VirtIORNG *vrng)
     return false;
 }
 
-static size_t get_request_size(VirtQueue *vq)
+static size_t get_request_size(VirtQueue *vq, unsigned quota)
 {
     unsigned int in, out;
 
-    virtqueue_get_avail_bytes(vq, &in, &out);
+    virtqueue_get_avail_bytes(vq, &in, &out, quota, 0);
     return in;
 }
 
@@ -84,12 +84,18 @@ static void chr_read(void *opaque, const void *buf, size_t size)
 static void virtio_rng_process(VirtIORNG *vrng)
 {
     size_t size;
+    unsigned quota;
 
     if (!is_guest_ready(vrng)) {
         return;
     }
 
-    size = get_request_size(vrng->vq);
+    if (vrng->quota_remaining < 0) {
+        quota = 0;
+    } else {
+        quota = MIN((uint64_t)vrng->quota_remaining, (uint64_t)UINT32_MAX);
+    }
+    size = get_request_size(vrng->vq, quota);
     size = MIN(vrng->quota_remaining, size);
     if (size) {
         rng_backend_request_entropy(vrng->rng, size, chr_read, vrng);
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index efa8a81..155da58 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -306,7 +306,7 @@ size_t virtio_serial_guest_ready(VirtIOSerialPort *port)
     if (use_multiport(port->vser) && !port->guest_connected) {
         return 0;
     }
-    virtqueue_get_avail_bytes(vq, &bytes, NULL);
+    virtqueue_get_avail_bytes(vq, &bytes, NULL, 4096, 0);
     return bytes;
 }
 
diff --git a/hw/virtio.c b/hw/virtio.c
index ec8b7d8..f40a8c5 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -336,7 +336,8 @@ static unsigned virtqueue_next_desc(hwaddr desc_pa,
 }
 
 void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
-                               unsigned int *out_bytes)
+                               unsigned int *out_bytes,
+                               unsigned max_in_bytes, unsigned max_out_bytes)
 {
     unsigned int idx;
     unsigned int total_bufs, in_total, out_total;
@@ -385,6 +386,9 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
             } else {
                 out_total += vring_desc_len(desc_pa, i);
             }
+            if (in_total >= max_in_bytes && out_total >= max_out_bytes) {
+                goto done;
+            }
         } while ((i = virtqueue_next_desc(desc_pa, i, max)) != max);
 
         if (!indirect)
@@ -392,6 +396,7 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
         else
             total_bufs++;
     }
+done:
     if (in_bytes) {
         *in_bytes = in_total;
     }
@@ -405,12 +410,8 @@ int virtqueue_avail_bytes(VirtQueue *vq, unsigned int in_bytes,
 {
     unsigned int in_total, out_total;
 
-    virtqueue_get_avail_bytes(vq, &in_total, &out_total);
-    if ((in_bytes && in_bytes < in_total)
-        || (out_bytes && out_bytes < out_total)) {
-        return 1;
-    }
-    return 0;
+    virtqueue_get_avail_bytes(vq, &in_total, &out_total, in_bytes, out_bytes);
+    return in_bytes <= in_total && out_bytes <= out_total;
 }
 
 void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,
diff --git a/hw/virtio.h b/hw/virtio.h
index df8d0f7..7c17f7b 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -150,7 +150,8 @@ int virtqueue_pop(VirtQueue *vq, VirtQueueElement *elem);
 int virtqueue_avail_bytes(VirtQueue *vq, unsigned int in_bytes,
                           unsigned int out_bytes);
 void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
-                               unsigned int *out_bytes);
+                               unsigned int *out_bytes,
+                               unsigned max_in_bytes, unsigned max_out_bytes);
 
 void virtio_notify(VirtIODevice *vdev, VirtQueue *vq);
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:00:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:00:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQO5-00057V-3T; Tue, 11 Dec 2012 14:00:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQO4-00057H-52
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:44 +0000
Received: from [85.158.139.83:49404] by server-9.bemta-5.messagelabs.com id
	49/CC-10690-B8C37C05; Tue, 11 Dec 2012 14:00:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1355234421!18099559!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1878 invoked from network); 11 Dec 2012 14:00:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNg-0001fm-RK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNg-0006G6-Lk
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:20 +0000
Date: Tue, 11 Dec 2012 14:00:20 +0000
Message-Id: <E1TiQNg-0006G6-Lk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] virtio: limit avail bytes
	lookahead
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e1f7b4812eab992de46c98b3726745afb042a7f0
Author: Michael S. Tsirkin <mst@redhat.com>
Date:   Fri Nov 30 00:02:56 2012 +0200

    virtio: limit avail bytes lookahead
    
    Commit 0d8d7690850eb0cf2b2b60933cf47669a6b6f18f introduced
    a regression in virtio-net performance because it looks
    into the ring aggressively while we really only care
    about a single packet worth of buffers.
    Reported as bugzilla 1066055 in launchpad.
    
    To fix, add parameters limiting lookahead, and
    use in virtqueue_avail_bytes.
    
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Reported-by: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br>
    Tested-by: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/virtio-rng.c        |   12 +++++++++---
 hw/virtio-serial-bus.c |    2 +-
 hw/virtio.c            |   15 ++++++++-------
 hw/virtio.h            |    3 ++-
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index df329f2..a73ef8e 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -43,11 +43,11 @@ static bool is_guest_ready(VirtIORNG *vrng)
     return false;
 }
 
-static size_t get_request_size(VirtQueue *vq)
+static size_t get_request_size(VirtQueue *vq, unsigned quota)
 {
     unsigned int in, out;
 
-    virtqueue_get_avail_bytes(vq, &in, &out);
+    virtqueue_get_avail_bytes(vq, &in, &out, quota, 0);
     return in;
 }
 
@@ -84,12 +84,18 @@ static void chr_read(void *opaque, const void *buf, size_t size)
 static void virtio_rng_process(VirtIORNG *vrng)
 {
     size_t size;
+    unsigned quota;
 
     if (!is_guest_ready(vrng)) {
         return;
     }
 
-    size = get_request_size(vrng->vq);
+    if (vrng->quota_remaining < 0) {
+        quota = 0;
+    } else {
+        quota = MIN((uint64_t)vrng->quota_remaining, (uint64_t)UINT32_MAX);
+    }
+    size = get_request_size(vrng->vq, quota);
     size = MIN(vrng->quota_remaining, size);
     if (size) {
         rng_backend_request_entropy(vrng->rng, size, chr_read, vrng);
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index efa8a81..155da58 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -306,7 +306,7 @@ size_t virtio_serial_guest_ready(VirtIOSerialPort *port)
     if (use_multiport(port->vser) && !port->guest_connected) {
         return 0;
     }
-    virtqueue_get_avail_bytes(vq, &bytes, NULL);
+    virtqueue_get_avail_bytes(vq, &bytes, NULL, 4096, 0);
     return bytes;
 }
 
diff --git a/hw/virtio.c b/hw/virtio.c
index ec8b7d8..f40a8c5 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -336,7 +336,8 @@ static unsigned virtqueue_next_desc(hwaddr desc_pa,
 }
 
 void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
-                               unsigned int *out_bytes)
+                               unsigned int *out_bytes,
+                               unsigned max_in_bytes, unsigned max_out_bytes)
 {
     unsigned int idx;
     unsigned int total_bufs, in_total, out_total;
@@ -385,6 +386,9 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
             } else {
                 out_total += vring_desc_len(desc_pa, i);
             }
+            if (in_total >= max_in_bytes && out_total >= max_out_bytes) {
+                goto done;
+            }
         } while ((i = virtqueue_next_desc(desc_pa, i, max)) != max);
 
         if (!indirect)
@@ -392,6 +396,7 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
         else
             total_bufs++;
     }
+done:
     if (in_bytes) {
         *in_bytes = in_total;
     }
@@ -405,12 +410,8 @@ int virtqueue_avail_bytes(VirtQueue *vq, unsigned int in_bytes,
 {
     unsigned int in_total, out_total;
 
-    virtqueue_get_avail_bytes(vq, &in_total, &out_total);
-    if ((in_bytes && in_bytes < in_total)
-        || (out_bytes && out_bytes < out_total)) {
-        return 1;
-    }
-    return 0;
+    virtqueue_get_avail_bytes(vq, &in_total, &out_total, in_bytes, out_bytes);
+    return in_bytes <= in_total && out_bytes <= out_total;
 }
 
 void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,
diff --git a/hw/virtio.h b/hw/virtio.h
index df8d0f7..7c17f7b 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -150,7 +150,8 @@ int virtqueue_pop(VirtQueue *vq, VirtQueueElement *elem);
 int virtqueue_avail_bytes(VirtQueue *vq, unsigned int in_bytes,
                           unsigned int out_bytes);
 void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
-                               unsigned int *out_bytes);
+                               unsigned int *out_bytes,
+                               unsigned max_in_bytes, unsigned max_out_bytes);
 
 void virtio_notify(VirtIODevice *vdev, VirtQueue *vq);
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:00 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQOK-0005F7-6s; Tue, 11 Dec 2012 14:01:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOJ-0005Ef-6T
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:59 +0000
Received: from [85.158.139.211:8490] by server-8.bemta-5.messagelabs.com id
	1D/0E-15003-89C37C05; Tue, 11 Dec 2012 14:00:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1355234452!17440460!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3061 invoked from network); 11 Dec 2012 14:00:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOB-0001g0-RY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOB-0006Hu-Lf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:51 +0000
Date: Tue, 11 Dec 2012 14:00:51 +0000
Message-Id: <E1TiQOB-0006Hu-Lf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Revert
	"audio/audio_pt_int: Clarify licensing"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d76aa45bf1f226d2c4e28f6dacbdbbefd51a37ca
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 09:04:08 2012 -0600

    Revert "audio/audio_pt_int: Clarify licensing"
    
    This reverts commit 72bc6f1bf710e205f175af9b1fc8bbd83e8da71f.
    
    This patch wasn't submitted to the list and did not get Acked by other
    copyright holders in the file.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 audio/audio_pt_int.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/audio/audio_pt_int.c b/audio/audio_pt_int.c
index e3ccb11..9a9c306 100644
--- a/audio/audio_pt_int.c
+++ b/audio/audio_pt_int.c
@@ -1,4 +1,3 @@
-/* public domain */
 #include "qemu-common.h"
 #include "audio.h"
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:00 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQOK-0005F7-6s; Tue, 11 Dec 2012 14:01:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOJ-0005Ef-6T
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:59 +0000
Received: from [85.158.139.211:8490] by server-8.bemta-5.messagelabs.com id
	1D/0E-15003-89C37C05; Tue, 11 Dec 2012 14:00:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1355234452!17440460!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3061 invoked from network); 11 Dec 2012 14:00:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOB-0001g0-RY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOB-0006Hu-Lf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:51 +0000
Date: Tue, 11 Dec 2012 14:00:51 +0000
Message-Id: <E1TiQOB-0006Hu-Lf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Revert
	"audio/audio_pt_int: Clarify licensing"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d76aa45bf1f226d2c4e28f6dacbdbbefd51a37ca
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 09:04:08 2012 -0600

    Revert "audio/audio_pt_int: Clarify licensing"
    
    This reverts commit 72bc6f1bf710e205f175af9b1fc8bbd83e8da71f.
    
    This patch wasn't submitted to the list and did not get Acked by other
    copyright holders in the file.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 audio/audio_pt_int.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/audio/audio_pt_int.c b/audio/audio_pt_int.c
index e3ccb11..9a9c306 100644
--- a/audio/audio_pt_int.c
+++ b/audio/audio_pt_int.c
@@ -1,4 +1,3 @@
-/* public domain */
 #include "qemu-common.h"
 #include "audio.h"
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:07 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQOR-0005Gk-A2; Tue, 11 Dec 2012 14:01:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOQ-0005GO-08
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:06 +0000
Received: from [85.158.143.99:4812] by server-1.bemta-4.messagelabs.com id
	05/D9-28401-1AC37C05; Tue, 11 Dec 2012 14:01:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1355234462!23693382!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5061 invoked from network); 11 Dec 2012 14:01:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOM-0001gZ-13
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOL-0006Ih-Ux
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:01 +0000
Date: Tue, 11 Dec 2012 14:01:01 +0000
Message-Id: <E1TiQOL-0006Ih-Ux@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Revert "audio/wavcapture:
	Clarify licensing"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 46ee77b357dde619db30d835f73a9001b9c75a03
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 09:04:47 2012 -0600

    Revert "audio/wavcapture: Clarify licensing"
    
    This reverts commit 456a84d156a7c42f18b1da176dd6219e2dffd043.
    
    This patch wasn't submitted to the list and did not get Acked by other
    copyright holders in the file.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 audio/wavcapture.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/audio/wavcapture.c b/audio/wavcapture.c
index f73691c..4f785f5 100644
--- a/audio/wavcapture.c
+++ b/audio/wavcapture.c
@@ -1,4 +1,3 @@
-/* public domain */
 #include "hw/hw.h"
 #include "monitor.h"
 #include "audio.h"
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:07 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQOR-0005Gk-A2; Tue, 11 Dec 2012 14:01:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOQ-0005GO-08
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:06 +0000
Received: from [85.158.143.99:4812] by server-1.bemta-4.messagelabs.com id
	05/D9-28401-1AC37C05; Tue, 11 Dec 2012 14:01:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1355234462!23693382!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5061 invoked from network); 11 Dec 2012 14:01:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOM-0001gZ-13
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOL-0006Ih-Ux
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:01 +0000
Date: Tue, 11 Dec 2012 14:01:01 +0000
Message-Id: <E1TiQOL-0006Ih-Ux@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Revert "audio/wavcapture:
	Clarify licensing"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 46ee77b357dde619db30d835f73a9001b9c75a03
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 09:04:47 2012 -0600

    Revert "audio/wavcapture: Clarify licensing"
    
    This reverts commit 456a84d156a7c42f18b1da176dd6219e2dffd043.
    
    This patch wasn't submitted to the list and did not get Acked by other
    copyright holders in the file.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 audio/wavcapture.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/audio/wavcapture.c b/audio/wavcapture.c
index f73691c..4f785f5 100644
--- a/audio/wavcapture.c
+++ b/audio/wavcapture.c
@@ -1,4 +1,3 @@
-/* public domain */
 #include "hw/hw.h"
 #include "monitor.h"
 #include "audio.h"
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQOc-0005JY-Dj; Tue, 11 Dec 2012 14:01:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOa-0005J6-OO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:16 +0000
Received: from [85.158.137.99:50709] by server-6.bemta-3.messagelabs.com id
	0D/21-12154-D9C37C05; Tue, 11 Dec 2012 14:01:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1355234441!15717330!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17295 invoked from network); 11 Dec 2012 14:00:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQO1-0001fx-Ht
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQO1-0006HY-D2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:41 +0000
Date: Tue, 11 Dec 2012 14:00:41 +0000
Message-Id: <E1TiQO1-0006HY-D2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] multiboot: fix e801 memory
	map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6e052f0809b56a657b2afcd728e07ffddb28f06
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Thu Nov 29 18:11:50 2012 +0100

    multiboot: fix e801 memory map
    
    The e801 memory sizes in the multiboot structures hard-code the available
    low memory to 640.  However, the value should not include the size of the
    EBDA.  Fill the value in the option ROM, getting the size of low memory
    from the BIOS.
    
    Cc: Alexander Graf <agraf@suse.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 pc-bios/multiboot.bin         |  Bin 1024 -> 1024 bytes
 pc-bios/optionrom/multiboot.S |    7 +++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/pc-bios/multiboot.bin b/pc-bios/multiboot.bin
index f74a6e1..7b3c174 100644
Binary files a/pc-bios/multiboot.bin and b/pc-bios/multiboot.bin differ
diff --git a/pc-bios/optionrom/multiboot.S b/pc-bios/optionrom/multiboot.S
index f08222a..003bcfb 100644
--- a/pc-bios/optionrom/multiboot.S
+++ b/pc-bios/optionrom/multiboot.S
@@ -75,6 +75,13 @@ run_multiboot:
 	shr		$4, %eax
 	mov		%ax, %fs
 
+	/* Account for the EBDA in the multiboot structure's e801
+	 * map.
+	 */
+	int		$0x12
+	cwtl
+	movl		%eax, %fs:4
+
 	/* ES = mmap_addr */
 	mov 		%fs:48, %eax
 	shr		$4, %eax
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQOc-0005JY-Dj; Tue, 11 Dec 2012 14:01:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOa-0005J6-OO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:16 +0000
Received: from [85.158.137.99:50709] by server-6.bemta-3.messagelabs.com id
	0D/21-12154-D9C37C05; Tue, 11 Dec 2012 14:01:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1355234441!15717330!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17295 invoked from network); 11 Dec 2012 14:00:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQO1-0001fx-Ht
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQO1-0006HY-D2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:41 +0000
Date: Tue, 11 Dec 2012 14:00:41 +0000
Message-Id: <E1TiQO1-0006HY-D2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] multiboot: fix e801 memory
	map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6e052f0809b56a657b2afcd728e07ffddb28f06
Author: Paolo Bonzini <pbonzini@redhat.com>
Date:   Thu Nov 29 18:11:50 2012 +0100

    multiboot: fix e801 memory map
    
    The e801 memory sizes in the multiboot structures hard-code the available
    low memory to 640.  However, the value should not include the size of the
    EBDA.  Fill the value in the option ROM, getting the size of low memory
    from the BIOS.
    
    Cc: Alexander Graf <agraf@suse.de>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 pc-bios/multiboot.bin         |  Bin 1024 -> 1024 bytes
 pc-bios/optionrom/multiboot.S |    7 +++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/pc-bios/multiboot.bin b/pc-bios/multiboot.bin
index f74a6e1..7b3c174 100644
Binary files a/pc-bios/multiboot.bin and b/pc-bios/multiboot.bin differ
diff --git a/pc-bios/optionrom/multiboot.S b/pc-bios/optionrom/multiboot.S
index f08222a..003bcfb 100644
--- a/pc-bios/optionrom/multiboot.S
+++ b/pc-bios/optionrom/multiboot.S
@@ -75,6 +75,13 @@ run_multiboot:
 	shr		$4, %eax
 	mov		%ax, %fs
 
+	/* Account for the EBDA in the multiboot structure's e801
+	 * map.
+	 */
+	int		$0x12
+	cwtl
+	movl		%eax, %fs:4
+
 	/* ES = mmap_addr */
 	mov 		%fs:48, %eax
 	shr		$4, %eax
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQOg-0005Kt-GG; Tue, 11 Dec 2012 14:01:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOf-0005KW-B2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:21 +0000
Received: from [85.158.143.99:8223] by server-2.bemta-4.messagelabs.com id
	93/1A-30861-0BC37C05; Tue, 11 Dec 2012 14:01:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1355234472!23693418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5831 invoked from network); 11 Dec 2012 14:01:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOW-0001gi-IJ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOW-0006JH-Cw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:12 +0000
Date: Tue, 11 Dec 2012 14:01:12 +0000
Message-Id: <E1TiQOW-0006JH-Cw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qapi: fix
	qapi_dealloc_type_size parameter type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1d16252652688a775b244fffa1b9ac9b719ceffc
Author: Bruce Rogers <brogers@suse.com>
Date:   Tue Nov 27 13:11:25 2012 -0700

    qapi: fix qapi_dealloc_type_size parameter type
    
    The second parameter to qapi_dealloc_type_size should be a uint64_t *,
    not a size_t *. This was causing our 32 bit x86 build to fail, since
    warnings are treated as errors.
    
    Signed-off-by: Bruce Rogers <brogers@suse.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Reviewed-by: Stefan Weil <sw@weilnetz.de>
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 qapi/qapi-dealloc-visitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index a07b171..75214e7 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -132,7 +132,7 @@ static void qapi_dealloc_type_number(Visitor *v, double *obj, const char *name,
 {
 }
 
-static void qapi_dealloc_type_size(Visitor *v, size_t *obj, const char *name,
+static void qapi_dealloc_type_size(Visitor *v, uint64_t *obj, const char *name,
                                    Error **errp)
 {
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQOg-0005Kt-GG; Tue, 11 Dec 2012 14:01:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOf-0005KW-B2
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:21 +0000
Received: from [85.158.143.99:8223] by server-2.bemta-4.messagelabs.com id
	93/1A-30861-0BC37C05; Tue, 11 Dec 2012 14:01:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1355234472!23693418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5831 invoked from network); 11 Dec 2012 14:01:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOW-0001gi-IJ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOW-0006JH-Cw
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:12 +0000
Date: Tue, 11 Dec 2012 14:01:12 +0000
Message-Id: <E1TiQOW-0006JH-Cw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qapi: fix
	qapi_dealloc_type_size parameter type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1d16252652688a775b244fffa1b9ac9b719ceffc
Author: Bruce Rogers <brogers@suse.com>
Date:   Tue Nov 27 13:11:25 2012 -0700

    qapi: fix qapi_dealloc_type_size parameter type
    
    The second parameter to qapi_dealloc_type_size should be a uint64_t *,
    not a size_t *. This was causing our 32 bit x86 build to fail, since
    warnings are treated as errors.
    
    Signed-off-by: Bruce Rogers <brogers@suse.com>
    Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
    Reviewed-by: Stefan Weil <sw@weilnetz.de>
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 qapi/qapi-dealloc-visitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index a07b171..75214e7 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -132,7 +132,7 @@ static void qapi_dealloc_type_number(Visitor *v, double *obj, const char *name,
 {
 }
 
-static void qapi_dealloc_type_size(Visitor *v, size_t *obj, const char *name,
+static void qapi_dealloc_type_size(Visitor *v, uint64_t *obj, const char *name,
                                    Error **errp)
 {
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQOl-0005Ma-J4; Tue, 11 Dec 2012 14:01:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOj-0005Ly-Ok
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:25 +0000
Received: from [193.109.254.147:51796] by server-8.bemta-14.messagelabs.com id
	4C/2B-05026-5BC37C05; Tue, 11 Dec 2012 14:01:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1355234482!9710409!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11165 invoked from network); 11 Dec 2012 14:01:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOg-0001go-Nq
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOg-0006Ji-M4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:22 +0000
Date: Tue, 11 Dec 2012 14:01:22 +0000
Message-Id: <E1TiQOg-0006Ji-M4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'qmp/queue/qmp' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 36520faa33abb91b3c8a80e935b82afec78f9bee
Merge: 46ee77b357dde619db30d835f73a9001b9c75a03 1d16252652688a775b244fffa1b9ac9b719ceffc
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 10:19:54 2012 -0600

    Merge remote-tracking branch 'qmp/queue/qmp' into staging
    
    * qmp/queue/qmp:
      qapi: fix qapi_dealloc_type_size parameter type
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 qapi/qapi-dealloc-visitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQOl-0005Ma-J4; Tue, 11 Dec 2012 14:01:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOj-0005Ly-Ok
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:25 +0000
Received: from [193.109.254.147:51796] by server-8.bemta-14.messagelabs.com id
	4C/2B-05026-5BC37C05; Tue, 11 Dec 2012 14:01:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1355234482!9710409!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11165 invoked from network); 11 Dec 2012 14:01:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOg-0001go-Nq
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOg-0006Ji-M4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:22 +0000
Date: Tue, 11 Dec 2012 14:01:22 +0000
Message-Id: <E1TiQOg-0006Ji-M4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'qmp/queue/qmp' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 36520faa33abb91b3c8a80e935b82afec78f9bee
Merge: 46ee77b357dde619db30d835f73a9001b9c75a03 1d16252652688a775b244fffa1b9ac9b719ceffc
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 10:19:54 2012 -0600

    Merge remote-tracking branch 'qmp/queue/qmp' into staging
    
    * qmp/queue/qmp:
      qapi: fix qapi_dealloc_type_size parameter type
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 qapi/qapi-dealloc-visitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQP0-0005QX-MQ; Tue, 11 Dec 2012 14:01:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOy-0005Pn-Cu
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:40 +0000
Received: from [193.109.254.147:53012] by server-2.bemta-14.messagelabs.com id
	11/6E-20829-3CC37C05; Tue, 11 Dec 2012 14:01:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1355234493!1875008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19132 invoked from network); 11 Dec 2012 14:01:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOr-0001gz-5o
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOr-0006LF-44
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:33 +0000
Date: Tue, 11 Dec 2012 14:01:33 +0000
Message-Id: <E1TiQOr-0006LF-44@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb: tag usb host adapters
	as not hotpluggable.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c2d1c32d084320081b0cd047f8cacd6e722d03a
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Thu Nov 22 14:44:50 2012 +0100

    usb: tag usb host adapters as not hotpluggable.
    
    Hotplugging them simply doesn't work, so tag them accordingly to
    avoid users trying and then crashing qemu.
    
    For xhci there is nothing fundamental which prevents hotplug from
    working, we'll "only" need a exit() function which cleans up
    everything properly.  That isn't for 1.3 though.
    
    For ehci+uhci+ohci hotplug can't be supported until qemu gains the
    capability to hotplug multifunction pci devices.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=879096
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-ehci-pci.c |    1 +
 hw/usb/hcd-ohci.c     |    1 +
 hw/usb/hcd-uhci.c     |    1 +
 hw/usb/hcd-xhci.c     |    1 +
 4 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index 5887eab..41dbb53 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -123,6 +123,7 @@ static void ehci_class_init(ObjectClass *klass, void *data)
     k->revision = i->revision;
     k->class_id = PCI_CLASS_SERIAL_USB;
     k->config_write = usb_ehci_pci_write_config;
+    k->no_hotplug = 1;
     dc->vmsd = &vmstate_ehci_pci;
     dc->props = ehci_pci_properties;
 }
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 64de906..e16a2ec 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1882,6 +1882,7 @@ static void ohci_pci_class_init(ObjectClass *klass, void *data)
     k->vendor_id = PCI_VENDOR_ID_APPLE;
     k->device_id = PCI_DEVICE_ID_APPLE_IPID_USB;
     k->class_id = PCI_CLASS_SERIAL_USB;
+    k->no_hotplug = 1;
     dc->desc = "Apple USB Controller";
     dc->props = ohci_pci_properties;
 }
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 8e47803..d053791 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1327,6 +1327,7 @@ static void uhci_class_init(ObjectClass *klass, void *data)
     k->device_id = info->device_id;
     k->revision  = info->revision;
     k->class_id  = PCI_CLASS_SERIAL_USB;
+    k->no_hotplug = 1;
     dc->vmsd = &vmstate_uhci;
     dc->props = uhci_properties;
     u->info = *info;
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 8ef4b07..efb509e 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3167,6 +3167,7 @@ static void xhci_class_init(ObjectClass *klass, void *data)
     k->class_id     = PCI_CLASS_SERIAL_USB;
     k->revision     = 0x03;
     k->is_express   = 1;
+    k->no_hotplug   = 1;
 }
 
 static TypeInfo xhci_info = {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQP0-0005QX-MQ; Tue, 11 Dec 2012 14:01:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOy-0005Pn-Cu
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:40 +0000
Received: from [193.109.254.147:53012] by server-2.bemta-14.messagelabs.com id
	11/6E-20829-3CC37C05; Tue, 11 Dec 2012 14:01:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1355234493!1875008!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19132 invoked from network); 11 Dec 2012 14:01:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOr-0001gz-5o
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQOr-0006LF-44
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:33 +0000
Date: Tue, 11 Dec 2012 14:01:33 +0000
Message-Id: <E1TiQOr-0006LF-44@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb: tag usb host adapters
	as not hotpluggable.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c2d1c32d084320081b0cd047f8cacd6e722d03a
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Thu Nov 22 14:44:50 2012 +0100

    usb: tag usb host adapters as not hotpluggable.
    
    Hotplugging them simply doesn't work, so tag them accordingly to
    avoid users trying and then crashing qemu.
    
    For xhci there is nothing fundamental which prevents hotplug from
    working, we'll "only" need a exit() function which cleans up
    everything properly.  That isn't for 1.3 though.
    
    For ehci+uhci+ohci hotplug can't be supported until qemu gains the
    capability to hotplug multifunction pci devices.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=879096
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-ehci-pci.c |    1 +
 hw/usb/hcd-ohci.c     |    1 +
 hw/usb/hcd-uhci.c     |    1 +
 hw/usb/hcd-xhci.c     |    1 +
 4 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index 5887eab..41dbb53 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -123,6 +123,7 @@ static void ehci_class_init(ObjectClass *klass, void *data)
     k->revision = i->revision;
     k->class_id = PCI_CLASS_SERIAL_USB;
     k->config_write = usb_ehci_pci_write_config;
+    k->no_hotplug = 1;
     dc->vmsd = &vmstate_ehci_pci;
     dc->props = ehci_pci_properties;
 }
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 64de906..e16a2ec 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1882,6 +1882,7 @@ static void ohci_pci_class_init(ObjectClass *klass, void *data)
     k->vendor_id = PCI_VENDOR_ID_APPLE;
     k->device_id = PCI_DEVICE_ID_APPLE_IPID_USB;
     k->class_id = PCI_CLASS_SERIAL_USB;
+    k->no_hotplug = 1;
     dc->desc = "Apple USB Controller";
     dc->props = ohci_pci_properties;
 }
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 8e47803..d053791 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1327,6 +1327,7 @@ static void uhci_class_init(ObjectClass *klass, void *data)
     k->device_id = info->device_id;
     k->revision  = info->revision;
     k->class_id  = PCI_CLASS_SERIAL_USB;
+    k->no_hotplug = 1;
     dc->vmsd = &vmstate_uhci;
     dc->props = uhci_properties;
     u->info = *info;
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 8ef4b07..efb509e 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3167,6 +3167,7 @@ static void xhci_class_init(ObjectClass *klass, void *data)
     k->class_id     = PCI_CLASS_SERIAL_USB;
     k->revision     = 0x03;
     k->is_express   = 1;
+    k->no_hotplug   = 1;
 }
 
 static TypeInfo xhci_info = {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:48 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQP5-0005Rv-PM; Tue, 11 Dec 2012 14:01:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQP4-0005RY-4P
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:46 +0000
Received: from [85.158.139.83:63344] by server-14.bemta-5.messagelabs.com id
	3C/DB-09538-9CC37C05; Tue, 11 Dec 2012 14:01:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1355234503!22108721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8964 invoked from network); 11 Dec 2012 14:01:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQP1-0001h2-Cc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQP1-0006Le-A1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:43 +0000
Date: Tue, 11 Dec 2012 14:01:43 +0000
Message-Id: <E1TiQP1-0006Le-A1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb: fail
	usbdevice_create() when there is no USB bus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c128d6a6d785eb9235a4f6dbd52f405ab8c60bee
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date:   Sun Nov 25 16:49:15 2012 +0100

    usb: fail usbdevice_create() when there is no USB bus
    
    Report an error instead of segfaulting when attaching a USB device to a
    machine with no USB busses:
    
      $ qemu-system-arm -machine vexpress-a9 \
          -sd Fedora-17-armhfp-vexpress-mmcblk0.img \
          -kernel vmlinuz-3.4.2-3.fc17.armv7hl \
          -initrd initramfs-3.4.2-3.fc17.armv7hl.img \
          -usbdevice disk:format=raw:test.img
    
    Note that the vexpress-a9 machine does not have a USB host controller.
    
    Reported-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/bus.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 99aac7a..55d0edd 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -590,6 +590,13 @@ USBDevice *usbdevice_create(const char *cmdline)
         return NULL;
     }
 
+    if (!bus) {
+        error_report("Error: no usb bus to attach usbdevice %s, "
+                     "please try -machine usb=on and check that "
+                     "the machine model supports USB", driver);
+        return NULL;
+    }
+
     if (!f->usbdevice_init) {
         if (*params) {
             error_report("usbdevice %s accepts no params", driver);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:48 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQP5-0005Rv-PM; Tue, 11 Dec 2012 14:01:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQP4-0005RY-4P
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:46 +0000
Received: from [85.158.139.83:63344] by server-14.bemta-5.messagelabs.com id
	3C/DB-09538-9CC37C05; Tue, 11 Dec 2012 14:01:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1355234503!22108721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8964 invoked from network); 11 Dec 2012 14:01:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQP1-0001h2-Cc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQP1-0006Le-A1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:43 +0000
Date: Tue, 11 Dec 2012 14:01:43 +0000
Message-Id: <E1TiQP1-0006Le-A1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] usb: fail
	usbdevice_create() when there is no USB bus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c128d6a6d785eb9235a4f6dbd52f405ab8c60bee
Author: Stefan Hajnoczi <stefanha@redhat.com>
Date:   Sun Nov 25 16:49:15 2012 +0100

    usb: fail usbdevice_create() when there is no USB bus
    
    Report an error instead of segfaulting when attaching a USB device to a
    machine with no USB busses:
    
      $ qemu-system-arm -machine vexpress-a9 \
          -sd Fedora-17-armhfp-vexpress-mmcblk0.img \
          -kernel vmlinuz-3.4.2-3.fc17.armv7hl \
          -initrd initramfs-3.4.2-3.fc17.armv7hl.img \
          -usbdevice disk:format=raw:test.img
    
    Note that the vexpress-a9 machine does not have a USB host controller.
    
    Reported-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/bus.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 99aac7a..55d0edd 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -590,6 +590,13 @@ USBDevice *usbdevice_create(const char *cmdline)
         return NULL;
     }
 
+    if (!bus) {
+        error_report("Error: no usb bus to attach usbdevice %s, "
+                     "please try -machine usb=on and check that "
+                     "the machine model supports USB", driver);
+        return NULL;
+    }
+
     if (!f->usbdevice_init) {
         if (*params) {
             error_report("usbdevice %s accepts no params", driver);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:58 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQPF-0005Ui-UH; Tue, 11 Dec 2012 14:01:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPF-0005UM-3X
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:57 +0000
Received: from [85.158.143.99:46875] by server-1.bemta-4.messagelabs.com id
	85/5B-28401-4DC37C05; Tue, 11 Dec 2012 14:01:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1355234513!19230864!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14248 invoked from network); 11 Dec 2012 14:01:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPB-0001hB-IP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPB-0006M1-H4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:53 +0000
Date: Tue, 11 Dec 2012 14:01:53 +0000
Message-Id: <E1TiQPB-0006M1-H4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ehci-sysbus: Attach DMA
	context.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b29f492c844ed03d6d16ebe6bb760d71b6557fe
Author: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Date:   Thu Nov 29 11:43:18 2012 +1000

    ehci-sysbus: Attach DMA context.
    
    This was left as NULL on the initial merge due to debate on the mailing list on
    how to handle DMA contexts for sysbus devices. Patch
    9e11908f12f92e31ea94dc2a4c962c836cba9f2a was later merged to fix OHCI. This is the,
    equivalent fix for sysbus EHCI.
    
    Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-ehci-sysbus.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c
index 1584079..803df92 100644
--- a/hw/usb/hcd-ehci-sysbus.c
+++ b/hw/usb/hcd-ehci-sysbus.c
@@ -45,6 +45,7 @@ static int usb_ehci_sysbus_initfn(SysBusDevice *dev)
 
     s->capsbase = 0x100;
     s->opregbase = 0x140;
+    s->dma = &dma_context_memory;
 
     usb_ehci_initfn(s, DEVICE(dev));
     sysbus_init_irq(dev, &s->irq);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:01:58 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:01:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQPF-0005Ui-UH; Tue, 11 Dec 2012 14:01:57 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPF-0005UM-3X
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:57 +0000
Received: from [85.158.143.99:46875] by server-1.bemta-4.messagelabs.com id
	85/5B-28401-4DC37C05; Tue, 11 Dec 2012 14:01:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1355234513!19230864!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14248 invoked from network); 11 Dec 2012 14:01:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:01:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPB-0001hB-IP
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPB-0006M1-H4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:01:53 +0000
Date: Tue, 11 Dec 2012 14:01:53 +0000
Message-Id: <E1TiQPB-0006M1-H4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ehci-sysbus: Attach DMA
	context.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b29f492c844ed03d6d16ebe6bb760d71b6557fe
Author: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Date:   Thu Nov 29 11:43:18 2012 +1000

    ehci-sysbus: Attach DMA context.
    
    This was left as NULL on the initial merge due to debate on the mailing list on
    how to handle DMA contexts for sysbus devices. Patch
    9e11908f12f92e31ea94dc2a4c962c836cba9f2a was later merged to fix OHCI. This is the,
    equivalent fix for sysbus EHCI.
    
    Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-ehci-sysbus.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c
index 1584079..803df92 100644
--- a/hw/usb/hcd-ehci-sysbus.c
+++ b/hw/usb/hcd-ehci-sysbus.c
@@ -45,6 +45,7 @@ static int usb_ehci_sysbus_initfn(SysBusDevice *dev)
 
     s->capsbase = 0x100;
     s->opregbase = 0x140;
+    s->dma = &dma_context_memory;
 
     usb_ehci_initfn(s, DEVICE(dev));
     sysbus_init_irq(dev, &s->irq);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQPX-0005Yh-1Z; Tue, 11 Dec 2012 14:02:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPW-0005YV-Ff
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:14 +0000
Received: from [85.158.138.51:35781] by server-15.bemta-3.messagelabs.com id
	DF/4C-07921-5EC37C05; Tue, 11 Dec 2012 14:02:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1355234524!24169668!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21596 invoked from network); 11 Dec 2012 14:02:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPL-0001hk-OK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPL-0006MP-MY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:03 +0000
Date: Tue, 11 Dec 2012 14:02:03 +0000
Message-Id: <E1TiQPL-0006MP-MY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'kraxel/usb.73' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 923fd9897b0ffbcc5091181f8b0484aa2e36413b
Merge: 36520faa33abb91b3c8a80e935b82afec78f9bee 2b29f492c844ed03d6d16ebe6bb760d71b6557fe
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 10:20:21 2012 -0600

    Merge remote-tracking branch 'kraxel/usb.73' into staging
    
    * kraxel/usb.73:
      ehci-sysbus: Attach DMA context.
      usb: fail usbdevice_create() when there is no USB bus
      usb: tag usb host adapters as not hotpluggable.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 hw/usb/bus.c             |    7 +++++++
 hw/usb/hcd-ehci-pci.c    |    1 +
 hw/usb/hcd-ehci-sysbus.c |    1 +
 hw/usb/hcd-ohci.c        |    1 +
 hw/usb/hcd-uhci.c        |    1 +
 hw/usb/hcd-xhci.c        |    1 +
 6 files changed, 12 insertions(+), 0 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQPX-0005Yh-1Z; Tue, 11 Dec 2012 14:02:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPW-0005YV-Ff
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:14 +0000
Received: from [85.158.138.51:35781] by server-15.bemta-3.messagelabs.com id
	DF/4C-07921-5EC37C05; Tue, 11 Dec 2012 14:02:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1355234524!24169668!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21596 invoked from network); 11 Dec 2012 14:02:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPL-0001hk-OK
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPL-0006MP-MY
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:03 +0000
Date: Tue, 11 Dec 2012 14:02:03 +0000
Message-Id: <E1TiQPL-0006MP-MY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'kraxel/usb.73' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 923fd9897b0ffbcc5091181f8b0484aa2e36413b
Merge: 36520faa33abb91b3c8a80e935b82afec78f9bee 2b29f492c844ed03d6d16ebe6bb760d71b6557fe
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 10:20:21 2012 -0600

    Merge remote-tracking branch 'kraxel/usb.73' into staging
    
    * kraxel/usb.73:
      ehci-sysbus: Attach DMA context.
      usb: fail usbdevice_create() when there is no USB bus
      usb: tag usb host adapters as not hotpluggable.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 hw/usb/bus.c             |    7 +++++++
 hw/usb/hcd-ehci-pci.c    |    1 +
 hw/usb/hcd-ehci-sysbus.c |    1 +
 hw/usb/hcd-ohci.c        |    1 +
 hw/usb/hcd-uhci.c        |    1 +
 hw/usb/hcd-xhci.c        |    1 +
 6 files changed, 12 insertions(+), 0 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQPd-0005a1-4v; Tue, 11 Dec 2012 14:02:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPb-0005YV-Qd
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:19 +0000
Received: from [85.158.137.99:13971] by server-15.bemta-3.messagelabs.com id
	8A/AC-07921-BEC37C05; Tue, 11 Dec 2012 14:02:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1355234534!15726054!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23438 invoked from network); 11 Dec 2012 14:02:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPW-0001hn-5m
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPW-0006N5-2s
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:14 +0000
Date: Tue, 11 Dec 2012 14:02:14 +0000
Message-Id: <E1TiQPW-0006N5-2s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qxl: reload memslots after
	migration, when qxl is in UNDEFINED mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa98efe932d93a15ffa867f3b05149c8d1fc7c28
Author: Yonit Halperin <yhalperi@redhat.com>
Date:   Wed Nov 28 10:08:22 2012 -0500

    qxl: reload memslots after migration, when qxl is in UNDEFINED mode
    
    The devram memslot stays active when qxl enters UNDEFINED mode (i.e, no
    primary surface). If migration has occurred while the device is in
    UNDEFINED stae, the memslots have to be reloaded at the destination.
    
    Fixes rhbz#874574
    
    Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/qxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 1bc2d32..96887c4 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -2146,6 +2146,7 @@ static int qxl_post_load(void *opaque, int version)
 
     switch (newmode) {
     case QXL_MODE_UNDEFINED:
+        qxl_create_memslots(d);
         break;
     case QXL_MODE_VGA:
         qxl_create_memslots(d);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQPd-0005a1-4v; Tue, 11 Dec 2012 14:02:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPb-0005YV-Qd
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:19 +0000
Received: from [85.158.137.99:13971] by server-15.bemta-3.messagelabs.com id
	8A/AC-07921-BEC37C05; Tue, 11 Dec 2012 14:02:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1355234534!15726054!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23438 invoked from network); 11 Dec 2012 14:02:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPW-0001hn-5m
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPW-0006N5-2s
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:14 +0000
Date: Tue, 11 Dec 2012 14:02:14 +0000
Message-Id: <E1TiQPW-0006N5-2s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] qxl: reload memslots after
	migration, when qxl is in UNDEFINED mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa98efe932d93a15ffa867f3b05149c8d1fc7c28
Author: Yonit Halperin <yhalperi@redhat.com>
Date:   Wed Nov 28 10:08:22 2012 -0500

    qxl: reload memslots after migration, when qxl is in UNDEFINED mode
    
    The devram memslot stays active when qxl enters UNDEFINED mode (i.e, no
    primary surface). If migration has occurred while the device is in
    UNDEFINED stae, the memslots have to be reloaded at the destination.
    
    Fixes rhbz#874574
    
    Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/qxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 1bc2d32..96887c4 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -2146,6 +2146,7 @@ static int qxl_post_load(void *opaque, int version)
 
     switch (newmode) {
     case QXL_MODE_UNDEFINED:
+        qxl_create_memslots(d);
         break;
     case QXL_MODE_VGA:
         qxl_create_memslots(d);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQPv-0005dU-8L; Tue, 11 Dec 2012 14:02:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPu-0005dH-2B
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:38 +0000
Received: from [85.158.138.51:40296] by server-8.bemta-3.messagelabs.com id
	8E/01-01297-DFC37C05; Tue, 11 Dec 2012 14:02:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1355234555!26634376!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27331 invoked from network); 11 Dec 2012 14:02:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPq-0001i1-Uv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPq-0006P6-TT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:34 +0000
Date: Tue, 11 Dec 2012 14:02:34 +0000
Message-Id: <E1TiQPq-0006P6-TT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Documentation: Update
	block cache mode information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a13e5e05570e6c0d0a6c8d9b5c516278770adae5
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Wed Nov 21 12:26:56 2012 +0100

    Documentation: Update block cache mode information
    
    Somehow we forgot to update this when cache=writeback became the
    default. While changing the information on the default, also make the
    description of all caches modes a bit more accurate.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 qemu-options.hx |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index fbcf079..de43b1b 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -206,33 +206,33 @@ Open drive @option{file} as read-only. Guest write attempts will fail.
 file sectors into the image file.
 @end table
 
-By default, writethrough caching is used for all block device.  This means that
-the host page cache will be used to read and write data but write notification
-will be sent to the guest only when the data has been reported as written by
-the storage subsystem.
-
-Writeback caching will report data writes as completed as soon as the data is
-present in the host page cache.  This is safe as long as you trust your host.
-If your host crashes or loses power, then the guest may experience data
-corruption.
+By default, the @option{cache=writeback} mode is used. It will report data
+writes as completed as soon as the data is present in the host page cache.
+This is safe as long as your guest OS makes sure to correctly flush disk caches
+where needed. If your guest OS does not handle volatile disk write caches
+correctly and your host crashes or loses power, then the guest may experience
+data corruption.
+
+For such guests, you should consider using @option{cache=writethrough}. This
+means that the host page cache will be used to read and write data, but write
+notification will be sent to the guest only after QEMU has made sure to flush
+each write to the disk. Be aware that this has a major impact on performance.
 
 The host page cache can be avoided entirely with @option{cache=none}.  This will
-attempt to do disk IO directly to the guests memory.  QEMU may still perform
-an internal copy of the data.
+attempt to do disk IO directly to the guest's memory.  QEMU may still perform
+an internal copy of the data. Note that this is considered a writeback mode and
+the guest OS must handle the disk write cache correctly in order to avoid data
+corruption on host crashes.
 
 The host page cache can be avoided while only sending write notifications to
-the guest when the data has been reported as written by the storage subsystem
-using @option{cache=directsync}.
-
-Some block drivers perform badly with @option{cache=writethrough}, most notably,
-qcow2.  If performance is more important than correctness,
-@option{cache=writeback} should be used with qcow2.
+the guest when the data has been flushed to the disk using
+@option{cache=directsync}.
 
 In case you don't care about data integrity over host failures, use
-cache=unsafe. This option tells QEMU that it never needs to write any data
-to the disk but can instead keeps things in cache. If anything goes wrong,
+@option{cache=unsafe}. This option tells QEMU that it never needs to write any
+data to the disk but can instead keep things in cache. If anything goes wrong,
 like your host losing power, the disk storage getting disconnected accidentally,
-etc. you're image will most probably be rendered unusable.   When using
+etc. your image will most probably be rendered unusable.   When using
 the @option{-snapshot} option, unsafe caching is always used.
 
 Copy-on-read avoids accessing the same backing file sectors repeatedly and is
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQPv-0005dU-8L; Tue, 11 Dec 2012 14:02:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPu-0005dH-2B
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:38 +0000
Received: from [85.158.138.51:40296] by server-8.bemta-3.messagelabs.com id
	8E/01-01297-DFC37C05; Tue, 11 Dec 2012 14:02:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1355234555!26634376!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27331 invoked from network); 11 Dec 2012 14:02:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPq-0001i1-Uv
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPq-0006P6-TT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:34 +0000
Date: Tue, 11 Dec 2012 14:02:34 +0000
Message-Id: <E1TiQPq-0006P6-TT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Documentation: Update
	block cache mode information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a13e5e05570e6c0d0a6c8d9b5c516278770adae5
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Wed Nov 21 12:26:56 2012 +0100

    Documentation: Update block cache mode information
    
    Somehow we forgot to update this when cache=writeback became the
    default. While changing the information on the default, also make the
    description of all caches modes a bit more accurate.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 qemu-options.hx |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index fbcf079..de43b1b 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -206,33 +206,33 @@ Open drive @option{file} as read-only. Guest write attempts will fail.
 file sectors into the image file.
 @end table
 
-By default, writethrough caching is used for all block device.  This means that
-the host page cache will be used to read and write data but write notification
-will be sent to the guest only when the data has been reported as written by
-the storage subsystem.
-
-Writeback caching will report data writes as completed as soon as the data is
-present in the host page cache.  This is safe as long as you trust your host.
-If your host crashes or loses power, then the guest may experience data
-corruption.
+By default, the @option{cache=writeback} mode is used. It will report data
+writes as completed as soon as the data is present in the host page cache.
+This is safe as long as your guest OS makes sure to correctly flush disk caches
+where needed. If your guest OS does not handle volatile disk write caches
+correctly and your host crashes or loses power, then the guest may experience
+data corruption.
+
+For such guests, you should consider using @option{cache=writethrough}. This
+means that the host page cache will be used to read and write data, but write
+notification will be sent to the guest only after QEMU has made sure to flush
+each write to the disk. Be aware that this has a major impact on performance.
 
 The host page cache can be avoided entirely with @option{cache=none}.  This will
-attempt to do disk IO directly to the guests memory.  QEMU may still perform
-an internal copy of the data.
+attempt to do disk IO directly to the guest's memory.  QEMU may still perform
+an internal copy of the data. Note that this is considered a writeback mode and
+the guest OS must handle the disk write cache correctly in order to avoid data
+corruption on host crashes.
 
 The host page cache can be avoided while only sending write notifications to
-the guest when the data has been reported as written by the storage subsystem
-using @option{cache=directsync}.
-
-Some block drivers perform badly with @option{cache=writethrough}, most notably,
-qcow2.  If performance is more important than correctness,
-@option{cache=writeback} should be used with qcow2.
+the guest when the data has been flushed to the disk using
+@option{cache=directsync}.
 
 In case you don't care about data integrity over host failures, use
-cache=unsafe. This option tells QEMU that it never needs to write any data
-to the disk but can instead keeps things in cache. If anything goes wrong,
+@option{cache=unsafe}. This option tells QEMU that it never needs to write any
+data to the disk but can instead keep things in cache. If anything goes wrong,
 like your host losing power, the disk storage getting disconnected accidentally,
-etc. you're image will most probably be rendered unusable.   When using
+etc. your image will most probably be rendered unusable.   When using
 the @option{-snapshot} option, unsafe caching is always used.
 
 Copy-on-read avoids accessing the same backing file sectors repeatedly and is
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQ7-0005fd-BW; Tue, 11 Dec 2012 14:02:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQ6-0005fR-Du
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:50 +0000
Received: from [85.158.143.99:32193] by server-3.bemta-4.messagelabs.com id
	33/05-18211-90D37C05; Tue, 11 Dec 2012 14:02:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1355234565!21960322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19088 invoked from network); 11 Dec 2012 14:02:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPg-0001hr-Ei
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPg-0006NV-9U
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:24 +0000
Date: Tue, 11 Dec 2012 14:02:24 +0000
Message-Id: <E1TiQPg-0006NV-9U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'spice/spice.v65' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3235f92784bcf679894b34081f4f4b04e4a358e3
Merge: 923fd9897b0ffbcc5091181f8b0484aa2e36413b fa98efe932d93a15ffa867f3b05149c8d1fc7c28
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 10:20:36 2012 -0600

    Merge remote-tracking branch 'spice/spice.v65' into staging
    
    * spice/spice.v65:
      qxl: reload memslots after migration, when qxl is in UNDEFINED mode
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 hw/qxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQ7-0005fd-BW; Tue, 11 Dec 2012 14:02:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQ6-0005fR-Du
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:50 +0000
Received: from [85.158.143.99:32193] by server-3.bemta-4.messagelabs.com id
	33/05-18211-90D37C05; Tue, 11 Dec 2012 14:02:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1355234565!21960322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19088 invoked from network); 11 Dec 2012 14:02:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPg-0001hr-Ei
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQPg-0006NV-9U
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:24 +0000
Date: Tue, 11 Dec 2012 14:02:24 +0000
Message-Id: <E1TiQPg-0006NV-9U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'spice/spice.v65' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3235f92784bcf679894b34081f4f4b04e4a358e3
Merge: 923fd9897b0ffbcc5091181f8b0484aa2e36413b fa98efe932d93a15ffa867f3b05149c8d1fc7c28
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 10:20:36 2012 -0600

    Merge remote-tracking branch 'spice/spice.v65' into staging
    
    * spice/spice.v65:
      qxl: reload memslots after migration, when qxl is in UNDEFINED mode
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 hw/qxl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQA-0005gU-E4; Tue, 11 Dec 2012 14:02:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQ9-0005gB-CH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:53 +0000
Received: from [85.158.143.99:32570] by server-1.bemta-4.messagelabs.com id
	6F/1D-28401-C0D37C05; Tue, 11 Dec 2012 14:02:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1355234565!22598137!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29540 invoked from network); 11 Dec 2012 14:02:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQ1-0001iA-6E
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQ1-0006PT-3f
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:45 +0000
Date: Tue, 11 Dec 2012 14:02:45 +0000
Message-Id: <E1TiQQ1-0006PT-3f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Documentation: Update
	image format information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d3067b020bdeb572f381c5be4420eedfd6af5884
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Wed Nov 21 14:21:47 2012 +0100

    Documentation: Update image format information
    
    Document new and yet undocumented options and image formats. The
    qemu-img man page contains information only for raw and qcow2 now and
    references the HTML documentation for a more detailed description of
    other formats.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 qemu-doc.texi |  167 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 qemu-img.texi |   84 +++++++++-------------------
 2 files changed, 194 insertions(+), 57 deletions(-)

diff --git a/qemu-doc.texi b/qemu-doc.texi
index 6ff309d..6d7f50d 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -416,6 +416,7 @@ snapshots.
 * vm_snapshots::              VM snapshots
 * qemu_img_invocation::       qemu-img Invocation
 * qemu_nbd_invocation::       qemu-nbd Invocation
+* disk_images_formats::       Disk image file formats
 * host_drives::               Using host drives
 * disk_images_fat_images::    Virtual FAT disk images
 * disk_images_nbd::           NBD access
@@ -507,6 +508,172 @@ state is not saved or restored properly (in particular USB).
 
 @include qemu-nbd.texi
 
+@node disk_images_formats
+@subsection Disk image file formats
+
+QEMU supports many image file formats that can be used with VMs as well as with
+any of the tools (like @code{qemu-img}). This includes the preferred formats
+raw and qcow2 as well as formats that are supported for compatibility with
+older QEMU versions or other hypervisors.
+
+Depending on the image format, different options can be passed to
+@code{qemu-img create} and @code{qemu-img convert} using the @code{-o} option.
+This section describes each format and the options that are supported for it.
+
+@table @option
+@item raw
+
+Raw disk image format. This format has the advantage of
+being simple and easily exportable to all other emulators. If your
+file system supports @emph{holes} (for example in ext2 or ext3 on
+Linux or NTFS on Windows), then only the written sectors will reserve
+space. Use @code{qemu-img info} to know the real size used by the
+image or @code{ls -ls} on Unix/Linux.
+
+@item qcow2
+QEMU image format, the most versatile format. Use it to have smaller
+images (useful if your filesystem does not supports holes, for example
+on Windows), optional AES encryption, zlib based compression and
+support of multiple VM snapshots.
+
+Supported options:
+@table @code
+@item compat
+Determines the qcow2 version to use. @code{compat=0.10} uses the traditional
+image format that can be read by any QEMU since 0.10 (this is the default).
+@code{compat=1.1} enables image format extensions that only QEMU 1.1 and
+newer understand. Amongst others, this includes zero clusters, which allow
+efficient copy-on-read for sparse images.
+
+@item backing_file
+File name of a base image (see @option{create} subcommand)
+@item backing_fmt
+Image format of the base image
+@item encryption
+If this option is set to @code{on}, the image is encrypted.
+
+Encryption uses the AES format which is very secure (128 bit keys). Use
+a long password (16 characters) to get maximum protection.
+
+@item cluster_size
+Changes the qcow2 cluster size (must be between 512 and 2M). Smaller cluster
+sizes can improve the image file size whereas larger cluster sizes generally
+provide better performance.
+
+@item preallocation
+Preallocation mode (allowed values: off, metadata). An image with preallocated
+metadata is initially larger but can improve performance when the image needs
+to grow.
+
+@item lazy_refcounts
+If this option is set to @code{on}, reference count updates are postponed with
+the goal of avoiding metadata I/O and improving performance. This is
+particularly interesting with @option{cache=writethrough} which doesn't batch
+metadata updates. The tradeoff is that after a host crash, the reference count
+tables must be rebuilt, i.e. on the next open an (automatic) @code{qemu-img
+check -r all} is required, which may take some time.
+
+This option can only be enabled if @code{compat=1.1} is specified.
+
+@end table
+
+@item qed
+Old QEMU image format with support for backing files and compact image files
+(when your filesystem or transport medium does not support holes).
+
+When converting QED images to qcow2, you might want to consider using the
+@code{lazy_refcounts=on} option to get a more QED-like behaviour.
+
+Supported options:
+@table @code
+@item backing_file
+File name of a base image (see @option{create} subcommand).
+@item backing_fmt
+Image file format of backing file (optional).  Useful if the format cannot be
+autodetected because it has no header, like some vhd/vpc files.
+@item cluster_size
+Changes the cluster size (must be power-of-2 between 4K and 64K). Smaller
+cluster sizes can improve the image file size whereas larger cluster sizes
+generally provide better performance.
+@item table_size
+Changes the number of clusters per L1/L2 table (must be power-of-2 between 1
+and 16).  There is normally no need to change this value but this option can be
+used for performance benchmarking.
+@end table
+
+@item qcow
+Old QEMU image format with support for backing files, compact image files,
+encryption and compression.
+
+Supported options:
+@table @code
+@item backing_file
+File name of a base image (see @option{create} subcommand)
+@item encryption
+If this option is set to @code{on}, the image is encrypted.
+@end table
+
+@item cow
+User Mode Linux Copy On Write image format. It is supported only for
+compatibility with previous versions.
+Supported options:
+@table @code
+@item backing_file
+File name of a base image (see @option{create} subcommand)
+@end table
+
+@item vdi
+VirtualBox 1.1 compatible image format.
+Supported options:
+@table @code
+@item static
+If this option is set to @code{on}, the image is created with metadata
+preallocation.
+@end table
+
+@item vmdk
+VMware 3 and 4 compatible image format.
+
+Supported options:
+@table @code
+@item backing_file
+File name of a base image (see @option{create} subcommand).
+@item compat6
+Create a VMDK version 6 image (instead of version 4)
+@item subformat
+Specifies which VMDK subformat to use. Valid options are
+@code{monolithicSparse} (default),
+@code{monolithicFlat},
+@code{twoGbMaxExtentSparse},
+@code{twoGbMaxExtentFlat} and
+@code{streamOptimized}.
+@end table
+
+@item vpc
+VirtualPC compatible image format (VHD).
+Supported options:
+@table @code
+@item subformat
+Specifies which VHD subformat to use. Valid options are
+@code{dynamic} (default) and @code{fixed}.
+@end table
+@end table
+
+@subsubsection Read-only formats
+More disk image file formats are supported in a read-only mode.
+@table @option
+@item bochs
+Bochs images of @code{growing} type.
+@item cloop
+Linux Compressed Loop image, useful only to reuse directly compressed
+CD-ROM images present for example in the Knoppix CD-ROMs.
+@item dmg
+Apple disk image.
+@item parallels
+Parallels disk image format.
+@end table
+
+
 @node host_drives
 @subsection Using host drives
 
diff --git a/qemu-img.texi b/qemu-img.texi
index 60b83fc..00fca8d 100644
--- a/qemu-img.texi
+++ b/qemu-img.texi
@@ -226,7 +226,10 @@ After using this command to grow a disk image, you must use file system and
 partitioning tools inside the VM to actually begin using the new space on the
 device.
 @end table
+@c man end
 
+@ignore
+@c man begin NOTES
 Supported image file formats:
 
 @table @option
@@ -247,6 +250,13 @@ support of multiple VM snapshots.
 
 Supported options:
 @table @code
+@item compat
+Determines the qcow2 version to use. @code{compat=0.10} uses the traditional
+image format that can be read by any QEMU since 0.10 (this is the default).
+@code{compat=1.1} enables image format extensions that only QEMU 1.1 and
+newer understand. Amongst others, this includes zero clusters, which allow
+efficient copy-on-read for sparse images.
+
 @item backing_file
 File name of a base image (see @option{create} subcommand)
 @item backing_fmt
@@ -267,73 +277,33 @@ Preallocation mode (allowed values: off, metadata). An image with preallocated
 metadata is initially larger but can improve performance when the image needs
 to grow.
 
-@end table
+@item lazy_refcounts
+If this option is set to @code{on}, reference count updates are postponed with
+the goal of avoiding metadata I/O and improving performance. This is
+particularly interesting with @option{cache=writethrough} which doesn't batch
+metadata updates. The tradeoff is that after a host crash, the reference count
+tables must be rebuilt, i.e. on the next open an (automatic) @code{qemu-img
+check -r all} is required, which may take some time.
 
-@item qed
-Image format with support for backing files and compact image files (when your
-filesystem or transport medium does not support holes).  Good performance due
-to less metadata than the more featureful qcow2 format, especially with
-cache=writethrough or cache=directsync.  Consider using qcow2 which will soon
-have a similar optimization and is most actively developed.
+This option can only be enabled if @code{compat=1.1} is specified.
 
-Supported options:
-@table @code
-@item backing_file
-File name of a base image (see @option{create} subcommand).
-@item backing_fmt
-Image file format of backing file (optional).  Useful if the format cannot be
-autodetected because it has no header, like some vhd/vpc files.
-@item cluster_size
-Changes the cluster size (must be power-of-2 between 4K and 64K). Smaller
-cluster sizes can improve the image file size whereas larger cluster sizes
-generally provide better performance.
-@item table_size
-Changes the number of clusters per L1/L2 table (must be power-of-2 between 1
-and 16).  There is normally no need to change this value but this option can be
-used for performance benchmarking.
 @end table
 
-@item qcow
-Old QEMU image format. Left for compatibility.
+@item Other
+QEMU also supports various other image file formats for compatibility with
+older QEMU versions or other hypervisors, including VMDK, VDI, VHD (vpc), qcow1
+and QED. For a full list of supported formats see @code{qemu-img --help}.
+For a more detailed description of these formats, see the QEMU Emulation User
+Documentation.
 
-Supported options:
-@table @code
-@item backing_file
-File name of a base image (see @option{create} subcommand)
-@item encryption
-If this option is set to @code{on}, the image is encrypted.
-@end table
-
-@item cow
-User Mode Linux Copy On Write image format. Used to be the only growable
-image format in QEMU. It is supported only for compatibility with
-previous versions. It does not work on win32.
-@item vdi
-VirtualBox 1.1 compatible image format.
-@item vmdk
-VMware 3 and 4 compatible image format.
-
-Supported options:
-@table @code
-@item backing_fmt
-Image format of the base image
-@item compat6
-Create a VMDK version 6 image (instead of version 4)
-@end table
-
-@item vpc
-VirtualPC compatible image format (VHD).
-
-@item cloop
-Linux Compressed Loop image, useful only to reuse directly compressed
-CD-ROM images present for example in the Knoppix CD-ROMs.
+The main purpose of the block drivers for these formats is image conversion.
+For running VMs, it is recommended to convert the disk images to either raw or
+qcow2 in order to achieve good performance.
 @end table
 
 
 @c man end
 
-@ignore
-
 @setfilename qemu-img
 @settitle QEMU disk image utility
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQA-0005gU-E4; Tue, 11 Dec 2012 14:02:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQ9-0005gB-CH
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:53 +0000
Received: from [85.158.143.99:32570] by server-1.bemta-4.messagelabs.com id
	6F/1D-28401-C0D37C05; Tue, 11 Dec 2012 14:02:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1355234565!22598137!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29540 invoked from network); 11 Dec 2012 14:02:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQ1-0001iA-6E
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQ1-0006PT-3f
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:45 +0000
Date: Tue, 11 Dec 2012 14:02:45 +0000
Message-Id: <E1TiQQ1-0006PT-3f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Documentation: Update
	image format information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d3067b020bdeb572f381c5be4420eedfd6af5884
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Wed Nov 21 14:21:47 2012 +0100

    Documentation: Update image format information
    
    Document new and yet undocumented options and image formats. The
    qemu-img man page contains information only for raw and qcow2 now and
    references the HTML documentation for a more detailed description of
    other formats.
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 qemu-doc.texi |  167 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 qemu-img.texi |   84 +++++++++-------------------
 2 files changed, 194 insertions(+), 57 deletions(-)

diff --git a/qemu-doc.texi b/qemu-doc.texi
index 6ff309d..6d7f50d 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -416,6 +416,7 @@ snapshots.
 * vm_snapshots::              VM snapshots
 * qemu_img_invocation::       qemu-img Invocation
 * qemu_nbd_invocation::       qemu-nbd Invocation
+* disk_images_formats::       Disk image file formats
 * host_drives::               Using host drives
 * disk_images_fat_images::    Virtual FAT disk images
 * disk_images_nbd::           NBD access
@@ -507,6 +508,172 @@ state is not saved or restored properly (in particular USB).
 
 @include qemu-nbd.texi
 
+@node disk_images_formats
+@subsection Disk image file formats
+
+QEMU supports many image file formats that can be used with VMs as well as with
+any of the tools (like @code{qemu-img}). This includes the preferred formats
+raw and qcow2 as well as formats that are supported for compatibility with
+older QEMU versions or other hypervisors.
+
+Depending on the image format, different options can be passed to
+@code{qemu-img create} and @code{qemu-img convert} using the @code{-o} option.
+This section describes each format and the options that are supported for it.
+
+@table @option
+@item raw
+
+Raw disk image format. This format has the advantage of
+being simple and easily exportable to all other emulators. If your
+file system supports @emph{holes} (for example in ext2 or ext3 on
+Linux or NTFS on Windows), then only the written sectors will reserve
+space. Use @code{qemu-img info} to know the real size used by the
+image or @code{ls -ls} on Unix/Linux.
+
+@item qcow2
+QEMU image format, the most versatile format. Use it to have smaller
+images (useful if your filesystem does not supports holes, for example
+on Windows), optional AES encryption, zlib based compression and
+support of multiple VM snapshots.
+
+Supported options:
+@table @code
+@item compat
+Determines the qcow2 version to use. @code{compat=0.10} uses the traditional
+image format that can be read by any QEMU since 0.10 (this is the default).
+@code{compat=1.1} enables image format extensions that only QEMU 1.1 and
+newer understand. Amongst others, this includes zero clusters, which allow
+efficient copy-on-read for sparse images.
+
+@item backing_file
+File name of a base image (see @option{create} subcommand)
+@item backing_fmt
+Image format of the base image
+@item encryption
+If this option is set to @code{on}, the image is encrypted.
+
+Encryption uses the AES format which is very secure (128 bit keys). Use
+a long password (16 characters) to get maximum protection.
+
+@item cluster_size
+Changes the qcow2 cluster size (must be between 512 and 2M). Smaller cluster
+sizes can improve the image file size whereas larger cluster sizes generally
+provide better performance.
+
+@item preallocation
+Preallocation mode (allowed values: off, metadata). An image with preallocated
+metadata is initially larger but can improve performance when the image needs
+to grow.
+
+@item lazy_refcounts
+If this option is set to @code{on}, reference count updates are postponed with
+the goal of avoiding metadata I/O and improving performance. This is
+particularly interesting with @option{cache=writethrough} which doesn't batch
+metadata updates. The tradeoff is that after a host crash, the reference count
+tables must be rebuilt, i.e. on the next open an (automatic) @code{qemu-img
+check -r all} is required, which may take some time.
+
+This option can only be enabled if @code{compat=1.1} is specified.
+
+@end table
+
+@item qed
+Old QEMU image format with support for backing files and compact image files
+(when your filesystem or transport medium does not support holes).
+
+When converting QED images to qcow2, you might want to consider using the
+@code{lazy_refcounts=on} option to get a more QED-like behaviour.
+
+Supported options:
+@table @code
+@item backing_file
+File name of a base image (see @option{create} subcommand).
+@item backing_fmt
+Image file format of backing file (optional).  Useful if the format cannot be
+autodetected because it has no header, like some vhd/vpc files.
+@item cluster_size
+Changes the cluster size (must be power-of-2 between 4K and 64K). Smaller
+cluster sizes can improve the image file size whereas larger cluster sizes
+generally provide better performance.
+@item table_size
+Changes the number of clusters per L1/L2 table (must be power-of-2 between 1
+and 16).  There is normally no need to change this value but this option can be
+used for performance benchmarking.
+@end table
+
+@item qcow
+Old QEMU image format with support for backing files, compact image files,
+encryption and compression.
+
+Supported options:
+@table @code
+@item backing_file
+File name of a base image (see @option{create} subcommand)
+@item encryption
+If this option is set to @code{on}, the image is encrypted.
+@end table
+
+@item cow
+User Mode Linux Copy On Write image format. It is supported only for
+compatibility with previous versions.
+Supported options:
+@table @code
+@item backing_file
+File name of a base image (see @option{create} subcommand)
+@end table
+
+@item vdi
+VirtualBox 1.1 compatible image format.
+Supported options:
+@table @code
+@item static
+If this option is set to @code{on}, the image is created with metadata
+preallocation.
+@end table
+
+@item vmdk
+VMware 3 and 4 compatible image format.
+
+Supported options:
+@table @code
+@item backing_file
+File name of a base image (see @option{create} subcommand).
+@item compat6
+Create a VMDK version 6 image (instead of version 4)
+@item subformat
+Specifies which VMDK subformat to use. Valid options are
+@code{monolithicSparse} (default),
+@code{monolithicFlat},
+@code{twoGbMaxExtentSparse},
+@code{twoGbMaxExtentFlat} and
+@code{streamOptimized}.
+@end table
+
+@item vpc
+VirtualPC compatible image format (VHD).
+Supported options:
+@table @code
+@item subformat
+Specifies which VHD subformat to use. Valid options are
+@code{dynamic} (default) and @code{fixed}.
+@end table
+@end table
+
+@subsubsection Read-only formats
+More disk image file formats are supported in a read-only mode.
+@table @option
+@item bochs
+Bochs images of @code{growing} type.
+@item cloop
+Linux Compressed Loop image, useful only to reuse directly compressed
+CD-ROM images present for example in the Knoppix CD-ROMs.
+@item dmg
+Apple disk image.
+@item parallels
+Parallels disk image format.
+@end table
+
+
 @node host_drives
 @subsection Using host drives
 
diff --git a/qemu-img.texi b/qemu-img.texi
index 60b83fc..00fca8d 100644
--- a/qemu-img.texi
+++ b/qemu-img.texi
@@ -226,7 +226,10 @@ After using this command to grow a disk image, you must use file system and
 partitioning tools inside the VM to actually begin using the new space on the
 device.
 @end table
+@c man end
 
+@ignore
+@c man begin NOTES
 Supported image file formats:
 
 @table @option
@@ -247,6 +250,13 @@ support of multiple VM snapshots.
 
 Supported options:
 @table @code
+@item compat
+Determines the qcow2 version to use. @code{compat=0.10} uses the traditional
+image format that can be read by any QEMU since 0.10 (this is the default).
+@code{compat=1.1} enables image format extensions that only QEMU 1.1 and
+newer understand. Amongst others, this includes zero clusters, which allow
+efficient copy-on-read for sparse images.
+
 @item backing_file
 File name of a base image (see @option{create} subcommand)
 @item backing_fmt
@@ -267,73 +277,33 @@ Preallocation mode (allowed values: off, metadata). An image with preallocated
 metadata is initially larger but can improve performance when the image needs
 to grow.
 
-@end table
+@item lazy_refcounts
+If this option is set to @code{on}, reference count updates are postponed with
+the goal of avoiding metadata I/O and improving performance. This is
+particularly interesting with @option{cache=writethrough} which doesn't batch
+metadata updates. The tradeoff is that after a host crash, the reference count
+tables must be rebuilt, i.e. on the next open an (automatic) @code{qemu-img
+check -r all} is required, which may take some time.
 
-@item qed
-Image format with support for backing files and compact image files (when your
-filesystem or transport medium does not support holes).  Good performance due
-to less metadata than the more featureful qcow2 format, especially with
-cache=writethrough or cache=directsync.  Consider using qcow2 which will soon
-have a similar optimization and is most actively developed.
+This option can only be enabled if @code{compat=1.1} is specified.
 
-Supported options:
-@table @code
-@item backing_file
-File name of a base image (see @option{create} subcommand).
-@item backing_fmt
-Image file format of backing file (optional).  Useful if the format cannot be
-autodetected because it has no header, like some vhd/vpc files.
-@item cluster_size
-Changes the cluster size (must be power-of-2 between 4K and 64K). Smaller
-cluster sizes can improve the image file size whereas larger cluster sizes
-generally provide better performance.
-@item table_size
-Changes the number of clusters per L1/L2 table (must be power-of-2 between 1
-and 16).  There is normally no need to change this value but this option can be
-used for performance benchmarking.
 @end table
 
-@item qcow
-Old QEMU image format. Left for compatibility.
+@item Other
+QEMU also supports various other image file formats for compatibility with
+older QEMU versions or other hypervisors, including VMDK, VDI, VHD (vpc), qcow1
+and QED. For a full list of supported formats see @code{qemu-img --help}.
+For a more detailed description of these formats, see the QEMU Emulation User
+Documentation.
 
-Supported options:
-@table @code
-@item backing_file
-File name of a base image (see @option{create} subcommand)
-@item encryption
-If this option is set to @code{on}, the image is encrypted.
-@end table
-
-@item cow
-User Mode Linux Copy On Write image format. Used to be the only growable
-image format in QEMU. It is supported only for compatibility with
-previous versions. It does not work on win32.
-@item vdi
-VirtualBox 1.1 compatible image format.
-@item vmdk
-VMware 3 and 4 compatible image format.
-
-Supported options:
-@table @code
-@item backing_fmt
-Image format of the base image
-@item compat6
-Create a VMDK version 6 image (instead of version 4)
-@end table
-
-@item vpc
-VirtualPC compatible image format (VHD).
-
-@item cloop
-Linux Compressed Loop image, useful only to reuse directly compressed
-CD-ROM images present for example in the Knoppix CD-ROMs.
+The main purpose of the block drivers for these formats is image conversion.
+For running VMs, it is recommended to convert the disk images to either raw or
+qcow2 in order to achieve good performance.
 @end table
 
 
 @c man end
 
-@ignore
-
 @setfilename qemu-img
 @settitle QEMU disk image utility
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:55 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQB-0005hC-IJ; Tue, 11 Dec 2012 14:02:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQA-0005gB-N8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:54 +0000
Received: from [85.158.143.99:54464] by server-1.bemta-4.messagelabs.com id
	E1/3D-28401-E0D37C05; Tue, 11 Dec 2012 14:02:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1355233884!28855600!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28684 invoked from network); 11 Dec 2012 13:51:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQF2-0001Q3-1Y
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQF1-0005kX-T8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:23 +0000
Date: Tue, 11 Dec 2012 13:51:23 +0000
Message-Id: <E1TiQF1-0005kX-T8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ich9: Add i82801b11
	dmi-to-pci bridge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a1c9304683161a68c1fc1d9c3bc174ec8e26a61a
Author: Jason Baron <jbaron@redhat.com>
Date:   Wed Nov 14 15:54:07 2012 -0500

    ich9: Add i82801b11 dmi-to-pci bridge
    
    Add the dmi-to-pci i82801b11 bridge chip. This is the pci bridge chip
    that q35 uses on its host bus for PCI bus arbitration.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/Makefile.objs |    1 +
 hw/i82801b11.c   |  125 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+), 0 deletions(-)

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 35773de..d581d8d 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -10,6 +10,7 @@ common-obj-$(CONFIG_PCI) += shpc.o
 common-obj-$(CONFIG_PCI) += slotid_cap.o
 common-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
 common-obj-$(CONFIG_PCI) += ioh3420.o xio3130_upstream.o xio3130_downstream.o
+common-obj-$(CONFIG_PCI) += i82801b11.o
 common-obj-y += watchdog.o
 common-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
 common-obj-$(CONFIG_ECC) += ecc.o
diff --git a/hw/i82801b11.c b/hw/i82801b11.c
new file mode 100644
index 0000000..3d1f996
--- /dev/null
+++ b/hw/i82801b11.c
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2006 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+/*
+ * QEMU i82801b11 dmi-to-pci Bridge Emulation
+ *
+ *  Copyright (c) 2009, 2010, 2011
+ *                Isaku Yamahata <yamahata at valinux co jp>
+ *                VA Linux Systems Japan K.K.
+ *  Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "pci.h"
+#include "ich9.h"
+
+
+/*****************************************************************************/
+/* ICH9 DMI-to-PCI bridge */
+#define I82801ba_SSVID_OFFSET   0x50
+#define I82801ba_SSVID_SVID     0
+#define I82801ba_SSVID_SSID     0
+
+typedef struct I82801b11Bridge {
+    PCIBridge br;
+} I82801b11Bridge;
+
+static int i82801b11_bridge_initfn(PCIDevice *d)
+{
+    int rc;
+
+    rc = pci_bridge_initfn(d);
+    if (rc < 0) {
+        return rc;
+    }
+
+    rc = pci_bridge_ssvid_init(d, I82801ba_SSVID_OFFSET,
+                               I82801ba_SSVID_SVID, I82801ba_SSVID_SSID);
+    if (rc < 0) {
+        goto err_bridge;
+    }
+    pci_config_set_prog_interface(d->config, PCI_CLASS_BRDIGE_PCI_INF_SUB);
+    return 0;
+
+err_bridge:
+    pci_bridge_exitfn(d);
+
+    return rc;
+}
+
+static void i82801b11_bridge_class_init(ObjectClass *klass, void *data)
+{
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+    k->is_bridge = 1;
+    k->vendor_id = PCI_VENDOR_ID_INTEL;
+    k->device_id = PCI_DEVICE_ID_INTEL_82801BA_11;
+    k->revision = ICH9_D2P_A2_REVISION;
+    k->init = i82801b11_bridge_initfn;
+}
+
+static const TypeInfo i82801b11_bridge_info = {
+    .name          = "i82801b11-bridge",
+    .parent        = TYPE_PCI_DEVICE,
+    .instance_size = sizeof(I82801b11Bridge),
+    .class_init    = i82801b11_bridge_class_init,
+};
+
+PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus)
+{
+    PCIDevice *d;
+    PCIBridge *br;
+    char buf[16];
+    DeviceState *qdev;
+
+    d = pci_create_multifunction(bus, devfn, true, "i82801b11-bridge");
+    if (!d) {
+        return NULL;
+    }
+    br = DO_UPCAST(PCIBridge, dev, d);
+    qdev = &br->dev.qdev;
+
+    snprintf(buf, sizeof(buf), "pci.%d", sec_bus);
+    pci_bridge_map_irq(br, buf, pci_swizzle_map_irq_fn);
+    qdev_init_nofail(qdev);
+
+    return pci_bridge_get_sec_bus(br);
+}
+
+static void d2pbr_register(void)
+{
+    type_register_static(&i82801b11_bridge_info);
+}
+
+type_init(d2pbr_register);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:02:55 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:02:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQB-0005hC-IJ; Tue, 11 Dec 2012 14:02:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQA-0005gB-N8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:54 +0000
Received: from [85.158.143.99:54464] by server-1.bemta-4.messagelabs.com id
	E1/3D-28401-E0D37C05; Tue, 11 Dec 2012 14:02:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1355233884!28855600!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28684 invoked from network); 11 Dec 2012 13:51:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 13:51:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQF2-0001Q3-1Y
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQF1-0005kX-T8
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 13:51:23 +0000
Date: Tue, 11 Dec 2012 13:51:23 +0000
Message-Id: <E1TiQF1-0005kX-T8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] ich9: Add i82801b11
	dmi-to-pci bridge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a1c9304683161a68c1fc1d9c3bc174ec8e26a61a
Author: Jason Baron <jbaron@redhat.com>
Date:   Wed Nov 14 15:54:07 2012 -0500

    ich9: Add i82801b11 dmi-to-pci bridge
    
    Add the dmi-to-pci i82801b11 bridge chip. This is the pci bridge chip
    that q35 uses on its host bus for PCI bus arbitration.
    
    Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
    Signed-off-by: Jason Baron <jbaron@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/Makefile.objs |    1 +
 hw/i82801b11.c   |  125 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+), 0 deletions(-)

diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 35773de..d581d8d 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -10,6 +10,7 @@ common-obj-$(CONFIG_PCI) += shpc.o
 common-obj-$(CONFIG_PCI) += slotid_cap.o
 common-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
 common-obj-$(CONFIG_PCI) += ioh3420.o xio3130_upstream.o xio3130_downstream.o
+common-obj-$(CONFIG_PCI) += i82801b11.o
 common-obj-y += watchdog.o
 common-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
 common-obj-$(CONFIG_ECC) += ecc.o
diff --git a/hw/i82801b11.c b/hw/i82801b11.c
new file mode 100644
index 0000000..3d1f996
--- /dev/null
+++ b/hw/i82801b11.c
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2006 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+/*
+ * QEMU i82801b11 dmi-to-pci Bridge Emulation
+ *
+ *  Copyright (c) 2009, 2010, 2011
+ *                Isaku Yamahata <yamahata at valinux co jp>
+ *                VA Linux Systems Japan K.K.
+ *  Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "pci.h"
+#include "ich9.h"
+
+
+/*****************************************************************************/
+/* ICH9 DMI-to-PCI bridge */
+#define I82801ba_SSVID_OFFSET   0x50
+#define I82801ba_SSVID_SVID     0
+#define I82801ba_SSVID_SSID     0
+
+typedef struct I82801b11Bridge {
+    PCIBridge br;
+} I82801b11Bridge;
+
+static int i82801b11_bridge_initfn(PCIDevice *d)
+{
+    int rc;
+
+    rc = pci_bridge_initfn(d);
+    if (rc < 0) {
+        return rc;
+    }
+
+    rc = pci_bridge_ssvid_init(d, I82801ba_SSVID_OFFSET,
+                               I82801ba_SSVID_SVID, I82801ba_SSVID_SSID);
+    if (rc < 0) {
+        goto err_bridge;
+    }
+    pci_config_set_prog_interface(d->config, PCI_CLASS_BRDIGE_PCI_INF_SUB);
+    return 0;
+
+err_bridge:
+    pci_bridge_exitfn(d);
+
+    return rc;
+}
+
+static void i82801b11_bridge_class_init(ObjectClass *klass, void *data)
+{
+    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+    k->is_bridge = 1;
+    k->vendor_id = PCI_VENDOR_ID_INTEL;
+    k->device_id = PCI_DEVICE_ID_INTEL_82801BA_11;
+    k->revision = ICH9_D2P_A2_REVISION;
+    k->init = i82801b11_bridge_initfn;
+}
+
+static const TypeInfo i82801b11_bridge_info = {
+    .name          = "i82801b11-bridge",
+    .parent        = TYPE_PCI_DEVICE,
+    .instance_size = sizeof(I82801b11Bridge),
+    .class_init    = i82801b11_bridge_class_init,
+};
+
+PCIBus *ich9_d2pbr_init(PCIBus *bus, int devfn, int sec_bus)
+{
+    PCIDevice *d;
+    PCIBridge *br;
+    char buf[16];
+    DeviceState *qdev;
+
+    d = pci_create_multifunction(bus, devfn, true, "i82801b11-bridge");
+    if (!d) {
+        return NULL;
+    }
+    br = DO_UPCAST(PCIBridge, dev, d);
+    qdev = &br->dev.qdev;
+
+    snprintf(buf, sizeof(buf), "pci.%d", sec_bus);
+    pci_bridge_map_irq(br, buf, pci_swizzle_map_irq_fn);
+    qdev_init_nofail(qdev);
+
+    return pci_bridge_get_sec_bus(br);
+}
+
+static void d2pbr_register(void)
+{
+    type_register_static(&i82801b11_bridge_info);
+}
+
+type_init(d2pbr_register);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQP-0005lN-Pq; Tue, 11 Dec 2012 14:03:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQO-0005kp-Is
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:08 +0000
Received: from [85.158.143.99:57577] by server-3.bemta-4.messagelabs.com id
	8A/A5-18211-B1D37C05; Tue, 11 Dec 2012 14:03:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1355234586!28020425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26424 invoked from network); 11 Dec 2012 14:03:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQL-0001is-NB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQL-0006QG-I9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:05 +0000
Date: Tue, 11 Dec 2012 14:03:05 +0000
Message-Id: <E1TiQQL-0006QG-I9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] stream: fix
	ratelimit_set_speed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e3980e28bb888bf643054770452998d1b4319609
Author: Dietmar Maurer <dietmar@proxmox.com>
Date:   Wed Oct 24 12:10:47 2012 +0200

    stream: fix ratelimit_set_speed
    
    The formula to compute slice_quota was wrong since commit 6ef228fc.
    
    Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 include/qemu/ratelimit.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h
index c6ac281..d1610f1 100644
--- a/include/qemu/ratelimit.h
+++ b/include/qemu/ratelimit.h
@@ -42,7 +42,7 @@ static inline void ratelimit_set_speed(RateLimit *limit, uint64_t speed,
                                        uint64_t slice_ns)
 {
     limit->slice_ns = slice_ns;
-    limit->slice_quota = ((double)speed * 1000000000ULL) / slice_ns;
+    limit->slice_quota = ((double)speed * slice_ns)/1000000000ULL;
 }
 
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:10 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQP-0005lN-Pq; Tue, 11 Dec 2012 14:03:09 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQO-0005kp-Is
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:08 +0000
Received: from [85.158.143.99:57577] by server-3.bemta-4.messagelabs.com id
	8A/A5-18211-B1D37C05; Tue, 11 Dec 2012 14:03:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1355234586!28020425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26424 invoked from network); 11 Dec 2012 14:03:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQL-0001is-NB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQL-0006QG-I9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:05 +0000
Date: Tue, 11 Dec 2012 14:03:05 +0000
Message-Id: <E1TiQQL-0006QG-I9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] stream: fix
	ratelimit_set_speed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e3980e28bb888bf643054770452998d1b4319609
Author: Dietmar Maurer <dietmar@proxmox.com>
Date:   Wed Oct 24 12:10:47 2012 +0200

    stream: fix ratelimit_set_speed
    
    The formula to compute slice_quota was wrong since commit 6ef228fc.
    
    Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 include/qemu/ratelimit.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h
index c6ac281..d1610f1 100644
--- a/include/qemu/ratelimit.h
+++ b/include/qemu/ratelimit.h
@@ -42,7 +42,7 @@ static inline void ratelimit_set_speed(RateLimit *limit, uint64_t speed,
                                        uint64_t slice_ns)
 {
     limit->slice_ns = slice_ns;
-    limit->slice_quota = ((double)speed * 1000000000ULL) / slice_ns;
+    limit->slice_quota = ((double)speed * slice_ns)/1000000000ULL;
 }
 
 #endif
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQQ-0005mG-Su; Tue, 11 Dec 2012 14:03:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQP-0005kx-4Q
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:09 +0000
Received: from [85.158.139.83:17888] by server-3.bemta-5.messagelabs.com id
	0C/8F-25441-C1D37C05; Tue, 11 Dec 2012 14:03:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1355234575!22013848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2360 invoked from network); 11 Dec 2012 14:02:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQB-0001iJ-E1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQB-0006Ps-Cd
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:55 +0000
Date: Tue, 11 Dec 2012 14:02:55 +0000
Message-Id: <E1TiQQB-0006Ps-Cd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] atapi: make change media
	detection for guests easier
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c6f08b0b0d0c758789cdb7257a48e873598bdbb
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Mon Nov 26 16:37:39 2012 +0100

    atapi: make change media detection for guests easier
    
    If you have a guest with a media in the optical drive and you change
    it, the windows guest cannot properly recognize this media change.
    
    Windows needs to detect sense "NOT_READY with ASC_MEDIUM_NOT_PRESENT"
    before we send sense "UNIT_ATTENTION with ASC_MEDIUM_MAY_HAVE_CHANGED".
    
    Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/ide/atapi.c |   15 ++++++++++-----
 hw/ide/core.c  |    6 ------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 685cbaa..861fd2b 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -1124,12 +1124,17 @@ void ide_atapi_cmd(IDEState *s)
      * GET_EVENT_STATUS_NOTIFICATION to detect such tray open/close
      * states rely on this behavior.
      */
-    if (!s->tray_open && bdrv_is_inserted(s->bs) && s->cdrom_changed) {
-        ide_atapi_cmd_error(s, NOT_READY, ASC_MEDIUM_NOT_PRESENT);
+    if (!(atapi_cmd_table[s->io_buffer[0]].flags & ALLOW_UA) &&
+        !s->tray_open && bdrv_is_inserted(s->bs) && s->cdrom_changed) {
+
+        if (s->cdrom_changed == 1) {
+            ide_atapi_cmd_error(s, NOT_READY, ASC_MEDIUM_NOT_PRESENT);
+            s->cdrom_changed = 2;
+        } else {
+            ide_atapi_cmd_error(s, UNIT_ATTENTION, ASC_MEDIUM_MAY_HAVE_CHANGED);
+            s->cdrom_changed = 0;
+        }
 
-        s->cdrom_changed = 0;
-        s->sense_key = UNIT_ATTENTION;
-        s->asc = ASC_MEDIUM_MAY_HAVE_CHANGED;
         return;
     }
 
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 8da894f..c4f93d0 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2160,12 +2160,6 @@ static int ide_drive_post_load(void *opaque, int version_id)
 {
     IDEState *s = opaque;
 
-    if (version_id < 3) {
-        if (s->sense_key == UNIT_ATTENTION &&
-            s->asc == ASC_MEDIUM_MAY_HAVE_CHANGED) {
-            s->cdrom_changed = 1;
-        }
-    }
     if (s->identify_set) {
         bdrv_set_enable_write_cache(s->bs, !!(s->identify_data[85] & (1 << 5)));
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQQ-0005mG-Su; Tue, 11 Dec 2012 14:03:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQP-0005kx-4Q
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:09 +0000
Received: from [85.158.139.83:17888] by server-3.bemta-5.messagelabs.com id
	0C/8F-25441-C1D37C05; Tue, 11 Dec 2012 14:03:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1355234575!22013848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2360 invoked from network); 11 Dec 2012 14:02:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:02:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQB-0001iJ-E1
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQB-0006Ps-Cd
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:02:55 +0000
Date: Tue, 11 Dec 2012 14:02:55 +0000
Message-Id: <E1TiQQB-0006Ps-Cd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] atapi: make change media
	detection for guests easier
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c6f08b0b0d0c758789cdb7257a48e873598bdbb
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Mon Nov 26 16:37:39 2012 +0100

    atapi: make change media detection for guests easier
    
    If you have a guest with a media in the optical drive and you change
    it, the windows guest cannot properly recognize this media change.
    
    Windows needs to detect sense "NOT_READY with ASC_MEDIUM_NOT_PRESENT"
    before we send sense "UNIT_ATTENTION with ASC_MEDIUM_MAY_HAVE_CHANGED".
    
    Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/ide/atapi.c |   15 ++++++++++-----
 hw/ide/core.c  |    6 ------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 685cbaa..861fd2b 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -1124,12 +1124,17 @@ void ide_atapi_cmd(IDEState *s)
      * GET_EVENT_STATUS_NOTIFICATION to detect such tray open/close
      * states rely on this behavior.
      */
-    if (!s->tray_open && bdrv_is_inserted(s->bs) && s->cdrom_changed) {
-        ide_atapi_cmd_error(s, NOT_READY, ASC_MEDIUM_NOT_PRESENT);
+    if (!(atapi_cmd_table[s->io_buffer[0]].flags & ALLOW_UA) &&
+        !s->tray_open && bdrv_is_inserted(s->bs) && s->cdrom_changed) {
+
+        if (s->cdrom_changed == 1) {
+            ide_atapi_cmd_error(s, NOT_READY, ASC_MEDIUM_NOT_PRESENT);
+            s->cdrom_changed = 2;
+        } else {
+            ide_atapi_cmd_error(s, UNIT_ATTENTION, ASC_MEDIUM_MAY_HAVE_CHANGED);
+            s->cdrom_changed = 0;
+        }
 
-        s->cdrom_changed = 0;
-        s->sense_key = UNIT_ATTENTION;
-        s->asc = ASC_MEDIUM_MAY_HAVE_CHANGED;
         return;
     }
 
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 8da894f..c4f93d0 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2160,12 +2160,6 @@ static int ide_drive_post_load(void *opaque, int version_id)
 {
     IDEState *s = opaque;
 
-    if (version_id < 3) {
-        if (s->sense_key == UNIT_ATTENTION &&
-            s->asc == ASC_MEDIUM_MAY_HAVE_CHANGED) {
-            s->cdrom_changed = 1;
-        }
-    }
     if (s->identify_set) {
         bdrv_set_enable_write_cache(s->bs, !!(s->identify_data[85] & (1 << 5)));
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQb-0005qp-04; Tue, 11 Dec 2012 14:03:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQZ-0005pr-3c
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:19 +0000
Received: from [85.158.139.211:5367] by server-15.bemta-5.messagelabs.com id
	71/C2-20523-62D37C05; Tue, 11 Dec 2012 14:03:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355234596!18528087!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12260 invoked from network); 11 Dec 2012 14:03:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQV-0001iz-T4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQV-0006Qg-RW
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:15 +0000
Date: Tue, 11 Dec 2012 14:03:15 +0000
Message-Id: <E1TiQQV-0006Qg-RW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] coroutine-sigaltstack.c:
	Use stack_t, not struct sigaltstack
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2ad2210a7d2483c4c98423ebd59fad87c6124096
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Sat Nov 10 21:47:52 2012 +0000

    coroutine-sigaltstack.c: Use stack_t, not struct sigaltstack
    
    Use the POSIX-specified stack_t type as the argument to sigaltstack()
    rather than the legacy struct sigaltstack. This allows us to compile
    on MacOSX with --with-coroutine=sigaltstack.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 coroutine-sigaltstack.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/coroutine-sigaltstack.c b/coroutine-sigaltstack.c
index 861e878..39dbaa5 100644
--- a/coroutine-sigaltstack.c
+++ b/coroutine-sigaltstack.c
@@ -171,8 +171,8 @@ static Coroutine *coroutine_new(void)
     CoroutineThreadState *coTS;
     struct sigaction sa;
     struct sigaction osa;
-    struct sigaltstack ss;
-    struct sigaltstack oss;
+    stack_t ss;
+    stack_t oss;
     sigset_t sigs;
     sigset_t osigs;
     jmp_buf old_env;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQb-0005qp-04; Tue, 11 Dec 2012 14:03:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQZ-0005pr-3c
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:19 +0000
Received: from [85.158.139.211:5367] by server-15.bemta-5.messagelabs.com id
	71/C2-20523-62D37C05; Tue, 11 Dec 2012 14:03:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355234596!18528087!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12260 invoked from network); 11 Dec 2012 14:03:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQV-0001iz-T4
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQV-0006Qg-RW
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:15 +0000
Date: Tue, 11 Dec 2012 14:03:15 +0000
Message-Id: <E1TiQQV-0006Qg-RW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] coroutine-sigaltstack.c:
	Use stack_t, not struct sigaltstack
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2ad2210a7d2483c4c98423ebd59fad87c6124096
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Sat Nov 10 21:47:52 2012 +0000

    coroutine-sigaltstack.c: Use stack_t, not struct sigaltstack
    
    Use the POSIX-specified stack_t type as the argument to sigaltstack()
    rather than the legacy struct sigaltstack. This allows us to compile
    on MacOSX with --with-coroutine=sigaltstack.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 coroutine-sigaltstack.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/coroutine-sigaltstack.c b/coroutine-sigaltstack.c
index 861e878..39dbaa5 100644
--- a/coroutine-sigaltstack.c
+++ b/coroutine-sigaltstack.c
@@ -171,8 +171,8 @@ static Coroutine *coroutine_new(void)
     CoroutineThreadState *coTS;
     struct sigaction sa;
     struct sigaction osa;
-    struct sigaltstack ss;
-    struct sigaltstack oss;
+    stack_t ss;
+    stack_t oss;
     sigset_t sigs;
     sigset_t osigs;
     jmp_buf old_env;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQv-0005wt-3S; Tue, 11 Dec 2012 14:03:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQt-0005wU-MT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:39 +0000
Received: from [85.158.139.83:23112] by server-2.bemta-5.messagelabs.com id
	AD/97-16162-A3D37C05; Tue, 11 Dec 2012 14:03:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1355234616!25048619!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21360 invoked from network); 11 Dec 2012 14:03:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQq-0001jI-Ly
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQq-0006Se-HB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:36 +0000
Date: Tue, 11 Dec 2012 14:03:36 +0000
Message-Id: <E1TiQQq-0006Se-HB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] seabios: update to
	b1c35f2b28cc0c94ebed8176ff61ac0e0b377798
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f32989d7349c31419d01a0b874f5eb3a238d913
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Fri Nov 30 16:02:58 2012 +0100

    seabios: update to b1c35f2b28cc0c94ebed8176ff61ac0e0b377798
    
    This patch updates the seabios submodule to commit
    b1c35f2b28cc0c94ebed8176ff61ac0e0b377798.
    
    Most important change is that seabios sets the busmaster bit
    in the pci config space for the lsi and esp scsi host adapters.
    Since commit 1c380f9460522f32c8dd2577b2a53d518ec91c6d qemu
    is strict here and disallows any dma access when the bit is
    clear.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 roms/seabios |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/roms/seabios b/roms/seabios
index 5a02306..b1c35f2 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@
-Subproject commit 5a023065388287e261ae9212452ff541f9fa9cd3
+Subproject commit b1c35f2b28cc0c94ebed8176ff61ac0e0b377798
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQv-0005wt-3S; Tue, 11 Dec 2012 14:03:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQt-0005wU-MT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:39 +0000
Received: from [85.158.139.83:23112] by server-2.bemta-5.messagelabs.com id
	AD/97-16162-A3D37C05; Tue, 11 Dec 2012 14:03:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1355234616!25048619!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21360 invoked from network); 11 Dec 2012 14:03:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQq-0001jI-Ly
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQq-0006Se-HB
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:36 +0000
Date: Tue, 11 Dec 2012 14:03:36 +0000
Message-Id: <E1TiQQq-0006Se-HB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] seabios: update to
	b1c35f2b28cc0c94ebed8176ff61ac0e0b377798
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f32989d7349c31419d01a0b874f5eb3a238d913
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Fri Nov 30 16:02:58 2012 +0100

    seabios: update to b1c35f2b28cc0c94ebed8176ff61ac0e0b377798
    
    This patch updates the seabios submodule to commit
    b1c35f2b28cc0c94ebed8176ff61ac0e0b377798.
    
    Most important change is that seabios sets the busmaster bit
    in the pci config space for the lsi and esp scsi host adapters.
    Since commit 1c380f9460522f32c8dd2577b2a53d518ec91c6d qemu
    is strict here and disallows any dma access when the bit is
    clear.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 roms/seabios |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/roms/seabios b/roms/seabios
index 5a02306..b1c35f2 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@
-Subproject commit 5a023065388287e261ae9212452ff541f9fa9cd3
+Subproject commit b1c35f2b28cc0c94ebed8176ff61ac0e0b377798
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQw-0005xN-5x; Tue, 11 Dec 2012 14:03:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQu-0005wg-ON
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:40 +0000
Received: from [85.158.139.83:27775] by server-15.bemta-5.messagelabs.com id
	B1/D3-20523-B3D37C05; Tue, 11 Dec 2012 14:03:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1355234606!29381575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13430 invoked from network); 11 Dec 2012 14:03:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQg-0001j7-3q
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQg-0006R3-1L
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:26 +0000
Date: Tue, 11 Dec 2012 14:03:26 +0000
Message-Id: <E1TiQQg-0006R3-1L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'kwolf/for-anthony' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 90e07938aa08fc179270d46c35fe9fd27c527f33
Merge: 3235f92784bcf679894b34081f4f4b04e4a358e3 2ad2210a7d2483c4c98423ebd59fad87c6124096
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 10:24:24 2012 -0600

    Merge remote-tracking branch 'kwolf/for-anthony' into staging
    
    * kwolf/for-anthony:
      coroutine-sigaltstack.c: Use stack_t, not struct sigaltstack
      stream: fix ratelimit_set_speed
      atapi: make change media detection for guests easier
      Documentation: Update image format information
      Documentation: Update block cache mode information
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 coroutine-sigaltstack.c  |    4 +-
 hw/ide/atapi.c           |   15 +++--
 hw/ide/core.c            |    6 --
 include/qemu/ratelimit.h |    2 +-
 qemu-doc.texi            |  167 ++++++++++++++++++++++++++++++++++++++++++++++
 qemu-img.texi            |   84 ++++++++----------------
 qemu-options.hx          |   38 +++++-----
 7 files changed, 226 insertions(+), 90 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQQw-0005xN-5x; Tue, 11 Dec 2012 14:03:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQu-0005wg-ON
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:40 +0000
Received: from [85.158.139.83:27775] by server-15.bemta-5.messagelabs.com id
	B1/D3-20523-B3D37C05; Tue, 11 Dec 2012 14:03:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1355234606!29381575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13430 invoked from network); 11 Dec 2012 14:03:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQg-0001j7-3q
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQQg-0006R3-1L
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:26 +0000
Date: Tue, 11 Dec 2012 14:03:26 +0000
Message-Id: <E1TiQQg-0006R3-1L@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'kwolf/for-anthony' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 90e07938aa08fc179270d46c35fe9fd27c527f33
Merge: 3235f92784bcf679894b34081f4f4b04e4a358e3 2ad2210a7d2483c4c98423ebd59fad87c6124096
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 10:24:24 2012 -0600

    Merge remote-tracking branch 'kwolf/for-anthony' into staging
    
    * kwolf/for-anthony:
      coroutine-sigaltstack.c: Use stack_t, not struct sigaltstack
      stream: fix ratelimit_set_speed
      atapi: make change media detection for guests easier
      Documentation: Update image format information
      Documentation: Update block cache mode information
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 coroutine-sigaltstack.c  |    4 +-
 hw/ide/atapi.c           |   15 +++--
 hw/ide/core.c            |    6 --
 include/qemu/ratelimit.h |    2 +-
 qemu-doc.texi            |  167 ++++++++++++++++++++++++++++++++++++++++++++++
 qemu-img.texi            |   84 ++++++++----------------
 qemu-options.hx          |   38 +++++-----
 7 files changed, 226 insertions(+), 90 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQR5-0005zI-8g; Tue, 11 Dec 2012 14:03:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQR3-0005yo-GI
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:49 +0000
Received: from [193.109.254.147:56386] by server-15.bemta-14.messagelabs.com
	id A2/0F-12105-44D37C05; Tue, 11 Dec 2012 14:03:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1355234627!9728769!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12578 invoked from network); 11 Dec 2012 14:03:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQR0-0001jR-Tn
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQR0-0006T1-PT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:46 +0000
Date: Tue, 11 Dec 2012 14:03:46 +0000
Message-Id: <E1TiQR0-0006T1-PT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] roms: also copy the dsdt
	when updating seabios.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7527bd85be991d91584329fcbb44af322758719e
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Fri Nov 30 16:24:40 2012 +0100

    roms: also copy the dsdt when updating seabios.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 roms/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/roms/Makefile b/roms/Makefile
index feb9c2b..5e645bc 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -12,6 +12,7 @@ bios: config.seabios
 	sh configure-seabios.sh $<
 	make -C seabios out/bios.bin
 	cp seabios/out/bios.bin ../pc-bios/bios.bin
+	cp seabios/out/*dsdt.aml ../pc-bios/
 
 seavgabios: $(patsubst %,seavgabios-%,$(vgabios_variants))
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:03:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:03:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQR5-0005zI-8g; Tue, 11 Dec 2012 14:03:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQR3-0005yo-GI
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:49 +0000
Received: from [193.109.254.147:56386] by server-15.bemta-14.messagelabs.com
	id A2/0F-12105-44D37C05; Tue, 11 Dec 2012 14:03:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1355234627!9728769!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12578 invoked from network); 11 Dec 2012 14:03:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQR0-0001jR-Tn
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQR0-0006T1-PT
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:46 +0000
Date: Tue, 11 Dec 2012 14:03:46 +0000
Message-Id: <E1TiQR0-0006T1-PT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] roms: also copy the dsdt
	when updating seabios.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7527bd85be991d91584329fcbb44af322758719e
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Fri Nov 30 16:24:40 2012 +0100

    roms: also copy the dsdt when updating seabios.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 roms/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/roms/Makefile b/roms/Makefile
index feb9c2b..5e645bc 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -12,6 +12,7 @@ bios: config.seabios
 	sh configure-seabios.sh $<
 	make -C seabios out/bios.bin
 	cp seabios/out/bios.bin ../pc-bios/bios.bin
+	cp seabios/out/*dsdt.aml ../pc-bios/
 
 seavgabios: $(patsubst %,seavgabios-%,$(vgabios_variants))
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:04:01 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:04:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQRF-00061S-BS; Tue, 11 Dec 2012 14:04:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRE-00061C-Fo
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:00 +0000
Received: from [85.158.137.99:50053] by server-8.bemta-3.messagelabs.com id
	17/83-01297-F4D37C05; Tue, 11 Dec 2012 14:03:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1355234637!13761943!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24504 invoked from network); 11 Dec 2012 14:03:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRB-0001jd-38
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRB-0006TP-1S
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:57 +0000
Date: Tue, 11 Dec 2012 14:03:57 +0000
Message-Id: <E1TiQRB-0006TP-1S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] seabios: update binaries
	in pc-bios/
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7a51dbbaa70677846453f8c961590913052dd86
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Fri Nov 30 16:24:59 2012 +0100

    seabios: update binaries in pc-bios/
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 pc-bios/acpi-dsdt.aml |  Bin 0 -> 4540 bytes
 pc-bios/bios.bin      |  Bin 131072 -> 131072 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/pc-bios/acpi-dsdt.aml b/pc-bios/acpi-dsdt.aml
new file mode 100644
index 0000000..bb3dd83
Binary files /dev/null and b/pc-bios/acpi-dsdt.aml differ
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index eac67cb..dc9b57d 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:04:01 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:04:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQRF-00061S-BS; Tue, 11 Dec 2012 14:04:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRE-00061C-Fo
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:00 +0000
Received: from [85.158.137.99:50053] by server-8.bemta-3.messagelabs.com id
	17/83-01297-F4D37C05; Tue, 11 Dec 2012 14:03:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1355234637!13761943!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24504 invoked from network); 11 Dec 2012 14:03:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:03:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRB-0001jd-38
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRB-0006TP-1S
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:03:57 +0000
Date: Tue, 11 Dec 2012 14:03:57 +0000
Message-Id: <E1TiQRB-0006TP-1S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] seabios: update binaries
	in pc-bios/
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7a51dbbaa70677846453f8c961590913052dd86
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Fri Nov 30 16:24:59 2012 +0100

    seabios: update binaries in pc-bios/
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 pc-bios/acpi-dsdt.aml |  Bin 0 -> 4540 bytes
 pc-bios/bios.bin      |  Bin 131072 -> 131072 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/pc-bios/acpi-dsdt.aml b/pc-bios/acpi-dsdt.aml
new file mode 100644
index 0000000..bb3dd83
Binary files /dev/null and b/pc-bios/acpi-dsdt.aml differ
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index eac67cb..dc9b57d 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:04:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:04:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQRR-00064F-IM; Tue, 11 Dec 2012 14:04:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRQ-00063x-NZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:12 +0000
Received: from [85.158.139.211:13728] by server-3.bemta-5.messagelabs.com id
	6C/81-25441-B5D37C05; Tue, 11 Dec 2012 14:04:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1355234647!19932673!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14304 invoked from network); 11 Dec 2012 14:04:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:04:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRL-0001kA-Bz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRL-0006Tn-7I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:07 +0000
Date: Tue, 11 Dec 2012 14:04:07 +0000
Message-Id: <E1TiQRL-0006Tn-7I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'kraxel/seabios-b1c35f2' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ee0caa8c8fe46b2b2c59604a3b2da0b2d3312d92
Merge: 90e07938aa08fc179270d46c35fe9fd27c527f33 d7a51dbbaa70677846453f8c961590913052dd86
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 10:24:57 2012 -0600

    Merge remote-tracking branch 'kraxel/seabios-b1c35f2' into staging
    
    * kraxel/seabios-b1c35f2:
      seabios: update binaries in pc-bios/
      roms: also copy the dsdt when updating seabios.
      seabios: update to b1c35f2b28cc0c94ebed8176ff61ac0e0b377798
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 pc-bios/acpi-dsdt.aml |  Bin 0 -> 4540 bytes
 pc-bios/bios.bin      |  Bin 131072 -> 131072 bytes
 roms/Makefile         |    1 +
 roms/seabios          |    2 +-
 4 files changed, 2 insertions(+), 1 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:04:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:04:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQRR-00064F-IM; Tue, 11 Dec 2012 14:04:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRQ-00063x-NZ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:12 +0000
Received: from [85.158.139.211:13728] by server-3.bemta-5.messagelabs.com id
	6C/81-25441-B5D37C05; Tue, 11 Dec 2012 14:04:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1355234647!19932673!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14304 invoked from network); 11 Dec 2012 14:04:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:04:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRL-0001kA-Bz
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRL-0006Tn-7I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:07 +0000
Date: Tue, 11 Dec 2012 14:04:07 +0000
Message-Id: <E1TiQRL-0006Tn-7I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'kraxel/seabios-b1c35f2' into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ee0caa8c8fe46b2b2c59604a3b2da0b2d3312d92
Merge: 90e07938aa08fc179270d46c35fe9fd27c527f33 d7a51dbbaa70677846453f8c961590913052dd86
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 10:24:57 2012 -0600

    Merge remote-tracking branch 'kraxel/seabios-b1c35f2' into staging
    
    * kraxel/seabios-b1c35f2:
      seabios: update binaries in pc-bios/
      roms: also copy the dsdt when updating seabios.
      seabios: update to b1c35f2b28cc0c94ebed8176ff61ac0e0b377798
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

 pc-bios/acpi-dsdt.aml |  Bin 0 -> 4540 bytes
 pc-bios/bios.bin      |  Bin 131072 -> 131072 bytes
 roms/Makefile         |    1 +
 roms/seabios          |    2 +-
 4 files changed, 2 insertions(+), 1 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:04:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:04:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQRs-00067Y-N7; Tue, 11 Dec 2012 14:04:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRr-00067O-JJ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:39 +0000
Received: from [193.109.254.147:22992] by server-3.bemta-14.messagelabs.com id
	53/D1-01317-67D37C05; Tue, 11 Dec 2012 14:04:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1355234667!8681151!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.8 required=7.0 tests=MANY_EXCLAMATIONS
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18098 invoked from network); 11 Dec 2012 14:04:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:04:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRf-0001kL-Q9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRf-0006Ui-Lb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:27 +0000
Date: Tue, 11 Dec 2012 14:04:27 +0000
Message-Id: <E1TiQRf-0006Ui-Lb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] e1000: Discard packets
	that are too long if !SBP and !LPE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b0d9ffcd0251161c7c92f94804dcf599dfa3edeb
Author: Michael Contreras <michael@inetric.com>
Date:   Sun Dec 2 20:11:22 2012 -0800

    e1000: Discard packets that are too long if !SBP and !LPE
    
    The e1000_receive function for the e1000 needs to discard packets longer than
    1522 bytes if the SBP and LPE flags are disabled. The linux driver assumes
    this behavior and allocates memory based on this assumption.
    
    Signed-off-by: Michael Contreras <michael@inetric.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/e1000.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index cb7e7e8..5537ad2 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -59,6 +59,9 @@ static int debugflags = DBGBIT(TXERR) | DBGBIT(GENERAL);
 #define PNPMMIO_SIZE      0x20000
 #define MIN_BUF_SIZE      60 /* Min. octets in an ethernet frame sans FCS */
 
+/* this is the size past which hardware will drop packets when setting LPE=0 */
+#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
+
 /*
  * HW models:
  *  E1000_DEV_ID_82540EM works with Windows and Linux
@@ -805,6 +808,13 @@ e1000_receive(NetClientState *nc, const uint8_t *buf, size_t size)
         size = sizeof(min_buf);
     }
 
+    /* Discard oversized packets if !LPE and !SBP. */
+    if (size > MAXIMUM_ETHERNET_VLAN_SIZE
+        && !(s->mac_reg[RCTL] & E1000_RCTL_LPE)
+        && !(s->mac_reg[RCTL] & E1000_RCTL_SBP)) {
+        return size;
+    }
+
     if (!receive_filter(s, buf, size))
         return size;
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:04:41 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:04:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQRs-00067Y-N7; Tue, 11 Dec 2012 14:04:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRr-00067O-JJ
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:39 +0000
Received: from [193.109.254.147:22992] by server-3.bemta-14.messagelabs.com id
	53/D1-01317-67D37C05; Tue, 11 Dec 2012 14:04:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1355234667!8681151!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.8 required=7.0 tests=MANY_EXCLAMATIONS
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18098 invoked from network); 11 Dec 2012 14:04:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:04:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRf-0001kL-Q9
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRf-0006Ui-Lb
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:27 +0000
Date: Tue, 11 Dec 2012 14:04:27 +0000
Message-Id: <E1TiQRf-0006Ui-Lb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] e1000: Discard packets
	that are too long if !SBP and !LPE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b0d9ffcd0251161c7c92f94804dcf599dfa3edeb
Author: Michael Contreras <michael@inetric.com>
Date:   Sun Dec 2 20:11:22 2012 -0800

    e1000: Discard packets that are too long if !SBP and !LPE
    
    The e1000_receive function for the e1000 needs to discard packets longer than
    1522 bytes if the SBP and LPE flags are disabled. The linux driver assumes
    this behavior and allocates memory based on this assumption.
    
    Signed-off-by: Michael Contreras <michael@inetric.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/e1000.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index cb7e7e8..5537ad2 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -59,6 +59,9 @@ static int debugflags = DBGBIT(TXERR) | DBGBIT(GENERAL);
 #define PNPMMIO_SIZE      0x20000
 #define MIN_BUF_SIZE      60 /* Min. octets in an ethernet frame sans FCS */
 
+/* this is the size past which hardware will drop packets when setting LPE=0 */
+#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
+
 /*
  * HW models:
  *  E1000_DEV_ID_82540EM works with Windows and Linux
@@ -805,6 +808,13 @@ e1000_receive(NetClientState *nc, const uint8_t *buf, size_t size)
         size = sizeof(min_buf);
     }
 
+    /* Discard oversized packets if !LPE and !SBP. */
+    if (size > MAXIMUM_ETHERNET_VLAN_SIZE
+        && !(s->mac_reg[RCTL] & E1000_RCTL_LPE)
+        && !(s->mac_reg[RCTL] & E1000_RCTL_SBP)) {
+        return size;
+    }
+
     if (!receive_filter(s, buf, size))
         return size;
 
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:04:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:04:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQRu-00068E-Px; Tue, 11 Dec 2012 14:04:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRt-00067k-GX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:41 +0000
Received: from [85.158.143.99:7963] by server-3.bemta-4.messagelabs.com id
	9D/88-18211-87D37C05; Tue, 11 Dec 2012 14:04:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1355234678!23694250!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24753 invoked from network); 11 Dec 2012 14:04:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:04:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRp-0001kQ-VV
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRp-0006Vg-Td
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:37 +0000
Date: Tue, 11 Dec 2012 14:04:37 +0000
Message-Id: <E1TiQRp-0006Vg-Td@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Update version for 1.3.0
	release
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6d6c9f59ca1b1a76ade7ad868bef191818f58819
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Dec 3 08:02:50 2012 -0600

    Update version for 1.3.0 release
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 VERSION |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/VERSION b/VERSION
index 19838b2..f0bb29e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.92
+1.3.0
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:04:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:04:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQRu-00068E-Px; Tue, 11 Dec 2012 14:04:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRt-00067k-GX
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:41 +0000
Received: from [85.158.143.99:7963] by server-3.bemta-4.messagelabs.com id
	9D/88-18211-87D37C05; Tue, 11 Dec 2012 14:04:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1355234678!23694250!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24753 invoked from network); 11 Dec 2012 14:04:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:04:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRp-0001kQ-VV
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRp-0006Vg-Td
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:37 +0000
Date: Tue, 11 Dec 2012 14:04:37 +0000
Message-Id: <E1TiQRp-0006Vg-Td@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Update version for 1.3.0
	release
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6d6c9f59ca1b1a76ade7ad868bef191818f58819
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Dec 3 08:02:50 2012 -0600

    Update version for 1.3.0 release
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 VERSION |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/VERSION b/VERSION
index 19838b2..f0bb29e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.92
+1.3.0
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:04:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:04:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQS5-00069q-T8; Tue, 11 Dec 2012 14:04:53 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQS4-00069S-4B
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:52 +0000
Received: from [193.109.254.147:25985] by server-8.bemta-14.messagelabs.com id
	47/40-05026-38D37C05; Tue, 11 Dec 2012 14:04:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1355234431!4491144!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1592 invoked from network); 11 Dec 2012 14:00:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNr-0001fu-7U
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNr-0006H9-1I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:31 +0000
Date: Tue, 11 Dec 2012 14:00:31 +0000
Message-Id: <E1TiQNr-0006H9-1I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] seccomp: adding new
	syscalls (bugzilla 855162)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe512d65e0b752dfa7af6cfb374a0820d35040d0
Author: Eduardo Otubo <otubo@linux.vnet.ibm.com>
Date:   Thu Nov 29 13:56:41 2012 -0200

    seccomp: adding new syscalls (bugzilla 855162)
    
    According to the bug 855162[0] - there's the need of adding new syscalls
    to the whitelist when using Qemu with Libvirt.
    
    [0] - https://bugzilla.redhat.com/show_bug.cgi?id=855162
    
    Reported-by: Paul Moore <pmoore@redhat.com>
    Tested-by: Paul Moore <pmoore@redhat.com>
    Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
    Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qemu-seccomp.c |  156 +++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 139 insertions(+), 17 deletions(-)

diff --git a/qemu-seccomp.c b/qemu-seccomp.c
index 64329a3..2a71d6f 100644
--- a/qemu-seccomp.c
+++ b/qemu-seccomp.c
@@ -26,8 +26,12 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(timer_gettime), 254 },
     { SCMP_SYS(futex), 253 },
     { SCMP_SYS(select), 252 },
+#if defined(__x86_64__)
     { SCMP_SYS(recvfrom), 251 },
     { SCMP_SYS(sendto), 250 },
+#elif defined(__i386__)
+    { SCMP_SYS(socketcall), 250 },
+#endif
     { SCMP_SYS(read), 249 },
     { SCMP_SYS(brk), 248 },
     { SCMP_SYS(clone), 247 },
@@ -36,15 +40,30 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(execve), 245 },
     { SCMP_SYS(open), 245 },
     { SCMP_SYS(ioctl), 245 },
+#if defined(__x86_64__)
+    { SCMP_SYS(socket), 245 },
+    { SCMP_SYS(setsockopt), 245 },
     { SCMP_SYS(recvmsg), 245 },
     { SCMP_SYS(sendmsg), 245 },
     { SCMP_SYS(accept), 245 },
     { SCMP_SYS(connect), 245 },
+    { SCMP_SYS(socketpair), 245 },
+    { SCMP_SYS(bind), 245 },
+    { SCMP_SYS(listen), 245 },
+    { SCMP_SYS(semget), 245 },
+#elif defined(__i386__)
+    { SCMP_SYS(ipc), 245 },
+#endif
     { SCMP_SYS(gettimeofday), 245 },
     { SCMP_SYS(readlink), 245 },
     { SCMP_SYS(access), 245 },
     { SCMP_SYS(prctl), 245 },
     { SCMP_SYS(signalfd), 245 },
+    { SCMP_SYS(getrlimit), 245 },
+    { SCMP_SYS(set_tid_address), 245 },
+    { SCMP_SYS(statfs), 245 },
+    { SCMP_SYS(unlink), 245 },
+    { SCMP_SYS(wait4), 245 },
 #if defined(__i386__)
     { SCMP_SYS(fcntl64), 245 },
     { SCMP_SYS(fstat64), 245 },
@@ -56,30 +75,33 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(sigreturn), 245 },
     { SCMP_SYS(_newselect), 245 },
     { SCMP_SYS(_llseek), 245 },
-    { SCMP_SYS(mmap2), 245},
+    { SCMP_SYS(mmap2), 245 },
     { SCMP_SYS(sigprocmask), 245 },
-#elif defined(__x86_64__)
-    { SCMP_SYS(sched_getparam), 245},
-    { SCMP_SYS(sched_getscheduler), 245},
-    { SCMP_SYS(fstat), 245},
-    { SCMP_SYS(clock_getres), 245},
-    { SCMP_SYS(sched_get_priority_min), 245},
-    { SCMP_SYS(sched_get_priority_max), 245},
-    { SCMP_SYS(stat), 245},
-    { SCMP_SYS(socket), 245},
-    { SCMP_SYS(setsockopt), 245},
-    { SCMP_SYS(uname), 245},
-    { SCMP_SYS(semget), 245},
 #endif
+    { SCMP_SYS(sched_getparam), 245 },
+    { SCMP_SYS(sched_getscheduler), 245 },
+    { SCMP_SYS(fstat), 245 },
+    { SCMP_SYS(clock_getres), 245 },
+    { SCMP_SYS(sched_get_priority_min), 245 },
+    { SCMP_SYS(sched_get_priority_max), 245 },
+    { SCMP_SYS(stat), 245 },
+    { SCMP_SYS(uname), 245 },
     { SCMP_SYS(eventfd2), 245 },
     { SCMP_SYS(dup), 245 },
+    { SCMP_SYS(dup2), 245 },
+    { SCMP_SYS(dup3), 245 },
     { SCMP_SYS(gettid), 245 },
+    { SCMP_SYS(getgid), 245 },
+    { SCMP_SYS(getegid), 245 },
+    { SCMP_SYS(getuid), 245 },
+    { SCMP_SYS(geteuid), 245 },
     { SCMP_SYS(timer_create), 245 },
     { SCMP_SYS(exit), 245 },
     { SCMP_SYS(clock_gettime), 245 },
     { SCMP_SYS(time), 245 },
     { SCMP_SYS(restart_syscall), 245 },
     { SCMP_SYS(pwrite64), 245 },
+    { SCMP_SYS(nanosleep), 245 },
     { SCMP_SYS(chown), 245 },
     { SCMP_SYS(openat), 245 },
     { SCMP_SYS(getdents), 245 },
@@ -93,8 +115,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(lseek), 245 },
     { SCMP_SYS(pselect6), 245 },
     { SCMP_SYS(fork), 245 },
-    { SCMP_SYS(bind), 245 },
-    { SCMP_SYS(listen), 245 },
     { SCMP_SYS(eventfd), 245 },
     { SCMP_SYS(rt_sigprocmask), 245 },
     { SCMP_SYS(write), 244 },
@@ -104,10 +124,112 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(pipe2), 242 },
     { SCMP_SYS(munmap), 242 },
     { SCMP_SYS(mremap), 242 },
+    { SCMP_SYS(fdatasync), 242 },
+    { SCMP_SYS(close), 242 },
+    { SCMP_SYS(rt_sigpending), 242 },
+    { SCMP_SYS(rt_sigtimedwait), 242 },
+    { SCMP_SYS(readv), 242 },
+    { SCMP_SYS(writev), 242 },
+    { SCMP_SYS(preadv), 242 },
+    { SCMP_SYS(pwritev), 242 },
+    { SCMP_SYS(setrlimit), 242 },
+    { SCMP_SYS(ftruncate), 242 },
+    { SCMP_SYS(lstat), 242 },
+    { SCMP_SYS(pipe), 242 },
+    { SCMP_SYS(umask), 242 },
+    { SCMP_SYS(chdir), 242 },
+    { SCMP_SYS(setitimer), 242 },
+    { SCMP_SYS(setsid), 242 },
+    { SCMP_SYS(poll), 242 },
+    { SCMP_SYS(epoll_create), 242 },
+    { SCMP_SYS(epoll_ctl), 242 },
+    { SCMP_SYS(epoll_wait), 242 },
+#if defined(__i386__)
+    { SCMP_SYS(waitpid), 242 },
+#elif defined(__x86_64__)
     { SCMP_SYS(getsockname), 242 },
     { SCMP_SYS(getpeername), 242 },
-    { SCMP_SYS(fdatasync), 242 },
-    { SCMP_SYS(close), 242 }
+    { SCMP_SYS(accept4), 242 },
+    { SCMP_SYS(newfstatat), 241 },
+    { SCMP_SYS(shutdown), 241 },
+    { SCMP_SYS(getsockopt), 241 },
+    { SCMP_SYS(semctl), 241 },
+    { SCMP_SYS(semop), 241 },
+    { SCMP_SYS(semtimedop), 241 },
+    { SCMP_SYS(epoll_ctl_old), 241 },
+    { SCMP_SYS(epoll_wait_old), 241 },
+#endif
+    { SCMP_SYS(epoll_pwait), 241 },
+    { SCMP_SYS(epoll_create1), 241 },
+    { SCMP_SYS(ppoll), 241 },
+    { SCMP_SYS(creat), 241 },
+    { SCMP_SYS(link), 241 },
+    { SCMP_SYS(getpid), 241 },
+    { SCMP_SYS(getppid), 241 },
+    { SCMP_SYS(getpgrp), 241 },
+    { SCMP_SYS(getpgid), 241 },
+    { SCMP_SYS(getsid), 241 },
+    { SCMP_SYS(getdents64), 241 },
+    { SCMP_SYS(getresuid), 241 },
+    { SCMP_SYS(getresgid), 241 },
+    { SCMP_SYS(getgroups), 241 },
+#if defined(__i386__)
+    { SCMP_SYS(getresuid32), 241 },
+    { SCMP_SYS(getresgid32), 241 },
+    { SCMP_SYS(getgroups32), 241 },
+    { SCMP_SYS(signal), 241 },
+    { SCMP_SYS(sigaction), 241 },
+    { SCMP_SYS(sigsuspend), 241 },
+    { SCMP_SYS(sigpending), 241 },
+    { SCMP_SYS(truncate64), 241 },
+    { SCMP_SYS(ftruncate64), 241 },
+    { SCMP_SYS(fchown32), 241 },
+    { SCMP_SYS(chown32), 241 },
+    { SCMP_SYS(lchown32), 241 },
+    { SCMP_SYS(statfs64), 241 },
+    { SCMP_SYS(fstatfs64), 241 },
+    { SCMP_SYS(fstatat64), 241 },
+    { SCMP_SYS(lstat64), 241 },
+    { SCMP_SYS(sendfile64), 241 },
+    { SCMP_SYS(ugetrlimit), 241 },
+#endif
+    { SCMP_SYS(alarm), 241 },
+    { SCMP_SYS(rt_sigsuspend), 241 },
+    { SCMP_SYS(rt_sigqueueinfo), 241 },
+    { SCMP_SYS(rt_tgsigqueueinfo), 241 },
+    { SCMP_SYS(sigaltstack), 241 },
+    { SCMP_SYS(signalfd4), 241 },
+    { SCMP_SYS(truncate), 241 },
+    { SCMP_SYS(fchown), 241 },
+    { SCMP_SYS(lchown), 241 },
+    { SCMP_SYS(fchownat), 241 },
+    { SCMP_SYS(fstatfs), 241 },
+    { SCMP_SYS(sendfile), 241 },
+    { SCMP_SYS(getitimer), 241 },
+    { SCMP_SYS(syncfs), 241 },
+    { SCMP_SYS(fsync), 241 },
+    { SCMP_SYS(fchdir), 241 },
+    { SCMP_SYS(flock), 241 },
+    { SCMP_SYS(msync), 241 },
+    { SCMP_SYS(sched_setparam), 241 },
+    { SCMP_SYS(sched_setscheduler), 241 },
+    { SCMP_SYS(sched_yield), 241 },
+    { SCMP_SYS(sched_rr_get_interval), 241 },
+    { SCMP_SYS(sched_setaffinity), 241 },
+    { SCMP_SYS(sched_getaffinity), 241 },
+    { SCMP_SYS(readahead), 241 },
+    { SCMP_SYS(timer_getoverrun), 241 },
+    { SCMP_SYS(unlinkat), 241 },
+    { SCMP_SYS(readlinkat), 241 },
+    { SCMP_SYS(faccessat), 241 },
+    { SCMP_SYS(get_robust_list), 241 },
+    { SCMP_SYS(splice), 241 },
+    { SCMP_SYS(vmsplice), 241 },
+    { SCMP_SYS(getcpu), 241 },
+    { SCMP_SYS(sendmmsg), 241 },
+    { SCMP_SYS(recvmmsg), 241 },
+    { SCMP_SYS(prlimit64), 241 },
+    { SCMP_SYS(waitid), 241 }
 };
 
 int seccomp_start(void)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:04:54 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:04:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQS5-00069q-T8; Tue, 11 Dec 2012 14:04:53 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQS4-00069S-4B
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:52 +0000
Received: from [193.109.254.147:25985] by server-8.bemta-14.messagelabs.com id
	47/40-05026-38D37C05; Tue, 11 Dec 2012 14:04:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1355234431!4491144!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1592 invoked from network); 11 Dec 2012 14:00:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:00:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNr-0001fu-7U
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQNr-0006H9-1I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:00:31 +0000
Date: Tue, 11 Dec 2012 14:00:31 +0000
Message-Id: <E1TiQNr-0006H9-1I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] seccomp: adding new
	syscalls (bugzilla 855162)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe512d65e0b752dfa7af6cfb374a0820d35040d0
Author: Eduardo Otubo <otubo@linux.vnet.ibm.com>
Date:   Thu Nov 29 13:56:41 2012 -0200

    seccomp: adding new syscalls (bugzilla 855162)
    
    According to the bug 855162[0] - there's the need of adding new syscalls
    to the whitelist when using Qemu with Libvirt.
    
    [0] - https://bugzilla.redhat.com/show_bug.cgi?id=855162
    
    Reported-by: Paul Moore <pmoore@redhat.com>
    Tested-by: Paul Moore <pmoore@redhat.com>
    Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
    Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qemu-seccomp.c |  156 +++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 139 insertions(+), 17 deletions(-)

diff --git a/qemu-seccomp.c b/qemu-seccomp.c
index 64329a3..2a71d6f 100644
--- a/qemu-seccomp.c
+++ b/qemu-seccomp.c
@@ -26,8 +26,12 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(timer_gettime), 254 },
     { SCMP_SYS(futex), 253 },
     { SCMP_SYS(select), 252 },
+#if defined(__x86_64__)
     { SCMP_SYS(recvfrom), 251 },
     { SCMP_SYS(sendto), 250 },
+#elif defined(__i386__)
+    { SCMP_SYS(socketcall), 250 },
+#endif
     { SCMP_SYS(read), 249 },
     { SCMP_SYS(brk), 248 },
     { SCMP_SYS(clone), 247 },
@@ -36,15 +40,30 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(execve), 245 },
     { SCMP_SYS(open), 245 },
     { SCMP_SYS(ioctl), 245 },
+#if defined(__x86_64__)
+    { SCMP_SYS(socket), 245 },
+    { SCMP_SYS(setsockopt), 245 },
     { SCMP_SYS(recvmsg), 245 },
     { SCMP_SYS(sendmsg), 245 },
     { SCMP_SYS(accept), 245 },
     { SCMP_SYS(connect), 245 },
+    { SCMP_SYS(socketpair), 245 },
+    { SCMP_SYS(bind), 245 },
+    { SCMP_SYS(listen), 245 },
+    { SCMP_SYS(semget), 245 },
+#elif defined(__i386__)
+    { SCMP_SYS(ipc), 245 },
+#endif
     { SCMP_SYS(gettimeofday), 245 },
     { SCMP_SYS(readlink), 245 },
     { SCMP_SYS(access), 245 },
     { SCMP_SYS(prctl), 245 },
     { SCMP_SYS(signalfd), 245 },
+    { SCMP_SYS(getrlimit), 245 },
+    { SCMP_SYS(set_tid_address), 245 },
+    { SCMP_SYS(statfs), 245 },
+    { SCMP_SYS(unlink), 245 },
+    { SCMP_SYS(wait4), 245 },
 #if defined(__i386__)
     { SCMP_SYS(fcntl64), 245 },
     { SCMP_SYS(fstat64), 245 },
@@ -56,30 +75,33 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(sigreturn), 245 },
     { SCMP_SYS(_newselect), 245 },
     { SCMP_SYS(_llseek), 245 },
-    { SCMP_SYS(mmap2), 245},
+    { SCMP_SYS(mmap2), 245 },
     { SCMP_SYS(sigprocmask), 245 },
-#elif defined(__x86_64__)
-    { SCMP_SYS(sched_getparam), 245},
-    { SCMP_SYS(sched_getscheduler), 245},
-    { SCMP_SYS(fstat), 245},
-    { SCMP_SYS(clock_getres), 245},
-    { SCMP_SYS(sched_get_priority_min), 245},
-    { SCMP_SYS(sched_get_priority_max), 245},
-    { SCMP_SYS(stat), 245},
-    { SCMP_SYS(socket), 245},
-    { SCMP_SYS(setsockopt), 245},
-    { SCMP_SYS(uname), 245},
-    { SCMP_SYS(semget), 245},
 #endif
+    { SCMP_SYS(sched_getparam), 245 },
+    { SCMP_SYS(sched_getscheduler), 245 },
+    { SCMP_SYS(fstat), 245 },
+    { SCMP_SYS(clock_getres), 245 },
+    { SCMP_SYS(sched_get_priority_min), 245 },
+    { SCMP_SYS(sched_get_priority_max), 245 },
+    { SCMP_SYS(stat), 245 },
+    { SCMP_SYS(uname), 245 },
     { SCMP_SYS(eventfd2), 245 },
     { SCMP_SYS(dup), 245 },
+    { SCMP_SYS(dup2), 245 },
+    { SCMP_SYS(dup3), 245 },
     { SCMP_SYS(gettid), 245 },
+    { SCMP_SYS(getgid), 245 },
+    { SCMP_SYS(getegid), 245 },
+    { SCMP_SYS(getuid), 245 },
+    { SCMP_SYS(geteuid), 245 },
     { SCMP_SYS(timer_create), 245 },
     { SCMP_SYS(exit), 245 },
     { SCMP_SYS(clock_gettime), 245 },
     { SCMP_SYS(time), 245 },
     { SCMP_SYS(restart_syscall), 245 },
     { SCMP_SYS(pwrite64), 245 },
+    { SCMP_SYS(nanosleep), 245 },
     { SCMP_SYS(chown), 245 },
     { SCMP_SYS(openat), 245 },
     { SCMP_SYS(getdents), 245 },
@@ -93,8 +115,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(lseek), 245 },
     { SCMP_SYS(pselect6), 245 },
     { SCMP_SYS(fork), 245 },
-    { SCMP_SYS(bind), 245 },
-    { SCMP_SYS(listen), 245 },
     { SCMP_SYS(eventfd), 245 },
     { SCMP_SYS(rt_sigprocmask), 245 },
     { SCMP_SYS(write), 244 },
@@ -104,10 +124,112 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(pipe2), 242 },
     { SCMP_SYS(munmap), 242 },
     { SCMP_SYS(mremap), 242 },
+    { SCMP_SYS(fdatasync), 242 },
+    { SCMP_SYS(close), 242 },
+    { SCMP_SYS(rt_sigpending), 242 },
+    { SCMP_SYS(rt_sigtimedwait), 242 },
+    { SCMP_SYS(readv), 242 },
+    { SCMP_SYS(writev), 242 },
+    { SCMP_SYS(preadv), 242 },
+    { SCMP_SYS(pwritev), 242 },
+    { SCMP_SYS(setrlimit), 242 },
+    { SCMP_SYS(ftruncate), 242 },
+    { SCMP_SYS(lstat), 242 },
+    { SCMP_SYS(pipe), 242 },
+    { SCMP_SYS(umask), 242 },
+    { SCMP_SYS(chdir), 242 },
+    { SCMP_SYS(setitimer), 242 },
+    { SCMP_SYS(setsid), 242 },
+    { SCMP_SYS(poll), 242 },
+    { SCMP_SYS(epoll_create), 242 },
+    { SCMP_SYS(epoll_ctl), 242 },
+    { SCMP_SYS(epoll_wait), 242 },
+#if defined(__i386__)
+    { SCMP_SYS(waitpid), 242 },
+#elif defined(__x86_64__)
     { SCMP_SYS(getsockname), 242 },
     { SCMP_SYS(getpeername), 242 },
-    { SCMP_SYS(fdatasync), 242 },
-    { SCMP_SYS(close), 242 }
+    { SCMP_SYS(accept4), 242 },
+    { SCMP_SYS(newfstatat), 241 },
+    { SCMP_SYS(shutdown), 241 },
+    { SCMP_SYS(getsockopt), 241 },
+    { SCMP_SYS(semctl), 241 },
+    { SCMP_SYS(semop), 241 },
+    { SCMP_SYS(semtimedop), 241 },
+    { SCMP_SYS(epoll_ctl_old), 241 },
+    { SCMP_SYS(epoll_wait_old), 241 },
+#endif
+    { SCMP_SYS(epoll_pwait), 241 },
+    { SCMP_SYS(epoll_create1), 241 },
+    { SCMP_SYS(ppoll), 241 },
+    { SCMP_SYS(creat), 241 },
+    { SCMP_SYS(link), 241 },
+    { SCMP_SYS(getpid), 241 },
+    { SCMP_SYS(getppid), 241 },
+    { SCMP_SYS(getpgrp), 241 },
+    { SCMP_SYS(getpgid), 241 },
+    { SCMP_SYS(getsid), 241 },
+    { SCMP_SYS(getdents64), 241 },
+    { SCMP_SYS(getresuid), 241 },
+    { SCMP_SYS(getresgid), 241 },
+    { SCMP_SYS(getgroups), 241 },
+#if defined(__i386__)
+    { SCMP_SYS(getresuid32), 241 },
+    { SCMP_SYS(getresgid32), 241 },
+    { SCMP_SYS(getgroups32), 241 },
+    { SCMP_SYS(signal), 241 },
+    { SCMP_SYS(sigaction), 241 },
+    { SCMP_SYS(sigsuspend), 241 },
+    { SCMP_SYS(sigpending), 241 },
+    { SCMP_SYS(truncate64), 241 },
+    { SCMP_SYS(ftruncate64), 241 },
+    { SCMP_SYS(fchown32), 241 },
+    { SCMP_SYS(chown32), 241 },
+    { SCMP_SYS(lchown32), 241 },
+    { SCMP_SYS(statfs64), 241 },
+    { SCMP_SYS(fstatfs64), 241 },
+    { SCMP_SYS(fstatat64), 241 },
+    { SCMP_SYS(lstat64), 241 },
+    { SCMP_SYS(sendfile64), 241 },
+    { SCMP_SYS(ugetrlimit), 241 },
+#endif
+    { SCMP_SYS(alarm), 241 },
+    { SCMP_SYS(rt_sigsuspend), 241 },
+    { SCMP_SYS(rt_sigqueueinfo), 241 },
+    { SCMP_SYS(rt_tgsigqueueinfo), 241 },
+    { SCMP_SYS(sigaltstack), 241 },
+    { SCMP_SYS(signalfd4), 241 },
+    { SCMP_SYS(truncate), 241 },
+    { SCMP_SYS(fchown), 241 },
+    { SCMP_SYS(lchown), 241 },
+    { SCMP_SYS(fchownat), 241 },
+    { SCMP_SYS(fstatfs), 241 },
+    { SCMP_SYS(sendfile), 241 },
+    { SCMP_SYS(getitimer), 241 },
+    { SCMP_SYS(syncfs), 241 },
+    { SCMP_SYS(fsync), 241 },
+    { SCMP_SYS(fchdir), 241 },
+    { SCMP_SYS(flock), 241 },
+    { SCMP_SYS(msync), 241 },
+    { SCMP_SYS(sched_setparam), 241 },
+    { SCMP_SYS(sched_setscheduler), 241 },
+    { SCMP_SYS(sched_yield), 241 },
+    { SCMP_SYS(sched_rr_get_interval), 241 },
+    { SCMP_SYS(sched_setaffinity), 241 },
+    { SCMP_SYS(sched_getaffinity), 241 },
+    { SCMP_SYS(readahead), 241 },
+    { SCMP_SYS(timer_getoverrun), 241 },
+    { SCMP_SYS(unlinkat), 241 },
+    { SCMP_SYS(readlinkat), 241 },
+    { SCMP_SYS(faccessat), 241 },
+    { SCMP_SYS(get_robust_list), 241 },
+    { SCMP_SYS(splice), 241 },
+    { SCMP_SYS(vmsplice), 241 },
+    { SCMP_SYS(getcpu), 241 },
+    { SCMP_SYS(sendmmsg), 241 },
+    { SCMP_SYS(recvmmsg), 241 },
+    { SCMP_SYS(prlimit64), 241 },
+    { SCMP_SYS(waitid), 241 }
 };
 
 int seccomp_start(void)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:05:06 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:05:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQSI-0006Bw-0B; Tue, 11 Dec 2012 14:05:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQSG-0006Be-Jf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:05:04 +0000
Received: from [85.158.139.83:35251] by server-10.bemta-5.messagelabs.com id
	2F/58-13383-F8D37C05; Tue, 11 Dec 2012 14:05:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1355234657!28816490!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18838 invoked from network); 11 Dec 2012 14:04:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:04:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRV-0001kI-Hc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRV-0006UL-FM
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:17 +0000
Date: Tue, 11 Dec 2012 14:04:17 +0000
Message-Id: <E1TiQRV-0006UL-FM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Update version for
	1.3.0-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 01bbd8bf2caced5cb07939669f58d3a7bcc78092
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 15:04:16 2012 -0600

    Update version for 1.3.0-rc2
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 VERSION |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/VERSION b/VERSION
index 1ec5aef..19838b2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.91
+1.2.92
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:05:06 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:05:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQSI-0006Bw-0B; Tue, 11 Dec 2012 14:05:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQSG-0006Be-Jf
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:05:04 +0000
Received: from [85.158.139.83:35251] by server-10.bemta-5.messagelabs.com id
	2F/58-13383-F8D37C05; Tue, 11 Dec 2012 14:05:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1355234657!28816490!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18838 invoked from network); 11 Dec 2012 14:04:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:04:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRV-0001kI-Hc
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQRV-0006UL-FM
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:17 +0000
Date: Tue, 11 Dec 2012 14:04:17 +0000
Message-Id: <E1TiQRV-0006UL-FM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Update version for
	1.3.0-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 01bbd8bf2caced5cb07939669f58d3a7bcc78092
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Fri Nov 30 15:04:16 2012 -0600

    Update version for 1.3.0-rc2
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 VERSION |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/VERSION b/VERSION
index 1ec5aef..19838b2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.91
+1.2.92
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:08:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:08:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQVb-0006Pm-B8; Tue, 11 Dec 2012 14:08:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQVZ-0006Pe-Uq
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:08:30 +0000
Received: from [85.158.139.83:7601] by server-14.bemta-5.messagelabs.com id
	65/2E-09538-D5E37C05; Tue, 11 Dec 2012 14:08:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1355234688!22109126!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19621 invoked from network); 11 Dec 2012 14:04:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:04:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQS0-0001kT-8I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQS0-0006W3-6C
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:48 +0000
Date: Tue, 11 Dec 2012 14:04:48 +0000
Message-Id: <E1TiQS0-0006W3-6C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge commit 'v1.3.0' into
	xen-staging-master-4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3752993df8af5cffa1b8219fe175d235597b4474
Merge: 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 6d6c9f59ca1b1a76ade7ad868bef191818f58819
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Wed Dec 5 11:31:01 2012 +0000

    Merge commit 'v1.3.0' into xen-staging-master-4

 Makefile                      |    2 +-
 Makefile.target               |    3 +
 VERSION                       |    2 +-
 aio-win32.c                   |    5 +-
 audio/audio_pt_int.c          |    1 -
 audio/wavcapture.c            |    1 -
 block.c                       |    3 +-
 block/iscsi.c                 |  260 +++++-----------
 block/raw-posix.c             |   16 +
 block/rbd.c                   |    4 +-
 block/vdi.c                   |    9 +-
 blockdev-nbd.c                |    2 +-
 configure                     |   16 +
 coroutine-sigaltstack.c       |    4 +-
 event_notifier-win32.c        |    2 +-
 hw/Makefile.objs              |    4 +-
 hw/acpi_ich9.c                |  322 ++++++++++++++++++++
 hw/acpi_ich9.h                |   47 +++
 hw/e1000.c                    |   10 +
 hw/i386/Makefile.objs         |    1 +
 hw/i8259_internal.h           |    2 +-
 hw/i82801b11.c                |  125 ++++++++
 hw/ich9.h                     |  207 +++++++++++++
 hw/ide/atapi.c                |   15 +-
 hw/ide/core.c                 |   19 +-
 hw/ide/macio.c                |    6 +-
 hw/kvm/ioapic.c               |   40 +++
 hw/lpc_ich9.c                 |  525 ++++++++++++++++++++++++++++++++
 hw/mc146818rtc.c              |    6 +-
 hw/pam.c                      |   87 ++++++
 hw/pam.h                      |   97 ++++++
 hw/pc.c                       |   39 +++
 hw/pc.h                       |    3 +
 hw/pc_piix.c                  |   79 +-----
 hw/pc_q35.c                   |  223 ++++++++++++++
 hw/pci-hotplug.c              |    8 +-
 hw/pci.c                      |    2 +-
 hw/pci_ids.h                  |   14 +
 hw/piix_pci.c                 |   68 +----
 hw/q35.c                      |  309 +++++++++++++++++++
 hw/q35.h                      |  150 +++++++++
 hw/qdev-core.h                |    5 -
 hw/qdev-monitor.c             |    5 +-
 hw/qdev.c                     |   26 +-
 hw/qxl.c                      |    1 +
 hw/s390-virtio.c              |    1 -
 hw/s390x/event-facility.c     |    3 +-
 hw/smbus_ich9.c               |  159 ++++++++++
 hw/spapr_pci.c                |    2 +-
 hw/sysbus.c                   |    2 +-
 hw/usb/bus.c                  |    7 +
 hw/usb/dev-bluetooth.c        |   25 ++-
 hw/usb/dev-smartcard-reader.c |    2 +
 hw/usb/hcd-ehci-pci.c         |    1 +
 hw/usb/hcd-ehci-sysbus.c      |    1 +
 hw/usb/hcd-ohci.c             |    1 +
 hw/usb/hcd-uhci.c             |   20 +-
 hw/usb/hcd-xhci.c             |    1 +
 hw/usb/redirect.c             |  150 +++++-----
 hw/virtio-rng.c               |  101 ++-----
 hw/virtio-scsi.c              |   12 +-
 hw/virtio-serial-bus.c        |    2 +-
 hw/virtio.c                   |   15 +-
 hw/virtio.h                   |    3 +-
 include/qemu/object.h         |   29 ++-
 include/qemu/ratelimit.h      |    2 +-
 include/qemu/rng.h            |    6 +-
 kvm-all.c                     |    2 +-
 kvm.h                         |    2 +
 nbd.c                         |    2 +-
 net/tap.c                     |    7 +
 pc-bios/acpi-dsdt.aml         |  Bin 0 -> 4540 bytes
 pc-bios/bios.bin              |  Bin 131072 -> 131072 bytes
 pc-bios/multiboot.bin         |  Bin 1024 -> 1024 bytes
 pc-bios/optionrom/multiboot.S |    7 +
 qapi/qapi-dealloc-visitor.c   |    6 +
 qemu-doc.texi                 |  167 ++++++++++
 qemu-img.texi                 |   84 ++----
 qemu-options.hx               |   48 ++--
 qemu-pixman.c                 |    2 +
 qemu-seccomp.c                |  156 +++++++++-
 qemu-tech.texi                |   10 +-
 qom/object.c                  |   16 +-
 roms/Makefile                 |    1 +
 roms/seabios                  |    2 +-
 target-i386/cpu.c             |    7 +-
 target-mips/translate.c       |   42 ++-
 target-openrisc/cpu.h         |   18 --
 target-ppc/translate.c        |    3 +-
 tcg/arm/tcg-target.c          |   98 ++++---
 tcg/tcg.c                     |    2 +-
 tci.c                         |    4 +-
 tests/Makefile                |    4 +
 tests/rtc-test.c              |   40 +++
 tests/test-aio.c              |  667 +++++++++++++++++++++++++++++++++++++++++
 tests/test-thread-pool.c      |  216 +++++++++++++
 ui/spice-core.c               |    2 +-
 ui/spice-display.c            |   35 +++
 ui/vnc.c                      |    2 +-
 vl.c                          |   12 +-
 100 files changed, 4237 insertions(+), 747 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 14:08:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 14:08:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiQVb-0006Pm-B8; Tue, 11 Dec 2012 14:08:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQVZ-0006Pe-Uq
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:08:30 +0000
Received: from [85.158.139.83:7601] by server-14.bemta-5.messagelabs.com id
	65/2E-09538-D5E37C05; Tue, 11 Dec 2012 14:08:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1355234688!22109126!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19621 invoked from network); 11 Dec 2012 14:04:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 14:04:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQS0-0001kT-8I
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiQS0-0006W3-6C
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 14:04:48 +0000
Date: Tue, 11 Dec 2012 14:04:48 +0000
Message-Id: <E1TiQS0-0006W3-6C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge commit 'v1.3.0' into
	xen-staging-master-4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3752993df8af5cffa1b8219fe175d235597b4474
Merge: 1e6f3bf92c84d9ba8fdc61f4deb1777e737c7a2c 6d6c9f59ca1b1a76ade7ad868bef191818f58819
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Wed Dec 5 11:31:01 2012 +0000

    Merge commit 'v1.3.0' into xen-staging-master-4

 Makefile                      |    2 +-
 Makefile.target               |    3 +
 VERSION                       |    2 +-
 aio-win32.c                   |    5 +-
 audio/audio_pt_int.c          |    1 -
 audio/wavcapture.c            |    1 -
 block.c                       |    3 +-
 block/iscsi.c                 |  260 +++++-----------
 block/raw-posix.c             |   16 +
 block/rbd.c                   |    4 +-
 block/vdi.c                   |    9 +-
 blockdev-nbd.c                |    2 +-
 configure                     |   16 +
 coroutine-sigaltstack.c       |    4 +-
 event_notifier-win32.c        |    2 +-
 hw/Makefile.objs              |    4 +-
 hw/acpi_ich9.c                |  322 ++++++++++++++++++++
 hw/acpi_ich9.h                |   47 +++
 hw/e1000.c                    |   10 +
 hw/i386/Makefile.objs         |    1 +
 hw/i8259_internal.h           |    2 +-
 hw/i82801b11.c                |  125 ++++++++
 hw/ich9.h                     |  207 +++++++++++++
 hw/ide/atapi.c                |   15 +-
 hw/ide/core.c                 |   19 +-
 hw/ide/macio.c                |    6 +-
 hw/kvm/ioapic.c               |   40 +++
 hw/lpc_ich9.c                 |  525 ++++++++++++++++++++++++++++++++
 hw/mc146818rtc.c              |    6 +-
 hw/pam.c                      |   87 ++++++
 hw/pam.h                      |   97 ++++++
 hw/pc.c                       |   39 +++
 hw/pc.h                       |    3 +
 hw/pc_piix.c                  |   79 +-----
 hw/pc_q35.c                   |  223 ++++++++++++++
 hw/pci-hotplug.c              |    8 +-
 hw/pci.c                      |    2 +-
 hw/pci_ids.h                  |   14 +
 hw/piix_pci.c                 |   68 +----
 hw/q35.c                      |  309 +++++++++++++++++++
 hw/q35.h                      |  150 +++++++++
 hw/qdev-core.h                |    5 -
 hw/qdev-monitor.c             |    5 +-
 hw/qdev.c                     |   26 +-
 hw/qxl.c                      |    1 +
 hw/s390-virtio.c              |    1 -
 hw/s390x/event-facility.c     |    3 +-
 hw/smbus_ich9.c               |  159 ++++++++++
 hw/spapr_pci.c                |    2 +-
 hw/sysbus.c                   |    2 +-
 hw/usb/bus.c                  |    7 +
 hw/usb/dev-bluetooth.c        |   25 ++-
 hw/usb/dev-smartcard-reader.c |    2 +
 hw/usb/hcd-ehci-pci.c         |    1 +
 hw/usb/hcd-ehci-sysbus.c      |    1 +
 hw/usb/hcd-ohci.c             |    1 +
 hw/usb/hcd-uhci.c             |   20 +-
 hw/usb/hcd-xhci.c             |    1 +
 hw/usb/redirect.c             |  150 +++++-----
 hw/virtio-rng.c               |  101 ++-----
 hw/virtio-scsi.c              |   12 +-
 hw/virtio-serial-bus.c        |    2 +-
 hw/virtio.c                   |   15 +-
 hw/virtio.h                   |    3 +-
 include/qemu/object.h         |   29 ++-
 include/qemu/ratelimit.h      |    2 +-
 include/qemu/rng.h            |    6 +-
 kvm-all.c                     |    2 +-
 kvm.h                         |    2 +
 nbd.c                         |    2 +-
 net/tap.c                     |    7 +
 pc-bios/acpi-dsdt.aml         |  Bin 0 -> 4540 bytes
 pc-bios/bios.bin              |  Bin 131072 -> 131072 bytes
 pc-bios/multiboot.bin         |  Bin 1024 -> 1024 bytes
 pc-bios/optionrom/multiboot.S |    7 +
 qapi/qapi-dealloc-visitor.c   |    6 +
 qemu-doc.texi                 |  167 ++++++++++
 qemu-img.texi                 |   84 ++----
 qemu-options.hx               |   48 ++--
 qemu-pixman.c                 |    2 +
 qemu-seccomp.c                |  156 +++++++++-
 qemu-tech.texi                |   10 +-
 qom/object.c                  |   16 +-
 roms/Makefile                 |    1 +
 roms/seabios                  |    2 +-
 target-i386/cpu.c             |    7 +-
 target-mips/translate.c       |   42 ++-
 target-openrisc/cpu.h         |   18 --
 target-ppc/translate.c        |    3 +-
 tcg/arm/tcg-target.c          |   98 ++++---
 tcg/tcg.c                     |    2 +-
 tci.c                         |    4 +-
 tests/Makefile                |    4 +
 tests/rtc-test.c              |   40 +++
 tests/test-aio.c              |  667 +++++++++++++++++++++++++++++++++++++++++
 tests/test-thread-pool.c      |  216 +++++++++++++
 ui/spice-core.c               |    2 +-
 ui/spice-display.c            |   35 +++
 ui/vnc.c                      |    2 +-
 vl.c                          |   12 +-
 100 files changed, 4237 insertions(+), 747 deletions(-)
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 11 16:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 16:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiSQQ-0003Py-48; Tue, 11 Dec 2012 16:11:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiSQO-0003Pk-KS
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 16:11:16 +0000
Received: from [193.109.254.147:49677] by server-7.bemta-14.messagelabs.com id
	56/6B-02272-32B57C05; Tue, 11 Dec 2012 16:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1355242271!2455406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11189 invoked from network); 11 Dec 2012 16:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 16:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiSQJ-0003St-Nh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 16:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiSQJ-0001Ub-FO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 16:11:11 +0000
Date: Tue, 11 Dec 2012 16:11:11 +0000
Message-Id: <E1TiSQJ-0001Ub-FO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.2-testing] qemu-stubdom: prevent
	useless medium change
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0666836554315288283=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0666836554315288283==
Content-Type: text/plain

commit 6f5e128677e2d5795cf1ade4080fb69d5e442887
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Thu Dec 6 12:35:58 2012 +0000

    qemu-stubdom: prevent useless medium change
    
    qemu-stubdom was stripping the prefix from the "params" xenstore
    key in xenstore_parse_domain_config, which was then saved stripped in
    a variable. In xenstore_process_event we compare the "param" from
    xenstore (not stripped) with the stripped "param" saved in the
    variable, which leads to a medium change (even if there isn't any),
    since we are comparing something like aio:/path/to/file with
    /path/to/file. This only happens one time, since
    xenstore_parse_domain_config is the only place where we strip the
    prefix. The result of this bug is the following:
    
    xs_read_watch() -> /local/domain/0/backend/qdisk/19/5632/params hdc
    close(7)
    close blk: backend=/local/domain/0/backend/qdisk/19/5632
    node=/local/domain/19/device/vbd/5632
    (XEN) HVM18: HVM Loader
    (XEN) HVM18: Detected Xen v4.3-unstable
    (XEN) HVM18: Xenbus rings @0xfeffc000, event channel 4
    (XEN) HVM18: System requested ROMBIOS
    (XEN) HVM18: CPU speed is 2400 MHz
    (XEN) irq.c:270: Dom18 PCI link 0 changed 0 -> 5
    (XEN) HVM18: PCI-ISA link 0 routed to IRQ5
    (XEN) irq.c:270: Dom18 PCI link 1 changed 0 -> 10
    (XEN) HVM18: PCI-ISA link 1 routed to IRQ10
    (XEN) irq.c:270: Dom18 PCI link 2 changed 0 -> 11
    (XEN) HVM18: PCI-ISA link 2 routed to IRQ11
    (XEN) irq.c:270: Dom18 PCI link 3 changed 0 -> 5
    (XEN) HVM18: PCI-ISA link 3 routed to IRQ5
    (XEN) HVM18: pci dev 01:3 INTA->IRQ10
    (XEN) HVM18: pci dev 03:0 INTA->IRQ5
    (XEN) HVM18: pci dev 04:0 INTA->IRQ5
    (XEN) HVM18: pci dev 02:0 bar 10 size lx: 02000000
    (XEN) HVM18: pci dev 03:0 bar 14 size lx: 01000000
    (XEN) HVM18: pci dev 02:0 bar 14 size lx: 00001000
    (XEN) HVM18: pci dev 03:0 bar 10 size lx: 00000100
    (XEN) HVM18: pci dev 04:0 bar 10 size lx: 00000100
    (XEN) HVM18: pci dev 04:0 bar 14 size lx: 00000100
    (XEN) HVM18: pci dev 01:1 bar 20 size lx: 00000010
    (XEN) HVM18: Multiprocessor initialisation:
    (XEN) HVM18:  - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done.
    (XEN) HVM18:  - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done.
    (XEN) HVM18: Testing HVM environment:
    (XEN) HVM18:  - REP INSB across page boundaries ... passed
    (XEN) HVM18:  - GS base MSRs and SWAPGS ... passed
    (XEN) HVM18: Passed 2 of 2 tests
    (XEN) HVM18: Writing SMBIOS tables ...
    (XEN) HVM18: Loading ROMBIOS ...
    (XEN) HVM18: 9660 bytes of ROMBIOS high-memory extensions:
    (XEN) HVM18:   Relocating to 0xfc001000-0xfc0035bc ... done
    (XEN) HVM18: Creating MP tables ...
    (XEN) HVM18: Loading Cirrus VGABIOS ...
    (XEN) HVM18: Loading PCI Option ROM ...
    (XEN) HVM18:  - Manufacturer: http://ipxe.org
    (XEN) HVM18:  - Product name: iPXE
    (XEN) HVM18: Option ROMs:
    (XEN) HVM18:  c0000-c8fff: VGA BIOS
    (XEN) HVM18:  c9000-d8fff: Etherboot ROM
    (XEN) HVM18: Loading ACPI ...
    (XEN) HVM18: vm86 TSS at fc00f680
    (XEN) HVM18: BIOS map:
    (XEN) HVM18:  f0000-fffff: Main BIOS
    (XEN) HVM18: E820 table:
    (XEN) HVM18:  [00]: 00000000:00000000 - 00000000:0009e000: RAM
    (XEN) HVM18:  [01]: 00000000:0009e000 - 00000000:000a0000: RESERVED
    (XEN) HVM18:  HOLE: 00000000:000a0000 - 00000000:000e0000
    (XEN) HVM18:  [02]: 00000000:000e0000 - 00000000:00100000: RESERVED
    (XEN) HVM18:  [03]: 00000000:00100000 - 00000000:3f800000: RAM
    (XEN) HVM18:  HOLE: 00000000:3f800000 - 00000000:fc000000
    (XEN) HVM18:  [04]: 00000000:fc000000 - 00000001:00000000: RESERVED
    (XEN) HVM18: Invoking ROMBIOS ...
    (XEN) HVM18: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
    (XEN) stdvga.c:147:d18 entering stdvga and caching modes
    (XEN) HVM18: VGABios $Id: vgabios.c,v 1.67 2008/01/27 09:44:12 vruppert Exp $
    (XEN) HVM18: Bochs BIOS - build: 06/23/99
    (XEN) HVM18: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
    (XEN) HVM18: Options: apmbios pcibios eltorito PMM
    (XEN) HVM18:
    (XEN) HVM18: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
    (XEN) HVM18: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (10240 MBytes)
    (XEN) HVM18: IDE time out
    (XEN) HVM18: ata1 master: QEMU DVD-ROM ATAPI-4 CD-Rom/DVD-Rom
    (XEN) HVM18: IDE time out
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18: Press F12 for boot menu.
    (XEN) HVM18:
    (XEN) HVM18: Booting from CD-Rom...
    (XEN) HVM18: ata_is_ready returned 1
    (XEN) HVM18: CDROM boot failure code : 0003
    (XEN) HVM18: Boot from CD-Rom failed: could not read the boot disk
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18: No bootable device.
    (XEN) HVM18: Powering off in 30 seconds.
    ******************* BLKFRONT for /local/domain/19/device/vbd/5632 **********
    
    backend at /local/domain/0/backend/qdisk/19/5632
    Failed to read
    /local/domain/0/backend/qdisk/19/5632/feature-flush-cache.
    284420 sectors of 512 bytes
    **************************
    blk_open(/local/domain/19/device/vbd/5632) -> 7
    
    As seen in this trace, the medium change happens just when the
    guest is booting, which leads to the guest not being able to boot
    because the BIOS is not able to access the device.
    
    This is a regression from Xen 4.1, which is able to boot from "file:/"
    based backends when using stubdomains.
    
    [ By inspection, this patch does not change the flow for the
      non-stubdom case. -iwj]
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 6a0cf3786f1964fdf5a17f88f26cb499f4e89c81)
---
 xenstore.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xenstore.c b/xenstore.c
index 1857160..d3a4588 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -614,6 +614,12 @@ void xenstore_parse_domain_config(int hvm_domid)
         if (pasprintf(&danger_buf, "%s/device/vbd/%s", danger_path, e_danger[i]) == -1)
             continue;
 	if (bdrv_open2(bs, danger_buf, BDRV_O_CACHE_WB /* snapshot and write-back */, &bdrv_raw) == 0) {
+        if (pasprintf(&buf, "%s/params", bpath) == -1)
+                continue;
+        free(params);
+        params = xs_read(xsh, XBT_NULL, buf, &len);
+        if (params == NULL)
+            continue;
 	    pstrcpy(bs->filename, sizeof(bs->filename), params);
 	}
 #else
@@ -667,11 +673,7 @@ void xenstore_parse_domain_config(int hvm_domid)
 
 	drives_table[nb_drives].bdrv = bs;
 	drives_table[nb_drives].used = 1;
-#ifdef CONFIG_STUBDOM
-    media_filename[nb_drives] = strdup(danger_buf);
-#else
     media_filename[nb_drives] = strdup(bs->filename);
-#endif
 	nb_drives++;
 
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.2-testing.git


--===============0666836554315288283==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0666836554315288283==--

From xen-changelog-bounces@lists.xen.org Tue Dec 11 16:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 11 Dec 2012 16:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiSQQ-0003Py-48; Tue, 11 Dec 2012 16:11:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiSQO-0003Pk-KS
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 16:11:16 +0000
Received: from [193.109.254.147:49677] by server-7.bemta-14.messagelabs.com id
	56/6B-02272-32B57C05; Tue, 11 Dec 2012 16:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1355242271!2455406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11189 invoked from network); 11 Dec 2012 16:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Dec 2012 16:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiSQJ-0003St-Nh
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 16:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1TiSQJ-0001Ub-FO
	for xen-changelog@lists.xensource.com; Tue, 11 Dec 2012 16:11:11 +0000
Date: Tue, 11 Dec 2012 16:11:11 +0000
Message-Id: <E1TiSQJ-0001Ub-FO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.2-testing] qemu-stubdom: prevent
	useless medium change
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0666836554315288283=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0666836554315288283==
Content-Type: text/plain

commit 6f5e128677e2d5795cf1ade4080fb69d5e442887
Author: Roger Pau Monne <roger.pau@citrix.com>
Date:   Thu Dec 6 12:35:58 2012 +0000

    qemu-stubdom: prevent useless medium change
    
    qemu-stubdom was stripping the prefix from the "params" xenstore
    key in xenstore_parse_domain_config, which was then saved stripped in
    a variable. In xenstore_process_event we compare the "param" from
    xenstore (not stripped) with the stripped "param" saved in the
    variable, which leads to a medium change (even if there isn't any),
    since we are comparing something like aio:/path/to/file with
    /path/to/file. This only happens one time, since
    xenstore_parse_domain_config is the only place where we strip the
    prefix. The result of this bug is the following:
    
    xs_read_watch() -> /local/domain/0/backend/qdisk/19/5632/params hdc
    close(7)
    close blk: backend=/local/domain/0/backend/qdisk/19/5632
    node=/local/domain/19/device/vbd/5632
    (XEN) HVM18: HVM Loader
    (XEN) HVM18: Detected Xen v4.3-unstable
    (XEN) HVM18: Xenbus rings @0xfeffc000, event channel 4
    (XEN) HVM18: System requested ROMBIOS
    (XEN) HVM18: CPU speed is 2400 MHz
    (XEN) irq.c:270: Dom18 PCI link 0 changed 0 -> 5
    (XEN) HVM18: PCI-ISA link 0 routed to IRQ5
    (XEN) irq.c:270: Dom18 PCI link 1 changed 0 -> 10
    (XEN) HVM18: PCI-ISA link 1 routed to IRQ10
    (XEN) irq.c:270: Dom18 PCI link 2 changed 0 -> 11
    (XEN) HVM18: PCI-ISA link 2 routed to IRQ11
    (XEN) irq.c:270: Dom18 PCI link 3 changed 0 -> 5
    (XEN) HVM18: PCI-ISA link 3 routed to IRQ5
    (XEN) HVM18: pci dev 01:3 INTA->IRQ10
    (XEN) HVM18: pci dev 03:0 INTA->IRQ5
    (XEN) HVM18: pci dev 04:0 INTA->IRQ5
    (XEN) HVM18: pci dev 02:0 bar 10 size lx: 02000000
    (XEN) HVM18: pci dev 03:0 bar 14 size lx: 01000000
    (XEN) HVM18: pci dev 02:0 bar 14 size lx: 00001000
    (XEN) HVM18: pci dev 03:0 bar 10 size lx: 00000100
    (XEN) HVM18: pci dev 04:0 bar 10 size lx: 00000100
    (XEN) HVM18: pci dev 04:0 bar 14 size lx: 00000100
    (XEN) HVM18: pci dev 01:1 bar 20 size lx: 00000010
    (XEN) HVM18: Multiprocessor initialisation:
    (XEN) HVM18:  - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done.
    (XEN) HVM18:  - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done.
    (XEN) HVM18: Testing HVM environment:
    (XEN) HVM18:  - REP INSB across page boundaries ... passed
    (XEN) HVM18:  - GS base MSRs and SWAPGS ... passed
    (XEN) HVM18: Passed 2 of 2 tests
    (XEN) HVM18: Writing SMBIOS tables ...
    (XEN) HVM18: Loading ROMBIOS ...
    (XEN) HVM18: 9660 bytes of ROMBIOS high-memory extensions:
    (XEN) HVM18:   Relocating to 0xfc001000-0xfc0035bc ... done
    (XEN) HVM18: Creating MP tables ...
    (XEN) HVM18: Loading Cirrus VGABIOS ...
    (XEN) HVM18: Loading PCI Option ROM ...
    (XEN) HVM18:  - Manufacturer: http://ipxe.org
    (XEN) HVM18:  - Product name: iPXE
    (XEN) HVM18: Option ROMs:
    (XEN) HVM18:  c0000-c8fff: VGA BIOS
    (XEN) HVM18:  c9000-d8fff: Etherboot ROM
    (XEN) HVM18: Loading ACPI ...
    (XEN) HVM18: vm86 TSS at fc00f680
    (XEN) HVM18: BIOS map:
    (XEN) HVM18:  f0000-fffff: Main BIOS
    (XEN) HVM18: E820 table:
    (XEN) HVM18:  [00]: 00000000:00000000 - 00000000:0009e000: RAM
    (XEN) HVM18:  [01]: 00000000:0009e000 - 00000000:000a0000: RESERVED
    (XEN) HVM18:  HOLE: 00000000:000a0000 - 00000000:000e0000
    (XEN) HVM18:  [02]: 00000000:000e0000 - 00000000:00100000: RESERVED
    (XEN) HVM18:  [03]: 00000000:00100000 - 00000000:3f800000: RAM
    (XEN) HVM18:  HOLE: 00000000:3f800000 - 00000000:fc000000
    (XEN) HVM18:  [04]: 00000000:fc000000 - 00000001:00000000: RESERVED
    (XEN) HVM18: Invoking ROMBIOS ...
    (XEN) HVM18: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
    (XEN) stdvga.c:147:d18 entering stdvga and caching modes
    (XEN) HVM18: VGABios $Id: vgabios.c,v 1.67 2008/01/27 09:44:12 vruppert Exp $
    (XEN) HVM18: Bochs BIOS - build: 06/23/99
    (XEN) HVM18: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
    (XEN) HVM18: Options: apmbios pcibios eltorito PMM
    (XEN) HVM18:
    (XEN) HVM18: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
    (XEN) HVM18: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (10240 MBytes)
    (XEN) HVM18: IDE time out
    (XEN) HVM18: ata1 master: QEMU DVD-ROM ATAPI-4 CD-Rom/DVD-Rom
    (XEN) HVM18: IDE time out
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18: Press F12 for boot menu.
    (XEN) HVM18:
    (XEN) HVM18: Booting from CD-Rom...
    (XEN) HVM18: ata_is_ready returned 1
    (XEN) HVM18: CDROM boot failure code : 0003
    (XEN) HVM18: Boot from CD-Rom failed: could not read the boot disk
    (XEN) HVM18:
    (XEN) HVM18:
    (XEN) HVM18: No bootable device.
    (XEN) HVM18: Powering off in 30 seconds.
    ******************* BLKFRONT for /local/domain/19/device/vbd/5632 **********
    
    backend at /local/domain/0/backend/qdisk/19/5632
    Failed to read
    /local/domain/0/backend/qdisk/19/5632/feature-flush-cache.
    284420 sectors of 512 bytes
    **************************
    blk_open(/local/domain/19/device/vbd/5632) -> 7
    
    As seen in this trace, the medium change happens just when the
    guest is booting, which leads to the guest not being able to boot
    because the BIOS is not able to access the device.
    
    This is a regression from Xen 4.1, which is able to boot from "file:/"
    based backends when using stubdomains.
    
    [ By inspection, this patch does not change the flow for the
      non-stubdom case. -iwj]
    
    Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 6a0cf3786f1964fdf5a17f88f26cb499f4e89c81)
---
 xenstore.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xenstore.c b/xenstore.c
index 1857160..d3a4588 100644
--- a/xenstore.c
+++ b/xenstore.c
@@ -614,6 +614,12 @@ void xenstore_parse_domain_config(int hvm_domid)
         if (pasprintf(&danger_buf, "%s/device/vbd/%s", danger_path, e_danger[i]) == -1)
             continue;
 	if (bdrv_open2(bs, danger_buf, BDRV_O_CACHE_WB /* snapshot and write-back */, &bdrv_raw) == 0) {
+        if (pasprintf(&buf, "%s/params", bpath) == -1)
+                continue;
+        free(params);
+        params = xs_read(xsh, XBT_NULL, buf, &len);
+        if (params == NULL)
+            continue;
 	    pstrcpy(bs->filename, sizeof(bs->filename), params);
 	}
 #else
@@ -667,11 +673,7 @@ void xenstore_parse_domain_config(int hvm_domid)
 
 	drives_table[nb_drives].bdrv = bs;
 	drives_table[nb_drives].used = 1;
-#ifdef CONFIG_STUBDOM
-    media_filename[nb_drives] = strdup(danger_buf);
-#else
     media_filename[nb_drives] = strdup(bs->filename);
-#endif
 	nb_drives++;
 
     }
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.2-testing.git


--===============0666836554315288283==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============0666836554315288283==--

From xen-changelog-bounces@lists.xen.org Wed Dec 12 00:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 00:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiabU-0002vO-RI; Wed, 12 Dec 2012 00:55:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabS-0002v4-Rh
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:14 +0000
Received: from [193.109.254.147:53372] by server-6.bemta-14.messagelabs.com id
	A5/D3-02788-2F5D7C05; Wed, 12 Dec 2012 00:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1355273711!10144010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25795 invoked from network); 12 Dec 2012 00:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 00:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabP-00016Y-FC
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabP-0007Gc-4c
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:11 +0000
Message-Id: <E1TiabP-0007Gc-4c@xenbits.xen.org>
Date: Wed, 12 Dec 2012 00:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/EFI: work around CFLAGS being
	passed in through environment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Charles Arnold <carnold@suse.com>
# Date 1355230179 -3600
# Node ID 183fcffb6367ae3ce25e2501a0160eed75414bc3
# Parent  1a329da132f46ec7753a68a67ad85f6cb18ea2cc
x86/EFI: work around CFLAGS being passed in through environment

Short of a solution to the problem described in
http://lists.xen.org/archives/html/xen-devel/2012-12/msg00648.html,
deal with the bad effect this together with c/s 25751:02b4d5fedb7b has
on the EFI build by filtering out the problematic command line items.

Signed-off-by: Charles Arnold <carnold@suse.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 1a329da132f4 -r 183fcffb6367 xen/arch/x86/efi/Makefile
--- a/xen/arch/x86/efi/Makefile	Tue Dec 11 13:47:53 2012 +0100
+++ b/xen/arch/x86/efi/Makefile	Tue Dec 11 13:49:39 2012 +0100
@@ -5,7 +5,7 @@ obj-y += stub.o
 create = test -e $(1) || touch -t 199901010000 $(1)
 
 efi := $(filter y,$(x86_64)$(shell rm -f disabled))
-efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y),$(CFLAGS)) -c check.c 2>disabled && echo y))
+efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y))
 efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi check.o 2>disabled && echo y))
 efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o)))
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 00:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 00:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiabU-0002vO-RI; Wed, 12 Dec 2012 00:55:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabS-0002v4-Rh
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:14 +0000
Received: from [193.109.254.147:53372] by server-6.bemta-14.messagelabs.com id
	A5/D3-02788-2F5D7C05; Wed, 12 Dec 2012 00:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1355273711!10144010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25795 invoked from network); 12 Dec 2012 00:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 00:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabP-00016Y-FC
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabP-0007Gc-4c
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:11 +0000
Message-Id: <E1TiabP-0007Gc-4c@xenbits.xen.org>
Date: Wed, 12 Dec 2012 00:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/EFI: work around CFLAGS being
	passed in through environment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Charles Arnold <carnold@suse.com>
# Date 1355230179 -3600
# Node ID 183fcffb6367ae3ce25e2501a0160eed75414bc3
# Parent  1a329da132f46ec7753a68a67ad85f6cb18ea2cc
x86/EFI: work around CFLAGS being passed in through environment

Short of a solution to the problem described in
http://lists.xen.org/archives/html/xen-devel/2012-12/msg00648.html,
deal with the bad effect this together with c/s 25751:02b4d5fedb7b has
on the EFI build by filtering out the problematic command line items.

Signed-off-by: Charles Arnold <carnold@suse.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 1a329da132f4 -r 183fcffb6367 xen/arch/x86/efi/Makefile
--- a/xen/arch/x86/efi/Makefile	Tue Dec 11 13:47:53 2012 +0100
+++ b/xen/arch/x86/efi/Makefile	Tue Dec 11 13:49:39 2012 +0100
@@ -5,7 +5,7 @@ obj-y += stub.o
 create = test -e $(1) || touch -t 199901010000 $(1)
 
 efi := $(filter y,$(x86_64)$(shell rm -f disabled))
-efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y),$(CFLAGS)) -c check.c 2>disabled && echo y))
+efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y))
 efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi check.o 2>disabled && echo y))
 efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o)))
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 00:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 00:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiabW-0002vi-1F; Wed, 12 Dec 2012 00:55:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabU-0002vE-LP
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:16 +0000
Received: from [85.158.137.99:43065] by server-15.bemta-3.messagelabs.com id
	E5/63-07921-3F5D7C05; Wed, 12 Dec 2012 00:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1355273713!13464744!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4329 invoked from network); 12 Dec 2012 00:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 00:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabR-00016e-9e
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabQ-0007H6-Tc
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:12 +0000
Message-Id: <E1TiabQ-0007H6-Tc@xenbits.xen.org>
Date: Wed, 12 Dec 2012 00:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/IST: Create set_ist() helper
	function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1355244559 -3600
# Node ID ef8c1b607b1046b69036bd16d27e08413d47ed11
# Parent  a1599b7ce6b2ab54607f8d34bd11b6c3ca6f0005
x86/IST: Create set_ist() helper function

... to save using open-coded bitwise operations, and update all IST
manipulation sites to use the function.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r a1599b7ce6b2 -r ef8c1b607b10 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Tue Dec 11 17:46:57 2012 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c	Tue Dec 11 17:49:19 2012 +0100
@@ -869,9 +869,9 @@ static void svm_ctxt_switch_from(struct 
     svm_vmload(per_cpu(root_vmcb, cpu));
 
     /* Resume use of ISTs now that the host TR is reinstated. */
-    idt_tables[cpu][TRAP_double_fault].a  |= IST_DF << 32;
-    idt_tables[cpu][TRAP_nmi].a           |= IST_NMI << 32;
-    idt_tables[cpu][TRAP_machine_check].a |= IST_MCE << 32;
+    set_ist(&idt_tables[cpu][TRAP_double_fault],  IST_DF);
+    set_ist(&idt_tables[cpu][TRAP_nmi],           IST_NMI);
+    set_ist(&idt_tables[cpu][TRAP_machine_check], IST_MCE);
 }
 
 static void svm_ctxt_switch_to(struct vcpu *v)
@@ -893,9 +893,9 @@ static void svm_ctxt_switch_to(struct vc
      * Cannot use ISTs for NMI/#MC/#DF while we are running with the guest TR.
      * But this doesn't matter: the IST is only req'd to handle SYSCALL/SYSRET.
      */
-    idt_tables[cpu][TRAP_double_fault].a  &= ~(7UL << 32);
-    idt_tables[cpu][TRAP_nmi].a           &= ~(7UL << 32);
-    idt_tables[cpu][TRAP_machine_check].a &= ~(7UL << 32);
+    set_ist(&idt_tables[cpu][TRAP_double_fault],  IST_NONE);
+    set_ist(&idt_tables[cpu][TRAP_nmi],           IST_NONE);
+    set_ist(&idt_tables[cpu][TRAP_machine_check], IST_NONE);
 
     svm_restore_dr(v);
 
diff -r a1599b7ce6b2 -r ef8c1b607b10 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Tue Dec 11 17:46:57 2012 +0100
+++ b/xen/arch/x86/x86_64/traps.c	Tue Dec 11 17:49:19 2012 +0100
@@ -370,9 +370,9 @@ void __devinit subarch_percpu_traps_init
     {
         /* Specify dedicated interrupt stacks for NMI, #DF, and #MC. */
         set_intr_gate(TRAP_double_fault, &double_fault);
-        idt_table[TRAP_double_fault].a  |= IST_DF << 32;
-        idt_table[TRAP_nmi].a           |= IST_NMI << 32;
-        idt_table[TRAP_machine_check].a |= IST_MCE << 32;
+        set_ist(&idt_table[TRAP_double_fault],  IST_DF);
+        set_ist(&idt_table[TRAP_nmi],           IST_NMI);
+        set_ist(&idt_table[TRAP_machine_check], IST_MCE);
 
         /*
          * The 32-on-64 hypercall entry vector is only accessible from ring 1.
diff -r a1599b7ce6b2 -r ef8c1b607b10 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Tue Dec 11 17:46:57 2012 +0100
+++ b/xen/include/asm-x86/processor.h	Tue Dec 11 17:49:19 2012 +0100
@@ -425,10 +425,20 @@ struct tss_struct {
     u8 __cacheline_filler[24];
 } __cacheline_aligned __attribute__((packed));
 
-#define IST_DF  1UL
-#define IST_NMI 2UL
-#define IST_MCE 3UL
-#define IST_MAX 3UL
+#define IST_NONE 0UL
+#define IST_DF   1UL
+#define IST_NMI  2UL
+#define IST_MCE  3UL
+#define IST_MAX  3UL
+
+/* Set the interrupt stack table used by a particular interrupt
+ * descriptor table entry. */
+static always_inline void set_ist(idt_entry_t *idt, unsigned long ist)
+{
+    /* IST is a 3 bit field, 32 bits into the IDT entry. */
+    ASSERT(ist <= IST_MAX);
+    idt->a = (idt->a & ~(7UL << 32)) | (ist << 32);
+}
 
 #define IDT_ENTRIES 256
 extern idt_entry_t idt_table[];

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 00:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 00:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiabU-0002vX-U4; Wed, 12 Dec 2012 00:55:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabT-0002vD-Re
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:16 +0000
Received: from [85.158.138.51:7999] by server-16.bemta-3.messagelabs.com id
	67/A8-27634-3F5D7C05; Wed, 12 Dec 2012 00:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1355273712!20401532!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28130 invoked from network); 12 Dec 2012 00:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 00:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabQ-00016b-8z
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabQ-0007Gr-0z
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:12 +0000
Message-Id: <E1TiabQ-0007Gr-0z@xenbits.xen.org>
Date: Wed, 12 Dec 2012 00:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/ucode: Improve error handling
	and container file processing on AMD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1355244417 -3600
# Node ID a1599b7ce6b2ab54607f8d34bd11b6c3ca6f0005
# Parent  183fcffb6367ae3ce25e2501a0160eed75414bc3
x86/ucode: Improve error handling and container file processing on AMD

Do not report error when a patch is not appplicable to current processor,
simply skip it and move on to next patch in container file.

Process container file to the end instead of stopping at the first
applicable patch.

Log the fact that a patch has been applied at KERN_WARNING level, modify
debug messages.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 183fcffb6367 -r a1599b7ce6b2 xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Tue Dec 11 13:49:39 2012 +0100
+++ b/xen/arch/x86/microcode_amd.c	Tue Dec 11 17:46:57 2012 +0100
@@ -88,13 +88,13 @@ static int collect_cpu_info(int cpu, str
 
     rdmsrl(MSR_AMD_PATCHLEVEL, csig->rev);
 
-    printk(KERN_DEBUG "microcode: collect_cpu_info: patch_id=%#x\n",
-           csig->rev);
+    printk(KERN_DEBUG "microcode: CPU%d collect_cpu_info: patch_id=%#x\n",
+           cpu, csig->rev);
 
     return 0;
 }
 
-static int microcode_fits(const struct microcode_amd *mc_amd, int cpu)
+static bool_t microcode_fits(const struct microcode_amd *mc_amd, int cpu)
 {
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
     const struct microcode_header_amd *mc_header = mc_amd->mpb;
@@ -121,12 +121,7 @@ static int microcode_fits(const struct m
         return 0;
 
     if ( (mc_header->processor_rev_id) != equiv_cpu_id )
-    {
-        printk(KERN_DEBUG "microcode: CPU%d patch does not match "
-               "(patch is %x, cpu base id is %x) \n",
-               cpu, mc_header->processor_rev_id, equiv_cpu_id);
-        return -EINVAL;
-    }
+        return 0;
 
     if ( mc_header->patch_id <= uci->cpu_sig.rev )
         return 0;
@@ -173,7 +168,7 @@ static int apply_microcode(int cpu)
         return -EIO;
     }
 
-    printk(KERN_INFO "microcode: CPU%d updated from revision %#x to %#x\n",
+    printk(KERN_WARNING "microcode: CPU%d updated from revision %#x to %#x\n",
            cpu, uci->cpu_sig.rev, hdr->patch_id);
 
     uci->cpu_sig.rev = rev;
@@ -181,7 +176,7 @@ static int apply_microcode(int cpu)
     return 0;
 }
 
-static int get_next_ucode_from_buffer_amd(
+static int get_ucode_from_buffer_amd(
     struct microcode_amd *mc_amd,
     const void *buf,
     size_t bufsize,
@@ -195,22 +190,21 @@ static int get_next_ucode_from_buffer_am
 
     /* No more data */
     if ( off >= bufsize )
-        return 1;
+    {
+        printk(KERN_ERR "microcode: Microcode buffer overrun\n");
+        return -EINVAL;
+    }
 
     mpbuf = (const struct mpbhdr *)&bufp[off];
     if ( mpbuf->type != UCODE_UCODE_TYPE )
     {
-        printk(KERN_ERR "microcode: error! "
-               "Wrong microcode payload type field\n");
+        printk(KERN_ERR "microcode: Wrong microcode payload type field\n");
         return -EINVAL;
     }
 
-    printk(KERN_DEBUG "microcode: size %zu, block size %u, offset %zu\n",
-           bufsize, mpbuf->len, off);
-
     if ( (off + mpbuf->len) > bufsize )
     {
-        printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
+        printk(KERN_ERR "microcode: Bad data in microcode data file\n");
         return -EINVAL;
     }
 
@@ -230,6 +224,11 @@ static int get_next_ucode_from_buffer_am
 
     *offset = off + mpbuf->len + 8;
 
+    printk(KERN_DEBUG "microcode: CPU%d size %zu, block size %u offset %zu equivID %#x rev %#x\n",
+           raw_smp_processor_id(), bufsize, mpbuf->len, off,
+           ((struct microcode_header_amd *)mc_amd->mpb)->processor_rev_id,
+           ((struct microcode_header_amd *)mc_amd->mpb)->patch_id);
+
     return 0;
 }
 
@@ -246,23 +245,20 @@ static int install_equiv_cpu_table(
 
     if ( mpbuf->type != UCODE_EQUIV_CPU_TABLE_TYPE )
     {
-        printk(KERN_ERR "microcode: error! "
-               "Wrong microcode equivalent cpu table type field\n");
+        printk(KERN_ERR "microcode: Wrong microcode equivalent cpu table type field\n");
         return -EINVAL;
     }
 
     if ( mpbuf->len == 0 )
     {
-        printk(KERN_ERR "microcode: error! "
-               "Wrong microcode equivalent cpu table length\n");
+        printk(KERN_ERR "microcode: Wrong microcode equivalent cpu table length\n");
         return -EINVAL;
     }
 
     mc_amd->equiv_cpu_table = xmalloc_bytes(mpbuf->len);
     if ( !mc_amd->equiv_cpu_table )
     {
-        printk(KERN_ERR "microcode: error! "
-               "Can not allocate memory for equivalent cpu table\n");
+        printk(KERN_ERR "microcode: Cannot allocate memory for equivalent cpu table\n");
         return -ENOMEM;
     }
 
@@ -278,8 +274,8 @@ static int cpu_request_microcode(int cpu
 {
     struct microcode_amd *mc_amd, *mc_old;
     size_t offset = bufsize;
+    size_t last_offset, applied_offset = 0;
     int error = 0;
-    int ret;
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
 
     /* We should bind the task to the CPU */
@@ -287,8 +283,7 @@ static int cpu_request_microcode(int cpu
 
     if ( *(const uint32_t *)buf != UCODE_MAGIC )
     {
-        printk(KERN_ERR "microcode: error! Wrong "
-               "microcode patch file magic\n");
+        printk(KERN_ERR "microcode: Wrong microcode patch file magic\n");
         error = -EINVAL;
         goto out;
     }
@@ -296,8 +291,7 @@ static int cpu_request_microcode(int cpu
     mc_amd = xmalloc(struct microcode_amd);
     if ( !mc_amd )
     {
-        printk(KERN_ERR "microcode: error! "
-               "Can not allocate memory for microcode patch\n");
+        printk(KERN_ERR "microcode: Cannot allocate memory for microcode patch\n");
         error = -ENOMEM;
         goto out;
     }
@@ -321,33 +315,38 @@ static int cpu_request_microcode(int cpu
      */
     mc_amd->mpb = NULL;
     mc_amd->mpb_size = 0;
-    while ( (ret = get_next_ucode_from_buffer_amd(mc_amd, buf, bufsize,
-                                                  &offset)) == 0 )
+    last_offset = offset;
+    while ( (error = get_ucode_from_buffer_amd(mc_amd, buf, bufsize,
+                                               &offset)) == 0 )
     {
-        error = microcode_fits(mc_amd, cpu);
-        if (error <= 0)
-            continue;
+        if ( microcode_fits(mc_amd, cpu) )
+        {
+            error = apply_microcode(cpu);
+            if ( error )
+                break;
+            applied_offset = last_offset;
+        }
 
-        error = apply_microcode(cpu);
-        if (error == 0)
-        {
-            error = 1;
+        last_offset = offset;
+
+        if ( offset >= bufsize )
             break;
-        }
     }
 
-    if ( ret < 0 )
-        error = ret;
-
     /* On success keep the microcode patch for
      * re-apply on resume.
      */
-    if ( error == 1 )
+    if ( applied_offset )
     {
-        xfree(mc_old);
-        error = 0;
+        int ret = get_ucode_from_buffer_amd(mc_amd, buf, bufsize,
+                                            &applied_offset);
+        if ( ret == 0 )
+            xfree(mc_old);
+        else
+            error = ret;
     }
-    else
+
+    if ( !applied_offset || error )
     {
         xfree(mc_amd);
         uci->mc.mc_amd = mc_old;
@@ -356,6 +355,12 @@ static int cpu_request_microcode(int cpu
   out:
     svm_host_osvw_init();
 
+    /*
+     * In some cases we may return an error even if processor's microcode has
+     * been updated. For example, the first patch in a container file is loaded
+     * successfully but subsequent container file processing encounters a
+     * failure.
+     */
     return error;
 }
 
@@ -364,10 +369,9 @@ static int microcode_resume_match(int cp
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
     struct microcode_amd *mc_amd = uci->mc.mc_amd;
     const struct microcode_amd *src = mc;
-    int res = microcode_fits(src, cpu);
 
-    if ( res <= 0 )
-        return res;
+    if ( !microcode_fits(src, cpu) )
+        return 0;
 
     if ( src != mc_amd )
     {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 00:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 00:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiabW-0002vi-1F; Wed, 12 Dec 2012 00:55:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabU-0002vE-LP
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:16 +0000
Received: from [85.158.137.99:43065] by server-15.bemta-3.messagelabs.com id
	E5/63-07921-3F5D7C05; Wed, 12 Dec 2012 00:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1355273713!13464744!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4329 invoked from network); 12 Dec 2012 00:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 00:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabR-00016e-9e
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabQ-0007H6-Tc
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:12 +0000
Message-Id: <E1TiabQ-0007H6-Tc@xenbits.xen.org>
Date: Wed, 12 Dec 2012 00:55:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/IST: Create set_ist() helper
	function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1355244559 -3600
# Node ID ef8c1b607b1046b69036bd16d27e08413d47ed11
# Parent  a1599b7ce6b2ab54607f8d34bd11b6c3ca6f0005
x86/IST: Create set_ist() helper function

... to save using open-coded bitwise operations, and update all IST
manipulation sites to use the function.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r a1599b7ce6b2 -r ef8c1b607b10 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Tue Dec 11 17:46:57 2012 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c	Tue Dec 11 17:49:19 2012 +0100
@@ -869,9 +869,9 @@ static void svm_ctxt_switch_from(struct 
     svm_vmload(per_cpu(root_vmcb, cpu));
 
     /* Resume use of ISTs now that the host TR is reinstated. */
-    idt_tables[cpu][TRAP_double_fault].a  |= IST_DF << 32;
-    idt_tables[cpu][TRAP_nmi].a           |= IST_NMI << 32;
-    idt_tables[cpu][TRAP_machine_check].a |= IST_MCE << 32;
+    set_ist(&idt_tables[cpu][TRAP_double_fault],  IST_DF);
+    set_ist(&idt_tables[cpu][TRAP_nmi],           IST_NMI);
+    set_ist(&idt_tables[cpu][TRAP_machine_check], IST_MCE);
 }
 
 static void svm_ctxt_switch_to(struct vcpu *v)
@@ -893,9 +893,9 @@ static void svm_ctxt_switch_to(struct vc
      * Cannot use ISTs for NMI/#MC/#DF while we are running with the guest TR.
      * But this doesn't matter: the IST is only req'd to handle SYSCALL/SYSRET.
      */
-    idt_tables[cpu][TRAP_double_fault].a  &= ~(7UL << 32);
-    idt_tables[cpu][TRAP_nmi].a           &= ~(7UL << 32);
-    idt_tables[cpu][TRAP_machine_check].a &= ~(7UL << 32);
+    set_ist(&idt_tables[cpu][TRAP_double_fault],  IST_NONE);
+    set_ist(&idt_tables[cpu][TRAP_nmi],           IST_NONE);
+    set_ist(&idt_tables[cpu][TRAP_machine_check], IST_NONE);
 
     svm_restore_dr(v);
 
diff -r a1599b7ce6b2 -r ef8c1b607b10 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Tue Dec 11 17:46:57 2012 +0100
+++ b/xen/arch/x86/x86_64/traps.c	Tue Dec 11 17:49:19 2012 +0100
@@ -370,9 +370,9 @@ void __devinit subarch_percpu_traps_init
     {
         /* Specify dedicated interrupt stacks for NMI, #DF, and #MC. */
         set_intr_gate(TRAP_double_fault, &double_fault);
-        idt_table[TRAP_double_fault].a  |= IST_DF << 32;
-        idt_table[TRAP_nmi].a           |= IST_NMI << 32;
-        idt_table[TRAP_machine_check].a |= IST_MCE << 32;
+        set_ist(&idt_table[TRAP_double_fault],  IST_DF);
+        set_ist(&idt_table[TRAP_nmi],           IST_NMI);
+        set_ist(&idt_table[TRAP_machine_check], IST_MCE);
 
         /*
          * The 32-on-64 hypercall entry vector is only accessible from ring 1.
diff -r a1599b7ce6b2 -r ef8c1b607b10 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Tue Dec 11 17:46:57 2012 +0100
+++ b/xen/include/asm-x86/processor.h	Tue Dec 11 17:49:19 2012 +0100
@@ -425,10 +425,20 @@ struct tss_struct {
     u8 __cacheline_filler[24];
 } __cacheline_aligned __attribute__((packed));
 
-#define IST_DF  1UL
-#define IST_NMI 2UL
-#define IST_MCE 3UL
-#define IST_MAX 3UL
+#define IST_NONE 0UL
+#define IST_DF   1UL
+#define IST_NMI  2UL
+#define IST_MCE  3UL
+#define IST_MAX  3UL
+
+/* Set the interrupt stack table used by a particular interrupt
+ * descriptor table entry. */
+static always_inline void set_ist(idt_entry_t *idt, unsigned long ist)
+{
+    /* IST is a 3 bit field, 32 bits into the IDT entry. */
+    ASSERT(ist <= IST_MAX);
+    idt->a = (idt->a & ~(7UL << 32)) | (ist << 32);
+}
 
 #define IDT_ENTRIES 256
 extern idt_entry_t idt_table[];

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 00:55:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 00:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiabU-0002vX-U4; Wed, 12 Dec 2012 00:55:16 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabT-0002vD-Re
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:16 +0000
Received: from [85.158.138.51:7999] by server-16.bemta-3.messagelabs.com id
	67/A8-27634-3F5D7C05; Wed, 12 Dec 2012 00:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1355273712!20401532!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28130 invoked from network); 12 Dec 2012 00:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 00:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabQ-00016b-8z
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabQ-0007Gr-0z
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:12 +0000
Message-Id: <E1TiabQ-0007Gr-0z@xenbits.xen.org>
Date: Wed, 12 Dec 2012 00:55:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/ucode: Improve error handling
	and container file processing on AMD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1355244417 -3600
# Node ID a1599b7ce6b2ab54607f8d34bd11b6c3ca6f0005
# Parent  183fcffb6367ae3ce25e2501a0160eed75414bc3
x86/ucode: Improve error handling and container file processing on AMD

Do not report error when a patch is not appplicable to current processor,
simply skip it and move on to next patch in container file.

Process container file to the end instead of stopping at the first
applicable patch.

Log the fact that a patch has been applied at KERN_WARNING level, modify
debug messages.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 183fcffb6367 -r a1599b7ce6b2 xen/arch/x86/microcode_amd.c
--- a/xen/arch/x86/microcode_amd.c	Tue Dec 11 13:49:39 2012 +0100
+++ b/xen/arch/x86/microcode_amd.c	Tue Dec 11 17:46:57 2012 +0100
@@ -88,13 +88,13 @@ static int collect_cpu_info(int cpu, str
 
     rdmsrl(MSR_AMD_PATCHLEVEL, csig->rev);
 
-    printk(KERN_DEBUG "microcode: collect_cpu_info: patch_id=%#x\n",
-           csig->rev);
+    printk(KERN_DEBUG "microcode: CPU%d collect_cpu_info: patch_id=%#x\n",
+           cpu, csig->rev);
 
     return 0;
 }
 
-static int microcode_fits(const struct microcode_amd *mc_amd, int cpu)
+static bool_t microcode_fits(const struct microcode_amd *mc_amd, int cpu)
 {
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
     const struct microcode_header_amd *mc_header = mc_amd->mpb;
@@ -121,12 +121,7 @@ static int microcode_fits(const struct m
         return 0;
 
     if ( (mc_header->processor_rev_id) != equiv_cpu_id )
-    {
-        printk(KERN_DEBUG "microcode: CPU%d patch does not match "
-               "(patch is %x, cpu base id is %x) \n",
-               cpu, mc_header->processor_rev_id, equiv_cpu_id);
-        return -EINVAL;
-    }
+        return 0;
 
     if ( mc_header->patch_id <= uci->cpu_sig.rev )
         return 0;
@@ -173,7 +168,7 @@ static int apply_microcode(int cpu)
         return -EIO;
     }
 
-    printk(KERN_INFO "microcode: CPU%d updated from revision %#x to %#x\n",
+    printk(KERN_WARNING "microcode: CPU%d updated from revision %#x to %#x\n",
            cpu, uci->cpu_sig.rev, hdr->patch_id);
 
     uci->cpu_sig.rev = rev;
@@ -181,7 +176,7 @@ static int apply_microcode(int cpu)
     return 0;
 }
 
-static int get_next_ucode_from_buffer_amd(
+static int get_ucode_from_buffer_amd(
     struct microcode_amd *mc_amd,
     const void *buf,
     size_t bufsize,
@@ -195,22 +190,21 @@ static int get_next_ucode_from_buffer_am
 
     /* No more data */
     if ( off >= bufsize )
-        return 1;
+    {
+        printk(KERN_ERR "microcode: Microcode buffer overrun\n");
+        return -EINVAL;
+    }
 
     mpbuf = (const struct mpbhdr *)&bufp[off];
     if ( mpbuf->type != UCODE_UCODE_TYPE )
     {
-        printk(KERN_ERR "microcode: error! "
-               "Wrong microcode payload type field\n");
+        printk(KERN_ERR "microcode: Wrong microcode payload type field\n");
         return -EINVAL;
     }
 
-    printk(KERN_DEBUG "microcode: size %zu, block size %u, offset %zu\n",
-           bufsize, mpbuf->len, off);
-
     if ( (off + mpbuf->len) > bufsize )
     {
-        printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
+        printk(KERN_ERR "microcode: Bad data in microcode data file\n");
         return -EINVAL;
     }
 
@@ -230,6 +224,11 @@ static int get_next_ucode_from_buffer_am
 
     *offset = off + mpbuf->len + 8;
 
+    printk(KERN_DEBUG "microcode: CPU%d size %zu, block size %u offset %zu equivID %#x rev %#x\n",
+           raw_smp_processor_id(), bufsize, mpbuf->len, off,
+           ((struct microcode_header_amd *)mc_amd->mpb)->processor_rev_id,
+           ((struct microcode_header_amd *)mc_amd->mpb)->patch_id);
+
     return 0;
 }
 
@@ -246,23 +245,20 @@ static int install_equiv_cpu_table(
 
     if ( mpbuf->type != UCODE_EQUIV_CPU_TABLE_TYPE )
     {
-        printk(KERN_ERR "microcode: error! "
-               "Wrong microcode equivalent cpu table type field\n");
+        printk(KERN_ERR "microcode: Wrong microcode equivalent cpu table type field\n");
         return -EINVAL;
     }
 
     if ( mpbuf->len == 0 )
     {
-        printk(KERN_ERR "microcode: error! "
-               "Wrong microcode equivalent cpu table length\n");
+        printk(KERN_ERR "microcode: Wrong microcode equivalent cpu table length\n");
         return -EINVAL;
     }
 
     mc_amd->equiv_cpu_table = xmalloc_bytes(mpbuf->len);
     if ( !mc_amd->equiv_cpu_table )
     {
-        printk(KERN_ERR "microcode: error! "
-               "Can not allocate memory for equivalent cpu table\n");
+        printk(KERN_ERR "microcode: Cannot allocate memory for equivalent cpu table\n");
         return -ENOMEM;
     }
 
@@ -278,8 +274,8 @@ static int cpu_request_microcode(int cpu
 {
     struct microcode_amd *mc_amd, *mc_old;
     size_t offset = bufsize;
+    size_t last_offset, applied_offset = 0;
     int error = 0;
-    int ret;
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
 
     /* We should bind the task to the CPU */
@@ -287,8 +283,7 @@ static int cpu_request_microcode(int cpu
 
     if ( *(const uint32_t *)buf != UCODE_MAGIC )
     {
-        printk(KERN_ERR "microcode: error! Wrong "
-               "microcode patch file magic\n");
+        printk(KERN_ERR "microcode: Wrong microcode patch file magic\n");
         error = -EINVAL;
         goto out;
     }
@@ -296,8 +291,7 @@ static int cpu_request_microcode(int cpu
     mc_amd = xmalloc(struct microcode_amd);
     if ( !mc_amd )
     {
-        printk(KERN_ERR "microcode: error! "
-               "Can not allocate memory for microcode patch\n");
+        printk(KERN_ERR "microcode: Cannot allocate memory for microcode patch\n");
         error = -ENOMEM;
         goto out;
     }
@@ -321,33 +315,38 @@ static int cpu_request_microcode(int cpu
      */
     mc_amd->mpb = NULL;
     mc_amd->mpb_size = 0;
-    while ( (ret = get_next_ucode_from_buffer_amd(mc_amd, buf, bufsize,
-                                                  &offset)) == 0 )
+    last_offset = offset;
+    while ( (error = get_ucode_from_buffer_amd(mc_amd, buf, bufsize,
+                                               &offset)) == 0 )
     {
-        error = microcode_fits(mc_amd, cpu);
-        if (error <= 0)
-            continue;
+        if ( microcode_fits(mc_amd, cpu) )
+        {
+            error = apply_microcode(cpu);
+            if ( error )
+                break;
+            applied_offset = last_offset;
+        }
 
-        error = apply_microcode(cpu);
-        if (error == 0)
-        {
-            error = 1;
+        last_offset = offset;
+
+        if ( offset >= bufsize )
             break;
-        }
     }
 
-    if ( ret < 0 )
-        error = ret;
-
     /* On success keep the microcode patch for
      * re-apply on resume.
      */
-    if ( error == 1 )
+    if ( applied_offset )
     {
-        xfree(mc_old);
-        error = 0;
+        int ret = get_ucode_from_buffer_amd(mc_amd, buf, bufsize,
+                                            &applied_offset);
+        if ( ret == 0 )
+            xfree(mc_old);
+        else
+            error = ret;
     }
-    else
+
+    if ( !applied_offset || error )
     {
         xfree(mc_amd);
         uci->mc.mc_amd = mc_old;
@@ -356,6 +355,12 @@ static int cpu_request_microcode(int cpu
   out:
     svm_host_osvw_init();
 
+    /*
+     * In some cases we may return an error even if processor's microcode has
+     * been updated. For example, the first patch in a container file is loaded
+     * successfully but subsequent container file processing encounters a
+     * failure.
+     */
     return error;
 }
 
@@ -364,10 +369,9 @@ static int microcode_resume_match(int cp
     struct ucode_cpu_info *uci = &per_cpu(ucode_cpu_info, cpu);
     struct microcode_amd *mc_amd = uci->mc.mc_amd;
     const struct microcode_amd *src = mc;
-    int res = microcode_fits(src, cpu);
 
-    if ( res <= 0 )
-        return res;
+    if ( !microcode_fits(src, cpu) )
+        return 0;
 
     if ( src != mc_amd )
     {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 00:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiabU-0002vJ-Ok; Wed, 12 Dec 2012 00:55:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabS-0002v3-Ir
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:14 +0000
Received: from [85.158.143.99:43196] by server-1.bemta-4.messagelabs.com id
	C8/BA-28401-1F5D7C05; Wed, 12 Dec 2012 00:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1355273711!19304820!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21807 invoked from network); 12 Dec 2012 00:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 00:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabP-00016V-0H
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabO-0007GN-C5
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:10 +0000
Message-Id: <E1TiabO-0007GN-C5@xenbits.xen.org>
Date: Wed, 12 Dec 2012 00:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: frame table related improvements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355230073 -3600
# Node ID 1a329da132f46ec7753a68a67ad85f6cb18ea2cc
# Parent  03cb71bc32f95b4029843e0254b4448e0c6a817a
x86: frame table related improvements

- fix super page frame table setup for memory hotplug case (should
  create full table, or else the hotplug code would need to do the
  necessary table population)
- simplify super page frame table setup (can re-use frame table setup
  code)
- slightly streamline frame table setup code
- fix (tighten) a BUG_ON() and an ASSERT() condition
- fix spage <-> pdx conversion macros (they had no users so far, and
  hence no-one noticed how broken they were)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 03cb71bc32f9 -r 1a329da132f4 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Mon Dec 10 11:16:17 2012 +0000
+++ b/xen/arch/x86/mm.c	Tue Dec 11 13:47:53 2012 +0100
@@ -182,28 +182,6 @@ static uint32_t base_disallow_mask;
       !is_hvm_domain(d)) ?                                      \
      L1_DISALLOW_MASK : (L1_DISALLOW_MASK & ~PAGE_CACHE_ATTRS))
 
-static void __init init_spagetable(void)
-{
-    unsigned long s, start = SPAGETABLE_VIRT_START;
-    unsigned long end = SPAGETABLE_VIRT_END;
-    unsigned long step, mfn;
-    unsigned int max_entries;
-
-    step = 1UL << PAGETABLE_ORDER;
-    max_entries = (max_pdx + ((1UL<<SUPERPAGE_ORDER)-1)) >> SUPERPAGE_ORDER;
-    end = start + (((max_entries * sizeof(*spage_table)) +
-                    ((1UL<<SUPERPAGE_SHIFT)-1)) & (~((1UL<<SUPERPAGE_SHIFT)-1)));
-
-    for (s = start; s < end; s += step << PAGE_SHIFT)
-    {
-        mfn = alloc_boot_pages(step, step);
-        if ( !mfn )
-            panic("Not enough memory for spage table");
-        map_pages_to_xen(s, mfn, step, PAGE_HYPERVISOR);
-    }
-    memset((void *)start, 0, end - start);
-}
-
 static void __init init_frametable_chunk(void *start, void *end)
 {
     unsigned long s = (unsigned long)start;
@@ -232,15 +210,25 @@ static void __init init_frametable_chunk
     }
 
     memset(start, 0, end - start);
-    memset(end, -1, s - (unsigned long)end);
+    memset(end, -1, s - e);
+}
+
+static void __init init_spagetable(void)
+{
+    BUILD_BUG_ON(XEN_VIRT_END > SPAGETABLE_VIRT_START);
+
+    init_frametable_chunk(spage_table,
+                          mem_hotplug ? (void *)SPAGETABLE_VIRT_END
+                                      : pdx_to_spage(max_pdx - 1) + 1);
 }
 
 void __init init_frametable(void)
 {
     unsigned int sidx, eidx, nidx;
     unsigned int max_idx = (max_pdx + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT;
-
-    BUILD_BUG_ON(XEN_VIRT_END > FRAMETABLE_VIRT_END);
+    struct page_info *end_pg, *top_pg;
+
+    BUILD_BUG_ON(XEN_VIRT_END > FRAMETABLE_VIRT_START);
     BUILD_BUG_ON(FRAMETABLE_VIRT_START & ((1UL << L2_PAGETABLE_SHIFT) - 1));
 
     for ( sidx = 0; ; sidx = nidx )
@@ -252,17 +240,13 @@ void __init init_frametable(void)
         init_frametable_chunk(pdx_to_page(sidx * PDX_GROUP_COUNT),
                               pdx_to_page(eidx * PDX_GROUP_COUNT));
     }
-    if ( !mem_hotplug )
-        init_frametable_chunk(pdx_to_page(sidx * PDX_GROUP_COUNT),
-                              pdx_to_page(max_pdx - 1) + 1);
-    else
-    {
-        init_frametable_chunk(pdx_to_page(sidx * PDX_GROUP_COUNT),
-                              pdx_to_page(max_idx * PDX_GROUP_COUNT - 1) + 1);
-        memset(pdx_to_page(max_pdx), -1,
-               (unsigned long)pdx_to_page(max_idx * PDX_GROUP_COUNT) -
-               (unsigned long)pdx_to_page(max_pdx));
-    }
+
+    end_pg = pdx_to_page(max_pdx - 1) + 1;
+    top_pg = mem_hotplug ? pdx_to_page(max_idx * PDX_GROUP_COUNT - 1) + 1
+                         : end_pg;
+    init_frametable_chunk(pdx_to_page(sidx * PDX_GROUP_COUNT), top_pg);
+    memset(end_pg, -1, (unsigned long)top_pg - (unsigned long)end_pg);
+
     if (opt_allow_superpage)
         init_spagetable();
 }
diff -r 03cb71bc32f9 -r 1a329da132f4 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Mon Dec 10 11:16:17 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Tue Dec 11 13:47:53 2012 +0100
@@ -301,7 +301,7 @@ static inline struct page_info *__virt_t
 
 static inline void *__page_to_virt(const struct page_info *pg)
 {
-    ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < FRAMETABLE_VIRT_END);
+    ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < FRAMETABLE_SIZE);
     /*
      * (sizeof(*pg) & -sizeof(*pg)) selects the LS bit of sizeof(*pg). The
      * division and re-multiplication avoids one shift when sizeof(*pg) is a
diff -r 03cb71bc32f9 -r 1a329da132f4 xen/include/asm-x86/x86_64/page.h
--- a/xen/include/asm-x86/x86_64/page.h	Mon Dec 10 11:16:17 2012 +0000
+++ b/xen/include/asm-x86/x86_64/page.h	Tue Dec 11 13:47:53 2012 +0100
@@ -46,8 +46,8 @@ extern void pfn_pdx_hole_setup(unsigned 
 
 #define page_to_pdx(pg)  ((pg) - frame_table)
 #define pdx_to_page(pdx) (frame_table + (pdx))
-#define spage_to_pdx(spg) ((spg>>(SUPERPAGE_SHIFT-PAGE_SHIFT)) - spage_table)
-#define pdx_to_spage(pdx) (spage_table + ((pdx)<<(SUPERPAGE_SHIFT-PAGE_SHIFT)))
+#define spage_to_pdx(spg) (((spg) - spage_table)<<(SUPERPAGE_SHIFT-PAGE_SHIFT))
+#define pdx_to_spage(pdx) (spage_table + ((pdx)>>(SUPERPAGE_SHIFT-PAGE_SHIFT)))
 /*
  * Note: These are solely for the use by page_{get,set}_owner(), and
  *       therefore don't need to handle the XEN_VIRT_{START,END} range.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 00:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiabU-0002vJ-Ok; Wed, 12 Dec 2012 00:55:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabS-0002v3-Ir
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:14 +0000
Received: from [85.158.143.99:43196] by server-1.bemta-4.messagelabs.com id
	C8/BA-28401-1F5D7C05; Wed, 12 Dec 2012 00:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1355273711!19304820!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21807 invoked from network); 12 Dec 2012 00:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 00:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabP-00016V-0H
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiabO-0007GN-C5
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 00:55:10 +0000
Message-Id: <E1TiabO-0007GN-C5@xenbits.xen.org>
Date: Wed, 12 Dec 2012 00:55:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: frame table related improvements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355230073 -3600
# Node ID 1a329da132f46ec7753a68a67ad85f6cb18ea2cc
# Parent  03cb71bc32f95b4029843e0254b4448e0c6a817a
x86: frame table related improvements

- fix super page frame table setup for memory hotplug case (should
  create full table, or else the hotplug code would need to do the
  necessary table population)
- simplify super page frame table setup (can re-use frame table setup
  code)
- slightly streamline frame table setup code
- fix (tighten) a BUG_ON() and an ASSERT() condition
- fix spage <-> pdx conversion macros (they had no users so far, and
  hence no-one noticed how broken they were)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 03cb71bc32f9 -r 1a329da132f4 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Mon Dec 10 11:16:17 2012 +0000
+++ b/xen/arch/x86/mm.c	Tue Dec 11 13:47:53 2012 +0100
@@ -182,28 +182,6 @@ static uint32_t base_disallow_mask;
       !is_hvm_domain(d)) ?                                      \
      L1_DISALLOW_MASK : (L1_DISALLOW_MASK & ~PAGE_CACHE_ATTRS))
 
-static void __init init_spagetable(void)
-{
-    unsigned long s, start = SPAGETABLE_VIRT_START;
-    unsigned long end = SPAGETABLE_VIRT_END;
-    unsigned long step, mfn;
-    unsigned int max_entries;
-
-    step = 1UL << PAGETABLE_ORDER;
-    max_entries = (max_pdx + ((1UL<<SUPERPAGE_ORDER)-1)) >> SUPERPAGE_ORDER;
-    end = start + (((max_entries * sizeof(*spage_table)) +
-                    ((1UL<<SUPERPAGE_SHIFT)-1)) & (~((1UL<<SUPERPAGE_SHIFT)-1)));
-
-    for (s = start; s < end; s += step << PAGE_SHIFT)
-    {
-        mfn = alloc_boot_pages(step, step);
-        if ( !mfn )
-            panic("Not enough memory for spage table");
-        map_pages_to_xen(s, mfn, step, PAGE_HYPERVISOR);
-    }
-    memset((void *)start, 0, end - start);
-}
-
 static void __init init_frametable_chunk(void *start, void *end)
 {
     unsigned long s = (unsigned long)start;
@@ -232,15 +210,25 @@ static void __init init_frametable_chunk
     }
 
     memset(start, 0, end - start);
-    memset(end, -1, s - (unsigned long)end);
+    memset(end, -1, s - e);
+}
+
+static void __init init_spagetable(void)
+{
+    BUILD_BUG_ON(XEN_VIRT_END > SPAGETABLE_VIRT_START);
+
+    init_frametable_chunk(spage_table,
+                          mem_hotplug ? (void *)SPAGETABLE_VIRT_END
+                                      : pdx_to_spage(max_pdx - 1) + 1);
 }
 
 void __init init_frametable(void)
 {
     unsigned int sidx, eidx, nidx;
     unsigned int max_idx = (max_pdx + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT;
-
-    BUILD_BUG_ON(XEN_VIRT_END > FRAMETABLE_VIRT_END);
+    struct page_info *end_pg, *top_pg;
+
+    BUILD_BUG_ON(XEN_VIRT_END > FRAMETABLE_VIRT_START);
     BUILD_BUG_ON(FRAMETABLE_VIRT_START & ((1UL << L2_PAGETABLE_SHIFT) - 1));
 
     for ( sidx = 0; ; sidx = nidx )
@@ -252,17 +240,13 @@ void __init init_frametable(void)
         init_frametable_chunk(pdx_to_page(sidx * PDX_GROUP_COUNT),
                               pdx_to_page(eidx * PDX_GROUP_COUNT));
     }
-    if ( !mem_hotplug )
-        init_frametable_chunk(pdx_to_page(sidx * PDX_GROUP_COUNT),
-                              pdx_to_page(max_pdx - 1) + 1);
-    else
-    {
-        init_frametable_chunk(pdx_to_page(sidx * PDX_GROUP_COUNT),
-                              pdx_to_page(max_idx * PDX_GROUP_COUNT - 1) + 1);
-        memset(pdx_to_page(max_pdx), -1,
-               (unsigned long)pdx_to_page(max_idx * PDX_GROUP_COUNT) -
-               (unsigned long)pdx_to_page(max_pdx));
-    }
+
+    end_pg = pdx_to_page(max_pdx - 1) + 1;
+    top_pg = mem_hotplug ? pdx_to_page(max_idx * PDX_GROUP_COUNT - 1) + 1
+                         : end_pg;
+    init_frametable_chunk(pdx_to_page(sidx * PDX_GROUP_COUNT), top_pg);
+    memset(end_pg, -1, (unsigned long)top_pg - (unsigned long)end_pg);
+
     if (opt_allow_superpage)
         init_spagetable();
 }
diff -r 03cb71bc32f9 -r 1a329da132f4 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Mon Dec 10 11:16:17 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Tue Dec 11 13:47:53 2012 +0100
@@ -301,7 +301,7 @@ static inline struct page_info *__virt_t
 
 static inline void *__page_to_virt(const struct page_info *pg)
 {
-    ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < FRAMETABLE_VIRT_END);
+    ASSERT((unsigned long)pg - FRAMETABLE_VIRT_START < FRAMETABLE_SIZE);
     /*
      * (sizeof(*pg) & -sizeof(*pg)) selects the LS bit of sizeof(*pg). The
      * division and re-multiplication avoids one shift when sizeof(*pg) is a
diff -r 03cb71bc32f9 -r 1a329da132f4 xen/include/asm-x86/x86_64/page.h
--- a/xen/include/asm-x86/x86_64/page.h	Mon Dec 10 11:16:17 2012 +0000
+++ b/xen/include/asm-x86/x86_64/page.h	Tue Dec 11 13:47:53 2012 +0100
@@ -46,8 +46,8 @@ extern void pfn_pdx_hole_setup(unsigned 
 
 #define page_to_pdx(pg)  ((pg) - frame_table)
 #define pdx_to_page(pdx) (frame_table + (pdx))
-#define spage_to_pdx(spg) ((spg>>(SUPERPAGE_SHIFT-PAGE_SHIFT)) - spage_table)
-#define pdx_to_spage(pdx) (spage_table + ((pdx)<<(SUPERPAGE_SHIFT-PAGE_SHIFT)))
+#define spage_to_pdx(spg) (((spg) - spage_table)<<(SUPERPAGE_SHIFT-PAGE_SHIFT))
+#define pdx_to_spage(pdx) (spage_table + ((pdx)>>(SUPERPAGE_SHIFT-PAGE_SHIFT)))
 /*
  * Note: These are solely for the use by page_{get,set}_owner(), and
  *       therefore don't need to handle the XEN_VIRT_{START,END} range.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 06:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 06:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TifXF-0001XU-51; Wed, 12 Dec 2012 06:11:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TifXE-0001XM-0Q
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 06:11:12 +0000
Received: from [193.109.254.147:56610] by server-4.bemta-14.messagelabs.com id
	58/24-15233-FFF18C05; Wed, 12 Dec 2012 06:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1355292669!2879470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23843 invoked from network); 12 Dec 2012 06:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 06:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TifXB-00032t-EE
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 06:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TifXB-00073v-5u
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 06:11:09 +0000
Message-Id: <E1TifXB-00073v-5u@xenbits.xen.org>
Date: Wed, 12 Dec 2012 06:11:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355242001 0
# Node ID e32c114016f712e2a7776f5b0eb4e96f836f1d9f
# Parent  1206a35266733ee3dcca1a9f4d341a4b98d1e49d
QEMU_TAG update
---


diff -r 1206a3526673 -r e32c114016f7 Config.mk
--- a/Config.mk	Thu Dec 06 11:11:58 2012 +0100
+++ b/Config.mk	Tue Dec 11 16:06:41 2012 +0000
@@ -214,7 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.1-rc1
+QEMU_TAG ?= xen-4.2.1-rc2
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 06:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 06:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TifXF-0001XU-51; Wed, 12 Dec 2012 06:11:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TifXE-0001XM-0Q
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 06:11:12 +0000
Received: from [193.109.254.147:56610] by server-4.bemta-14.messagelabs.com id
	58/24-15233-FFF18C05; Wed, 12 Dec 2012 06:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1355292669!2879470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23843 invoked from network); 12 Dec 2012 06:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 06:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TifXB-00032t-EE
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 06:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TifXB-00073v-5u
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 06:11:09 +0000
Message-Id: <E1TifXB-00073v-5u@xenbits.xen.org>
Date: Wed, 12 Dec 2012 06:11:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355242001 0
# Node ID e32c114016f712e2a7776f5b0eb4e96f836f1d9f
# Parent  1206a35266733ee3dcca1a9f4d341a4b98d1e49d
QEMU_TAG update
---


diff -r 1206a3526673 -r e32c114016f7 Config.mk
--- a/Config.mk	Thu Dec 06 11:11:58 2012 +0100
+++ b/Config.mk	Tue Dec 11 16:06:41 2012 +0000
@@ -214,7 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.1-rc1
+QEMU_TAG ?= xen-4.2.1-rc2
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 19:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 19:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TisOf-00084o-R1; Wed, 12 Dec 2012 19:55:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOf-00084h-8P
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:13 +0000
Received: from [85.158.143.99:16785] by server-3.bemta-4.messagelabs.com id
	D8/E6-18211-021E8C05; Wed, 12 Dec 2012 19:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1355342110!29087002!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22062 invoked from network); 12 Dec 2012 19:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 19:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOc-0004dm-DO
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOc-0003cw-0V
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:10 +0000
Message-Id: <E1TisOc-0003cw-0V@xenbits.xen.org>
Date: Wed, 12 Dec 2012 19:55:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] update Xen version to 4.2.1-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355302766 -3600
# Node ID bfa4df1dbe1dac55428437184f811d174d806755
# Parent  e32c114016f712e2a7776f5b0eb4e96f836f1d9f
update Xen version to 4.2.1-rc2
---


diff -r e32c114016f7 -r bfa4df1dbe1d xen/Makefile
--- a/xen/Makefile	Tue Dec 11 16:06:41 2012 +0000
+++ b/xen/Makefile	Wed Dec 12 09:59:26 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .1-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 19:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 19:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TisOf-00084o-R1; Wed, 12 Dec 2012 19:55:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOf-00084h-8P
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:13 +0000
Received: from [85.158.143.99:16785] by server-3.bemta-4.messagelabs.com id
	D8/E6-18211-021E8C05; Wed, 12 Dec 2012 19:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1355342110!29087002!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22062 invoked from network); 12 Dec 2012 19:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 19:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOc-0004dm-DO
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOc-0003cw-0V
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:10 +0000
Message-Id: <E1TisOc-0003cw-0V@xenbits.xen.org>
Date: Wed, 12 Dec 2012 19:55:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] update Xen version to 4.2.1-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355302766 -3600
# Node ID bfa4df1dbe1dac55428437184f811d174d806755
# Parent  e32c114016f712e2a7776f5b0eb4e96f836f1d9f
update Xen version to 4.2.1-rc2
---


diff -r e32c114016f7 -r bfa4df1dbe1d xen/Makefile
--- a/xen/Makefile	Tue Dec 11 16:06:41 2012 +0000
+++ b/xen/Makefile	Wed Dec 12 09:59:26 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .1-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 19:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 19:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TisOi-00085N-2f; Wed, 12 Dec 2012 19:55:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOh-00084z-BY
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:15 +0000
Received: from [85.158.139.211:35161] by server-1.bemta-5.messagelabs.com id
	1C/F1-12813-221E8C05; Wed, 12 Dec 2012 19:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1355342112!20266842!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15706 invoked from network); 12 Dec 2012 19:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 19:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOe-0004dv-Ec
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOe-0003df-6u
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:12 +0000
Message-Id: <E1TisOe-0003df-6u@xenbits.xen.org>
Date: Wed, 12 Dec 2012 19:55:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: properly fail mmuext ops
	when get_page_from_gfn() fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355307511 -3600
# Node ID 2959e32561384f99603ae8a8d873c8c32e58b624
# Parent  506c772aa77a707ba178eb8bda36fbde50d38c51
x86: properly fail mmuext ops when get_page_from_gfn() fails

I noticed this inconsistency while analyzing the code for XSA-32.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26260:e80bac7c6598
xen-unstable date: Fri Dec  7 12:40:46 UTC 2012
---


diff -r 506c772aa77a -r 2959e3256138 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Dec 12 09:39:55 2012 +0000
+++ b/xen/arch/x86/mm.c	Wed Dec 12 11:18:31 2012 +0100
@@ -3070,7 +3070,7 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
-                rc = -EINVAL;
+                okay = 0;
                 break;
             }
 
@@ -3130,6 +3130,7 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
+                okay = 0;
                 MEM_LOG("Mfn %lx bad domain", op.arg1.mfn);
                 break;
             }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 19:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 19:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TisOi-00085N-2f; Wed, 12 Dec 2012 19:55:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOh-00084z-BY
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:15 +0000
Received: from [85.158.139.211:35161] by server-1.bemta-5.messagelabs.com id
	1C/F1-12813-221E8C05; Wed, 12 Dec 2012 19:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-206.messagelabs.com!1355342112!20266842!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15706 invoked from network); 12 Dec 2012 19:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 19:55:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOe-0004dv-Ec
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOe-0003df-6u
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:12 +0000
Message-Id: <E1TisOe-0003df-6u@xenbits.xen.org>
Date: Wed, 12 Dec 2012 19:55:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86: properly fail mmuext ops
	when get_page_from_gfn() fails
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355307511 -3600
# Node ID 2959e32561384f99603ae8a8d873c8c32e58b624
# Parent  506c772aa77a707ba178eb8bda36fbde50d38c51
x86: properly fail mmuext ops when get_page_from_gfn() fails

I noticed this inconsistency while analyzing the code for XSA-32.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26260:e80bac7c6598
xen-unstable date: Fri Dec  7 12:40:46 UTC 2012
---


diff -r 506c772aa77a -r 2959e3256138 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Wed Dec 12 09:39:55 2012 +0000
+++ b/xen/arch/x86/mm.c	Wed Dec 12 11:18:31 2012 +0100
@@ -3070,7 +3070,7 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
-                rc = -EINVAL;
+                okay = 0;
                 break;
             }
 
@@ -3130,6 +3130,7 @@ long do_mmuext_op(
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
             if ( unlikely(!page) )
             {
+                okay = 0;
                 MEM_LOG("Mfn %lx bad domain", op.arg1.mfn);
                 break;
             }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 19:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 19:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TisOh-00085D-TZ; Wed, 12 Dec 2012 19:55:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOg-00084t-LN
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:14 +0000
Received: from [85.158.143.35:16573] by server-2.bemta-4.messagelabs.com id
	4D/FB-30861-121E8C05; Wed, 12 Dec 2012 19:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1355342111!14542125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8160 invoked from network); 12 Dec 2012 19:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 19:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOd-0004dp-0O
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOc-0003dB-OP
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:10 +0000
Message-Id: <E1TisOc-0003dB-OP@xenbits.xen.org>
Date: Wed, 12 Dec 2012 19:55:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag 4.2.1-rc2 for changeset
	bfa4df1dbe1d
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355302922 -3600
# Node ID 5289b9e032a4d5091c062543b7ca31abf01769a4
# Parent  bfa4df1dbe1dac55428437184f811d174d806755
Added tag 4.2.1-rc2 for changeset bfa4df1dbe1d
---


diff -r bfa4df1dbe1d -r 5289b9e032a4 .hgtags
--- a/.hgtags	Wed Dec 12 09:59:26 2012 +0100
+++ b/.hgtags	Wed Dec 12 10:02:02 2012 +0100
@@ -60,3 +60,4 @@ 528f0708b6db392e10303b7ed2ab529bb8b512b7
 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 4.2.0-rc5
 af176624c3ae86141a4ad8617b5ec2a834a6c626 RELEASE-4.2.0
 b6f071324f5ed076bfd28c71b51521cdd38639ab 4.2.1-rc1
+bfa4df1dbe1dac55428437184f811d174d806755 4.2.1-rc2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 19:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 19:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TisOh-00085D-TZ; Wed, 12 Dec 2012 19:55:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOg-00084t-LN
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:14 +0000
Received: from [85.158.143.35:16573] by server-2.bemta-4.messagelabs.com id
	4D/FB-30861-121E8C05; Wed, 12 Dec 2012 19:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1355342111!14542125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8160 invoked from network); 12 Dec 2012 19:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 19:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOd-0004dp-0O
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOc-0003dB-OP
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:10 +0000
Message-Id: <E1TisOc-0003dB-OP@xenbits.xen.org>
Date: Wed, 12 Dec 2012 19:55:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag 4.2.1-rc2 for changeset
	bfa4df1dbe1d
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355302922 -3600
# Node ID 5289b9e032a4d5091c062543b7ca31abf01769a4
# Parent  bfa4df1dbe1dac55428437184f811d174d806755
Added tag 4.2.1-rc2 for changeset bfa4df1dbe1d
---


diff -r bfa4df1dbe1d -r 5289b9e032a4 .hgtags
--- a/.hgtags	Wed Dec 12 09:59:26 2012 +0100
+++ b/.hgtags	Wed Dec 12 10:02:02 2012 +0100
@@ -60,3 +60,4 @@ 528f0708b6db392e10303b7ed2ab529bb8b512b7
 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 4.2.0-rc5
 af176624c3ae86141a4ad8617b5ec2a834a6c626 RELEASE-4.2.0
 b6f071324f5ed076bfd28c71b51521cdd38639ab 4.2.1-rc1
+bfa4df1dbe1dac55428437184f811d174d806755 4.2.1-rc2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 19:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 19:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TisOi-00085I-0I; Wed, 12 Dec 2012 19:55:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOg-00084u-Mt
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:14 +0000
Received: from [193.109.254.147:58961] by server-1.bemta-14.messagelabs.com id
	61/8C-15901-121E8C05; Wed, 12 Dec 2012 19:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1355342112!2533955!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26518 invoked from network); 12 Dec 2012 19:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 19:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOd-0004ds-Ol
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOd-0003dQ-E8
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:11 +0000
Message-Id: <E1TisOd-0003dQ-E8@xenbits.xen.org>
Date: Wed, 12 Dec 2012 19:55:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added signature for changeset
	bfa4df1dbe1d
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1355305195 0
# Node ID 506c772aa77a707ba178eb8bda36fbde50d38c51
# Parent  5289b9e032a4d5091c062543b7ca31abf01769a4
Added signature for changeset bfa4df1dbe1d
---


diff -r 5289b9e032a4 -r 506c772aa77a .hgsigs
--- a/.hgsigs	Wed Dec 12 10:02:02 2012 +0100
+++ b/.hgsigs	Wed Dec 12 09:39:55 2012 +0000
@@ -12,3 +12,4 @@ 68640a3c99cefa86ae70fc49871025864e5671f2
 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 0 iQEcBAABAgAGBQJQUcGjAAoJEIP+FMlX6CvZvX4H/1QV1VSW//dsv8IVCHPnHO4njlqYNUgIRycS4EuCJ8SrFLgfR77y3DwJg1D+JrYIT80QfzNeU3g/bcqz+0koD/P7joV4ONFkrB7pHSfACmMY7nfQ1Z2qHePAfBQ+cVdx6rXEYkFAbPjOz6kAP3LmpRLPasU46H+oG1zKHRgc0uhNN3Vit7eIhx/hDvY2YZDjuIWCQpmJylRlJsvMbpk2CjLiy4nXMNTKd1nlTNPTuRISsVBLx/ToquWtiO2a2EVRE4E+JhRGHNdFwXBRfV1XDDVNNRj+SvDvyWs29WKEOfVyGpgAKd29j/5YPzuHqmCcCfNxuN6lDHL6NxtwjZdDJao=
 af176624c3ae86141a4ad8617b5ec2a834a6c626 0 iQEcBAABAgAGBQJQVt5zAAoJEIP+FMlX6CvZ2q4H/2eEMxgwzflIPj88Y/jE1z8dTJ8E2l2FTBziMlmFYkmsiqx+BlGz9kk610DQo4mJoHrRSZOcZX0/NNUuCZntRizEorBQUcBEOBJQgTLzaxatPR49W5N7gOgqwNuWplKV0Aor7X0qX+wFZ4kZdBuqOimV7Mw43L1LsskcuDmqi8Ipvbf+JjnRPXpeTlxBOD+52ZhAirxvpA+LZfLIIYV9lx3SB7z7okxlBS+rlyL+h9cuwthWO3545QPlwXcSBY9r9m9/5ZtAiID5935JDdZGd7Dt/ZmikVs9xE6QHrHmWZFDfqgGPOmYFmVhJxk1xwwUbor3qaiUjTwfjM+zAIqtNv4=
 b6f071324f5ed076bfd28c71b51521cdd38639ab 0 iQEcBAABAgAGBQJQpLjpAAoJEIP+FMlX6CvZs2EIAM1HO25BnOPvo3fVjDErNnLo6miyentoLWJpXiDrJb+QRwuNVNGAQN0vlfd2iHcuvC9ipR1iFUizFcO1TI/wYoIOYOxs/r9Yk9cnBRThC7+yoBhCZY/LAbbd6SazEzI/86ZrMPbT4kfL8BD652UP1o9HCHgbFYDLzRMZTtep4+mA1OXCUWto4QjAJn+/SCQKI5kJXdLaj6JDS40kQoDXMlcTKu0NlftFT3zSA+U/SnOrRFwxW7uTxM09yyRLs/a/LbRcmYjeCnKUlvh8uapi5878Gxf5Bpo3XINKFsxC6p7nKF0wHzAqm63sB+o7C4fIvNY0nnWi5e7FDir+CO2yIKE=
+bfa4df1dbe1dac55428437184f811d174d806755 0 iQEcBAABAgAGBQJQyFDqAAoJEIP+FMlX6CvZcUMIAMOChtmvuIBpWhuIJofsMp4C8TDQoI2idc3s6K1OvL5YgWrcaRoqLW4C4ItyEvx0xe19GUAoqdXUkj9tQ9fwT/p6dzLIGPRnACjKs8uTopiGulFdXu6b80IK3xwG3rAjC/yz7nU6ohQpWZJQCL1CyaIPr7MEYI905luiKC18WSc+hJADKGBdTIvLgKAD7GtQkAjPq8GrrGUtEE6rwawhl9R+jQLWkRf2ucbqgtDEzNCmSICkgjK2Sudc6h+mcKX7r0s3eEEiSh0SmhR+6K3mCYicaWCxn4A/La8CKabU3jdP/+EKjnk8x/6DFqXATf3ijr1kP/ZlHnbnxpPp7UwAhho=

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 19:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 19:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TisOi-00085I-0I; Wed, 12 Dec 2012 19:55:16 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOg-00084u-Mt
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:14 +0000
Received: from [193.109.254.147:58961] by server-1.bemta-14.messagelabs.com id
	61/8C-15901-121E8C05; Wed, 12 Dec 2012 19:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1355342112!2533955!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26518 invoked from network); 12 Dec 2012 19:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 19:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOd-0004ds-Ol
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOd-0003dQ-E8
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:11 +0000
Message-Id: <E1TisOd-0003dQ-E8@xenbits.xen.org>
Date: Wed, 12 Dec 2012 19:55:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added signature for changeset
	bfa4df1dbe1d
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1355305195 0
# Node ID 506c772aa77a707ba178eb8bda36fbde50d38c51
# Parent  5289b9e032a4d5091c062543b7ca31abf01769a4
Added signature for changeset bfa4df1dbe1d
---


diff -r 5289b9e032a4 -r 506c772aa77a .hgsigs
--- a/.hgsigs	Wed Dec 12 10:02:02 2012 +0100
+++ b/.hgsigs	Wed Dec 12 09:39:55 2012 +0000
@@ -12,3 +12,4 @@ 68640a3c99cefa86ae70fc49871025864e5671f2
 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8 0 iQEcBAABAgAGBQJQUcGjAAoJEIP+FMlX6CvZvX4H/1QV1VSW//dsv8IVCHPnHO4njlqYNUgIRycS4EuCJ8SrFLgfR77y3DwJg1D+JrYIT80QfzNeU3g/bcqz+0koD/P7joV4ONFkrB7pHSfACmMY7nfQ1Z2qHePAfBQ+cVdx6rXEYkFAbPjOz6kAP3LmpRLPasU46H+oG1zKHRgc0uhNN3Vit7eIhx/hDvY2YZDjuIWCQpmJylRlJsvMbpk2CjLiy4nXMNTKd1nlTNPTuRISsVBLx/ToquWtiO2a2EVRE4E+JhRGHNdFwXBRfV1XDDVNNRj+SvDvyWs29WKEOfVyGpgAKd29j/5YPzuHqmCcCfNxuN6lDHL6NxtwjZdDJao=
 af176624c3ae86141a4ad8617b5ec2a834a6c626 0 iQEcBAABAgAGBQJQVt5zAAoJEIP+FMlX6CvZ2q4H/2eEMxgwzflIPj88Y/jE1z8dTJ8E2l2FTBziMlmFYkmsiqx+BlGz9kk610DQo4mJoHrRSZOcZX0/NNUuCZntRizEorBQUcBEOBJQgTLzaxatPR49W5N7gOgqwNuWplKV0Aor7X0qX+wFZ4kZdBuqOimV7Mw43L1LsskcuDmqi8Ipvbf+JjnRPXpeTlxBOD+52ZhAirxvpA+LZfLIIYV9lx3SB7z7okxlBS+rlyL+h9cuwthWO3545QPlwXcSBY9r9m9/5ZtAiID5935JDdZGd7Dt/ZmikVs9xE6QHrHmWZFDfqgGPOmYFmVhJxk1xwwUbor3qaiUjTwfjM+zAIqtNv4=
 b6f071324f5ed076bfd28c71b51521cdd38639ab 0 iQEcBAABAgAGBQJQpLjpAAoJEIP+FMlX6CvZs2EIAM1HO25BnOPvo3fVjDErNnLo6miyentoLWJpXiDrJb+QRwuNVNGAQN0vlfd2iHcuvC9ipR1iFUizFcO1TI/wYoIOYOxs/r9Yk9cnBRThC7+yoBhCZY/LAbbd6SazEzI/86ZrMPbT4kfL8BD652UP1o9HCHgbFYDLzRMZTtep4+mA1OXCUWto4QjAJn+/SCQKI5kJXdLaj6JDS40kQoDXMlcTKu0NlftFT3zSA+U/SnOrRFwxW7uTxM09yyRLs/a/LbRcmYjeCnKUlvh8uapi5878Gxf5Bpo3XINKFsxC6p7nKF0wHzAqm63sB+o7C4fIvNY0nnWi5e7FDir+CO2yIKE=
+bfa4df1dbe1dac55428437184f811d174d806755 0 iQEcBAABAgAGBQJQyFDqAAoJEIP+FMlX6CvZcUMIAMOChtmvuIBpWhuIJofsMp4C8TDQoI2idc3s6K1OvL5YgWrcaRoqLW4C4ItyEvx0xe19GUAoqdXUkj9tQ9fwT/p6dzLIGPRnACjKs8uTopiGulFdXu6b80IK3xwG3rAjC/yz7nU6ohQpWZJQCL1CyaIPr7MEYI905luiKC18WSc+hJADKGBdTIvLgKAD7GtQkAjPq8GrrGUtEE6rwawhl9R+jQLWkRf2ucbqgtDEzNCmSICkgjK2Sudc6h+mcKX7r0s3eEEiSh0SmhR+6K3mCYicaWCxn4A/La8CKabU3jdP/+EKjnk8x/6DFqXATf3ijr1kP/ZlHnbnxpPp7UwAhho=

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 19:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 19:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TisOm-00086g-5C; Wed, 12 Dec 2012 19:55:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOk-00084t-My
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:18 +0000
Received: from [85.158.143.35:20022] by server-2.bemta-4.messagelabs.com id
	36/0C-30861-621E8C05; Wed, 12 Dec 2012 19:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1355342113!5038863!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5261 invoked from network); 12 Dec 2012 19:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 19:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOf-0004dy-EP
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOf-0003du-1j
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:13 +0000
Message-Id: <E1TisOf-0003du-1j@xenbits.xen.org>
Date: Wed, 12 Dec 2012 19:55:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/EFI: work around CFLAGS being
	passed in through environment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Charles Arnold <carnold@suse.com>
# Date 1355307580 -3600
# Node ID 02140822d8335b3d1c7fe8cfc64c777dfec863ea
# Parent  2959e32561384f99603ae8a8d873c8c32e58b624
x86/EFI: work around CFLAGS being passed in through environment

Short of a solution to the problem described in
http://lists.xen.org/archives/html/xen-devel/2012-12/msg00648.html,
deal with the bad effect this together with c/s 25751:02b4d5fedb7b has
on the EFI build by filtering out the problematic command line items.

Signed-off-by: Charles Arnold <carnold@suse.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26272:183fcffb6367
xen-unstable date: Tue Dec 11 12:49:39 UTC 2012
---


diff -r 2959e3256138 -r 02140822d833 xen/arch/x86/efi/Makefile
--- a/xen/arch/x86/efi/Makefile	Wed Dec 12 11:18:31 2012 +0100
+++ b/xen/arch/x86/efi/Makefile	Wed Dec 12 11:19:40 2012 +0100
@@ -5,7 +5,7 @@ obj-y += stub.o
 create = test -e $(1) || touch -t 199901010000 $(1)
 
 efi := $(filter y,$(x86_64)$(shell rm -f disabled))
-efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y),$(CFLAGS)) -c check.c 2>disabled && echo y))
+efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y))
 efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi check.o 2>disabled && echo y))
 efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o)))
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 19:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 19:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TisOm-00086g-5C; Wed, 12 Dec 2012 19:55:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOk-00084t-My
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:18 +0000
Received: from [85.158.143.35:20022] by server-2.bemta-4.messagelabs.com id
	36/0C-30861-621E8C05; Wed, 12 Dec 2012 19:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1355342113!5038863!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5261 invoked from network); 12 Dec 2012 19:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 19:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOf-0004dy-EP
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TisOf-0003du-1j
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 19:55:13 +0000
Message-Id: <E1TisOf-0003du-1j@xenbits.xen.org>
Date: Wed, 12 Dec 2012 19:55:12 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] x86/EFI: work around CFLAGS being
	passed in through environment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Charles Arnold <carnold@suse.com>
# Date 1355307580 -3600
# Node ID 02140822d8335b3d1c7fe8cfc64c777dfec863ea
# Parent  2959e32561384f99603ae8a8d873c8c32e58b624
x86/EFI: work around CFLAGS being passed in through environment

Short of a solution to the problem described in
http://lists.xen.org/archives/html/xen-devel/2012-12/msg00648.html,
deal with the bad effect this together with c/s 25751:02b4d5fedb7b has
on the EFI build by filtering out the problematic command line items.

Signed-off-by: Charles Arnold <carnold@suse.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26272:183fcffb6367
xen-unstable date: Tue Dec 11 12:49:39 UTC 2012
---


diff -r 2959e3256138 -r 02140822d833 xen/arch/x86/efi/Makefile
--- a/xen/arch/x86/efi/Makefile	Wed Dec 12 11:18:31 2012 +0100
+++ b/xen/arch/x86/efi/Makefile	Wed Dec 12 11:19:40 2012 +0100
@@ -5,7 +5,7 @@ obj-y += stub.o
 create = test -e $(1) || touch -t 199901010000 $(1)
 
 efi := $(filter y,$(x86_64)$(shell rm -f disabled))
-efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y),$(CFLAGS)) -c check.c 2>disabled && echo y))
+efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y))
 efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi check.o 2>disabled && echo y))
 efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o)))
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 22:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 22:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tiugw-0002Xw-DO; Wed, 12 Dec 2012 22:22:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugu-0002Xa-IZ
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:12 +0000
Received: from [85.158.139.83:14635] by server-3.bemta-5.messagelabs.com id
	52/E8-25441-39309C05; Wed, 12 Dec 2012 22:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1355350929!28160265!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30741 invoked from network); 12 Dec 2012 22:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 22:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugr-0006QU-GZ
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugr-0007UY-7W
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:09 +0000
Message-Id: <E1Tiugr-0007UY-7W@xenbits.xen.org>
Date: Wed, 12 Dec 2012 22:22:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Added tag 4.1.4-rc2 for changeset
	0125069bc1b2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355303058 -3600
# Node ID e77f613c133ab75f08b2beab4be9919628e918ef
# Parent  0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d
Added tag 4.1.4-rc2 for changeset 0125069bc1b2
---


diff -r 0125069bc1b2 -r e77f613c133a .hgtags
--- a/.hgtags	Wed Dec 12 10:04:02 2012 +0100
+++ b/.hgtags	Wed Dec 12 10:04:18 2012 +0100
@@ -67,3 +67,4 @@ acbd3617691397911f34e4574d03385c08aec900
 5cdcfed7b5b129843e1602b5d43c7651de337092 4.1.3-rc3
 ce7195d2b80e4df9857e434fa29689fd678a2341 RELEASE-4.1.3
 500194a883bdcf77b2a0fc87de291b0c27435207 4.1.4-rc1
+0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d 4.1.4-rc2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 22:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 22:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tiugw-0002Xw-DO; Wed, 12 Dec 2012 22:22:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugu-0002Xa-IZ
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:12 +0000
Received: from [85.158.139.83:14635] by server-3.bemta-5.messagelabs.com id
	52/E8-25441-39309C05; Wed, 12 Dec 2012 22:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1355350929!28160265!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30741 invoked from network); 12 Dec 2012 22:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 22:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugr-0006QU-GZ
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugr-0007UY-7W
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:09 +0000
Message-Id: <E1Tiugr-0007UY-7W@xenbits.xen.org>
Date: Wed, 12 Dec 2012 22:22:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Added tag 4.1.4-rc2 for changeset
	0125069bc1b2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355303058 -3600
# Node ID e77f613c133ab75f08b2beab4be9919628e918ef
# Parent  0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d
Added tag 4.1.4-rc2 for changeset 0125069bc1b2
---


diff -r 0125069bc1b2 -r e77f613c133a .hgtags
--- a/.hgtags	Wed Dec 12 10:04:02 2012 +0100
+++ b/.hgtags	Wed Dec 12 10:04:18 2012 +0100
@@ -67,3 +67,4 @@ acbd3617691397911f34e4574d03385c08aec900
 5cdcfed7b5b129843e1602b5d43c7651de337092 4.1.3-rc3
 ce7195d2b80e4df9857e434fa29689fd678a2341 RELEASE-4.1.3
 500194a883bdcf77b2a0fc87de291b0c27435207 4.1.4-rc1
+0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d 4.1.4-rc2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 22:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 22:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tiugv-0002Xp-Ap; Wed, 12 Dec 2012 22:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugu-0002XZ-3y
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:12 +0000
Received: from [85.158.138.51:45982] by server-11.bemta-3.messagelabs.com id
	CC/0B-13335-29309C05; Wed, 12 Dec 2012 22:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1355350929!20716425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16891 invoked from network); 12 Dec 2012 22:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 22:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugq-0006QR-Q4
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugq-0007UH-Gj
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:08 +0000
Message-Id: <E1Tiugq-0007UH-Gj@xenbits.xen.org>
Date: Wed, 12 Dec 2012 22:22:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] update Xen version to 4.1.4-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355303042 -3600
# Node ID 0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d
# Parent  309ff3ad9dcce7e14fd50a958fff0f691ad8aa6d
update Xen version to 4.1.4-rc2
---


diff -r 309ff3ad9dcc -r 0125069bc1b2 xen/Makefile
--- a/xen/Makefile	Thu Dec 06 11:13:00 2012 +0100
+++ b/xen/Makefile	Wed Dec 12 10:04:02 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .4-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 22:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 22:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tiugv-0002Xp-Ap; Wed, 12 Dec 2012 22:22:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugu-0002XZ-3y
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:12 +0000
Received: from [85.158.138.51:45982] by server-11.bemta-3.messagelabs.com id
	CC/0B-13335-29309C05; Wed, 12 Dec 2012 22:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-174.messagelabs.com!1355350929!20716425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16891 invoked from network); 12 Dec 2012 22:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 22:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugq-0006QR-Q4
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugq-0007UH-Gj
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:08 +0000
Message-Id: <E1Tiugq-0007UH-Gj@xenbits.xen.org>
Date: Wed, 12 Dec 2012 22:22:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] update Xen version to 4.1.4-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355303042 -3600
# Node ID 0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d
# Parent  309ff3ad9dcce7e14fd50a958fff0f691ad8aa6d
update Xen version to 4.1.4-rc2
---


diff -r 309ff3ad9dcc -r 0125069bc1b2 xen/Makefile
--- a/xen/Makefile	Thu Dec 06 11:13:00 2012 +0100
+++ b/xen/Makefile	Wed Dec 12 10:04:02 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .4-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 22:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 22:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tiugw-0002Y3-G8; Wed, 12 Dec 2012 22:22:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugv-0002Xf-0p
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:13 +0000
Received: from [85.158.138.51:33249] by server-2.bemta-3.messagelabs.com id
	BD/CD-11239-49309C05; Wed, 12 Dec 2012 22:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1355350930!18669777!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32060 invoked from network); 12 Dec 2012 22:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 22:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugs-0006QX-4r
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugr-0007Un-Ra
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:09 +0000
Message-Id: <E1Tiugr-0007Un-Ra@xenbits.xen.org>
Date: Wed, 12 Dec 2012 22:22:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Added signature for changeset
	0125069bc1b2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1355305216 0
# Node ID a866cc5b8235ae05b178b9a904a59569b005f177
# Parent  e77f613c133ab75f08b2beab4be9919628e918ef
Added signature for changeset 0125069bc1b2
---


diff -r e77f613c133a -r a866cc5b8235 .hgsigs
--- a/.hgsigs	Wed Dec 12 10:04:18 2012 +0100
+++ b/.hgsigs	Wed Dec 12 09:40:16 2012 +0000
@@ -20,3 +20,4 @@ acbd3617691397911f34e4574d03385c08aec900
 5cdcfed7b5b129843e1602b5d43c7651de337092 0 iQEcBAABAgAGBQJQDB6TAAoJEIP+FMlX6CvZ+H8IAJbWR4PrKOt3gMpgEYdADts96vtduD3oet5C+l8FSlo0pDPtF32wPQ5tQz+Ll8OtCFckSIzobsw+9IMrZ38nRwP1UM2LgLUuo6WVVwYZ4DKVIntDrC1DV6Us1CmGiHiTHqPNDypBB2NponJ21rlD8zRY4Q661BgdKXVwqq5H6SDtxNRSn7RPDYnsIvavabr0fvcR38YOHVG4TvfXP+uge0UfEvIurGEBnTn25E0vadLG9la9SGKeEm8HuTDnzuxQmSic7tPdodQ0oQYQ5AAj+/mdW2B9uaCDsmOeP4udDNcV4yXxdLxNA2GkeSSJ/+U0hj2HBaHZvd+hvAeHBZGdMAU=
 ce7195d2b80e4df9857e434fa29689fd678a2341 0 iQEcBAABAgAGBQJQI9u1AAoJEIP+FMlX6CvZU88IAKKz8mw53zvvdEFaV39669d+SFATRyatb9OF6L1O6RQczsdxI7koyGyLL64V6NvpMB3RLFrh3dD+1ZIy4W13AWuDSnby45oIijHpcQqZ+Zt1ijxDj/wuViSC+4S+sdkgCDfmMyGb5a8XwnoKIWb6EOJVT8FFjuVJ3UsTXfujCyDdDeKoFH7ZGfq+r7k0DoANqkNi2AIhxUrw/h/9ydNffd4Gh/BUsHHcx5DEfXUplbT3pPUvq6o38rsqM80xZNR7lgL7chxFHjs94OOqX71gEZw0sR1hi+gbL8eJTIsep4kM4Z0aOYJJCqUFYv5C31Nn54GWECKJSNSWtBo8hIqLpI0=
 500194a883bdcf77b2a0fc87de291b0c27435207 0 iQEcBAABAgAGBQJQpLjeAAoJEIP+FMlX6CvZaUUIAKXHEVEfhnGEUAnm0gA0Mao1W8yo7BrsIhgZ/TyTYmhaOBzF3ez9+oUDQ6XWAJ9zbyq4ZWBsDbKFJCSwF8nvPL2OLG2DGyqoi7UckPZshQi71h91cT8v/snsp4A2161NEh9Tyti7YrygCzZldgjYy0vVAyFGmML+swvcBI9Zufb2Vk+Lm4R6EgmmTSO+EHEPg0QDtjLcUICSPcQgzRBe2QB/xzn/h8yWJ8FoOCyNDu3zQU1RKoP3lVMT0vK6Pr/l6NC7sy2Npfhe44ysvKHCpzQD3kZMhvzLujVnm1xJs0iKifUgHLsAO7RP55i7AfUgXqEMHaMxwlRSNWBmOsLSeho=
+0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d 0 iQEcBAABAgAGBQJQyFD/AAoJEIP+FMlX6CvZdAAH/39wnElEv6/KMSdVNXvX2Fz5Q4jzw23muZsXF7e+vAJ2LOrg2vzzAyq4Clx6h2Rw0cvSHtZC8f+RbFA4cnMcm9yxAu9jO1+GViRMLi2yNaNIMiQ6+w4DCBtscRPa+t5fqVnUcSkC3xm/V1Us4whICL40AFtpi3u78d4DhbnbkH4NAbRutZD4RrI8frrTyu8X6aLVzVK+Am1yb69Y0BDQldI9L3a89o9zH3yASyo98Suvo9p+tipYv2YJMaTZaVFbPhcakg3ZnB5OVOdel1K16Rf3TB1qE+Yj654U0fFx4Tvx28q94n+HzQQiIDSanv6v1GL/lcQtcZwQtgrx4e+3jqc=

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 12 22:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 12 Dec 2012 22:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tiugw-0002Y3-G8; Wed, 12 Dec 2012 22:22:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugv-0002Xf-0p
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:13 +0000
Received: from [85.158.138.51:33249] by server-2.bemta-3.messagelabs.com id
	BD/CD-11239-49309C05; Wed, 12 Dec 2012 22:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1355350930!18669777!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32060 invoked from network); 12 Dec 2012 22:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Dec 2012 22:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugs-0006QX-4r
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tiugr-0007Un-Ra
	for xen-changelog@lists.xensource.com; Wed, 12 Dec 2012 22:22:09 +0000
Message-Id: <E1Tiugr-0007Un-Ra@xenbits.xen.org>
Date: Wed, 12 Dec 2012 22:22:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Added signature for changeset
	0125069bc1b2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1355305216 0
# Node ID a866cc5b8235ae05b178b9a904a59569b005f177
# Parent  e77f613c133ab75f08b2beab4be9919628e918ef
Added signature for changeset 0125069bc1b2
---


diff -r e77f613c133a -r a866cc5b8235 .hgsigs
--- a/.hgsigs	Wed Dec 12 10:04:18 2012 +0100
+++ b/.hgsigs	Wed Dec 12 09:40:16 2012 +0000
@@ -20,3 +20,4 @@ acbd3617691397911f34e4574d03385c08aec900
 5cdcfed7b5b129843e1602b5d43c7651de337092 0 iQEcBAABAgAGBQJQDB6TAAoJEIP+FMlX6CvZ+H8IAJbWR4PrKOt3gMpgEYdADts96vtduD3oet5C+l8FSlo0pDPtF32wPQ5tQz+Ll8OtCFckSIzobsw+9IMrZ38nRwP1UM2LgLUuo6WVVwYZ4DKVIntDrC1DV6Us1CmGiHiTHqPNDypBB2NponJ21rlD8zRY4Q661BgdKXVwqq5H6SDtxNRSn7RPDYnsIvavabr0fvcR38YOHVG4TvfXP+uge0UfEvIurGEBnTn25E0vadLG9la9SGKeEm8HuTDnzuxQmSic7tPdodQ0oQYQ5AAj+/mdW2B9uaCDsmOeP4udDNcV4yXxdLxNA2GkeSSJ/+U0hj2HBaHZvd+hvAeHBZGdMAU=
 ce7195d2b80e4df9857e434fa29689fd678a2341 0 iQEcBAABAgAGBQJQI9u1AAoJEIP+FMlX6CvZU88IAKKz8mw53zvvdEFaV39669d+SFATRyatb9OF6L1O6RQczsdxI7koyGyLL64V6NvpMB3RLFrh3dD+1ZIy4W13AWuDSnby45oIijHpcQqZ+Zt1ijxDj/wuViSC+4S+sdkgCDfmMyGb5a8XwnoKIWb6EOJVT8FFjuVJ3UsTXfujCyDdDeKoFH7ZGfq+r7k0DoANqkNi2AIhxUrw/h/9ydNffd4Gh/BUsHHcx5DEfXUplbT3pPUvq6o38rsqM80xZNR7lgL7chxFHjs94OOqX71gEZw0sR1hi+gbL8eJTIsep4kM4Z0aOYJJCqUFYv5C31Nn54GWECKJSNSWtBo8hIqLpI0=
 500194a883bdcf77b2a0fc87de291b0c27435207 0 iQEcBAABAgAGBQJQpLjeAAoJEIP+FMlX6CvZaUUIAKXHEVEfhnGEUAnm0gA0Mao1W8yo7BrsIhgZ/TyTYmhaOBzF3ez9+oUDQ6XWAJ9zbyq4ZWBsDbKFJCSwF8nvPL2OLG2DGyqoi7UckPZshQi71h91cT8v/snsp4A2161NEh9Tyti7YrygCzZldgjYy0vVAyFGmML+swvcBI9Zufb2Vk+Lm4R6EgmmTSO+EHEPg0QDtjLcUICSPcQgzRBe2QB/xzn/h8yWJ8FoOCyNDu3zQU1RKoP3lVMT0vK6Pr/l6NC7sy2Npfhe44ysvKHCpzQD3kZMhvzLujVnm1xJs0iKifUgHLsAO7RP55i7AfUgXqEMHaMxwlRSNWBmOsLSeho=
+0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d 0 iQEcBAABAgAGBQJQyFD/AAoJEIP+FMlX6CvZdAAH/39wnElEv6/KMSdVNXvX2Fz5Q4jzw23muZsXF7e+vAJ2LOrg2vzzAyq4Clx6h2Rw0cvSHtZC8f+RbFA4cnMcm9yxAu9jO1+GViRMLi2yNaNIMiQ6+w4DCBtscRPa+t5fqVnUcSkC3xm/V1Us4whICL40AFtpi3u78d4DhbnbkH4NAbRutZD4RrI8frrTyu8X6aLVzVK+Am1yb69Y0BDQldI9L3a89o9zH3yASyo98Suvo9p+tipYv2YJMaTZaVFbPhcakg3ZnB5OVOdel1K16Rf3TB1qE+Yj654U0fFx4Tvx28q94n+HzQQiIDSanv6v1GL/lcQtcZwQtgrx4e+3jqc=

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 13 02:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Dec 2012 02:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiyGf-0001Th-I0; Thu, 13 Dec 2012 02:11:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiyGe-0001Sk-8r
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 02:11:20 +0000
Received: from [85.158.138.51:27522] by server-5.bemta-3.messagelabs.com id
	7E/25-15136-74939C05; Thu, 13 Dec 2012 02:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1355364677!28737661!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20325 invoked from network); 13 Dec 2012 02:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2012 02:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiyGa-0007ak-KX
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 02:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiyGY-0004ns-I9
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 02:11:15 +0000
Message-Id: <E1TiyGY-0004ns-I9@xenbits.xen.org>
Date: Thu, 13 Dec 2012 02:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VMX: intr.c: remove i386 related code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1355305638 -3600
# Node ID 74d4a6cc5392363170397143c65f291a791aebf0
# Parent  ef8c1b607b1046b69036bd16d27e08413d47ed11
VMX: intr.c: remove i386 related code

i386 arch is no longer supported by Xen, remove the related code.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r ef8c1b607b10 -r 74d4a6cc5392 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Tue Dec 11 17:49:19 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/intr.c	Wed Dec 12 10:47:18 2012 +0100
@@ -295,16 +295,9 @@ void vmx_intr_assist(void)
                     intack.vector;
         __vmwrite(GUEST_INTR_STATUS, status);
         if (v->arch.hvm_vmx.eoi_exitmap_changed) {
-#ifdef __i386__
-#define UPDATE_EOI_EXITMAP(v, e) {                             \
-        if (test_and_clear_bit(e, &v->arch.hvm_vmx.eoi_exitmap_changed)) {      \
-                __vmwrite(EOI_EXIT_BITMAP##e, v->arch.hvm_vmx.eoi_exit_bitmap[e]);    \
-                __vmwrite(EOI_EXIT_BITMAP##e##_HIGH, v.arch.hvm_vmx.eoi_exit_bitmap[e] >> 32);}}
-#else
 #define UPDATE_EOI_EXITMAP(v, e) {                             \
         if (test_and_clear_bit(e, &v->arch.hvm_vmx.eoi_exitmap_changed)) {      \
                 __vmwrite(EOI_EXIT_BITMAP##e, v->arch.hvm_vmx.eoi_exit_bitmap[e]);}}
-#endif
                 UPDATE_EOI_EXITMAP(v, 0);
                 UPDATE_EOI_EXITMAP(v, 1);
                 UPDATE_EOI_EXITMAP(v, 2);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 13 02:11:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Dec 2012 02:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TiyGf-0001Th-I0; Thu, 13 Dec 2012 02:11:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiyGe-0001Sk-8r
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 02:11:20 +0000
Received: from [85.158.138.51:27522] by server-5.bemta-3.messagelabs.com id
	7E/25-15136-74939C05; Thu, 13 Dec 2012 02:11:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1355364677!28737661!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20325 invoked from network); 13 Dec 2012 02:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2012 02:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiyGa-0007ak-KX
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 02:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TiyGY-0004ns-I9
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 02:11:15 +0000
Message-Id: <E1TiyGY-0004ns-I9@xenbits.xen.org>
Date: Thu, 13 Dec 2012 02:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] VMX: intr.c: remove i386 related code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1355305638 -3600
# Node ID 74d4a6cc5392363170397143c65f291a791aebf0
# Parent  ef8c1b607b1046b69036bd16d27e08413d47ed11
VMX: intr.c: remove i386 related code

i386 arch is no longer supported by Xen, remove the related code.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r ef8c1b607b10 -r 74d4a6cc5392 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Tue Dec 11 17:49:19 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/intr.c	Wed Dec 12 10:47:18 2012 +0100
@@ -295,16 +295,9 @@ void vmx_intr_assist(void)
                     intack.vector;
         __vmwrite(GUEST_INTR_STATUS, status);
         if (v->arch.hvm_vmx.eoi_exitmap_changed) {
-#ifdef __i386__
-#define UPDATE_EOI_EXITMAP(v, e) {                             \
-        if (test_and_clear_bit(e, &v->arch.hvm_vmx.eoi_exitmap_changed)) {      \
-                __vmwrite(EOI_EXIT_BITMAP##e, v->arch.hvm_vmx.eoi_exit_bitmap[e]);    \
-                __vmwrite(EOI_EXIT_BITMAP##e##_HIGH, v.arch.hvm_vmx.eoi_exit_bitmap[e] >> 32);}}
-#else
 #define UPDATE_EOI_EXITMAP(v, e) {                             \
         if (test_and_clear_bit(e, &v->arch.hvm_vmx.eoi_exitmap_changed)) {      \
                 __vmwrite(EOI_EXIT_BITMAP##e, v->arch.hvm_vmx.eoi_exit_bitmap[e]);}}
-#endif
                 UPDATE_EOI_EXITMAP(v, 0);
                 UPDATE_EOI_EXITMAP(v, 1);
                 UPDATE_EOI_EXITMAP(v, 2);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 13 13:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Dec 2012 13:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tj8ZH-0001jh-GI; Thu, 13 Dec 2012 13:11:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tj8ZG-0001jZ-4w
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 13:11:14 +0000
Received: from [85.158.137.99:24294] by server-10.bemta-3.messagelabs.com id
	CC/BB-07616-1F3D9C05; Thu, 13 Dec 2012 13:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-217.messagelabs.com!1355404270!14109486!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19015 invoked from network); 13 Dec 2012 13:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2012 13:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tj8ZB-0006io-SY
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 13:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tj8ZB-0005dO-Cb
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 13:11:09 +0000
Message-Id: <E1Tj8ZB-0005dO-Cb@xenbits.xen.org>
Date: Thu, 13 Dec 2012 13:11:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] From: Ian Campbell
	<ian.campbell@citrix.com>
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355334075 0
# Node ID 255a0b6a81041e51fe38ef0e919a6541ffe0d119
# Parent  a866cc5b8235ae05b178b9a904a59569b005f177
From: Ian Campbell <ian.campbell@citrix.com>

libxl: attempt to cleanup tapdisk processes on disk backend destroy.

This patch properly terminates the tapdisk2 process(es) started
to service a virtual block device.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-unstable changeset: 23883:7998217630e2
xen-unstable date: Wed Sep 28 16:42:11 2011 +0100
Signed-off-by: Greg Wettstein <greg@enjellic.com>
Backport-requested-by: Greg Wettstein <greg@enjellic.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r a866cc5b8235 -r 255a0b6a8104 tools/blktap2/control/tap-ctl-list.c
--- a/tools/blktap2/control/tap-ctl-list.c	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/blktap2/control/tap-ctl-list.c	Wed Dec 12 17:41:15 2012 +0000
@@ -506,17 +506,15 @@ out:
 }
 
 int
-tap_ctl_find_minor(const char *type, const char *path)
+tap_ctl_find(const char *type, const char *path, tap_list_t *tap)
 {
 	tap_list_t **list, **_entry;
-	int minor, err;
+	int ret = -ENOENT, err;
 
 	err = tap_ctl_list(&list);
 	if (err)
 		return err;
 
-	minor = -1;
-
 	for (_entry = list; *_entry != NULL; ++_entry) {
 		tap_list_t *entry  = *_entry;
 
@@ -526,11 +524,13 @@ tap_ctl_find_minor(const char *type, con
 		if (path && (!entry->path || strcmp(entry->path, path)))
 			continue;
 
-		minor = entry->minor;
+		*tap = *entry;
+		tap->type = tap->path = NULL;
+		ret = 0;
 		break;
 	}
 
 	tap_ctl_free_list(list);
 
-	return minor >= 0 ? minor : -ENOENT;
+	return ret;
 }
diff -r a866cc5b8235 -r 255a0b6a8104 tools/blktap2/control/tap-ctl.h
--- a/tools/blktap2/control/tap-ctl.h	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/blktap2/control/tap-ctl.h	Wed Dec 12 17:41:15 2012 +0000
@@ -76,7 +76,7 @@ int tap_ctl_get_driver_id(const char *ha
 
 int tap_ctl_list(tap_list_t ***list);
 void tap_ctl_free_list(tap_list_t **list);
-int tap_ctl_find_minor(const char *type, const char *path);
+int tap_ctl_find(const char *type, const char *path, tap_list_t *tap);
 
 int tap_ctl_allocate(int *minor, char **devname);
 int tap_ctl_free(const int minor);
diff -r a866cc5b8235 -r 255a0b6a8104 tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/libxl/libxl_blktap2.c	Wed Dec 12 17:41:15 2012 +0000
@@ -18,6 +18,8 @@
 
 #include "tap-ctl.h"
 
+#include <string.h>
+
 int libxl__blktap_enabled(libxl__gc *gc)
 {
     const char *msg;
@@ -30,12 +32,13 @@ const char *libxl__blktap_devpath(libxl_
 {
     const char *type;
     char *params, *devname = NULL;
-    int minor, err;
+    tap_list_t tap;
+    int err;
 
     type = libxl__device_disk_string_of_format(format);
-    minor = tap_ctl_find_minor(type, disk);
-    if (minor >= 0) {
-        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", minor);
+    err = tap_ctl_find(type, disk, &tap);
+    if (err == 0) {
+        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", tap.minor);
         if (devname)
             return devname;
     }
@@ -49,3 +52,28 @@ const char *libxl__blktap_devpath(libxl_
 
     return NULL;
 }
+
+
+void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
+{
+    char *path, *params, *type, *disk;
+    int err;
+    tap_list_t tap;
+
+    path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
+    if (!path) return;
+
+    params = libxl__xs_read(gc, XBT_NULL, path);
+    if (!params) return;
+
+    type = params;
+    disk = strchr(params, ':');
+    if (!disk) return;
+
+    *disk++ = '\0';
+
+    err = tap_ctl_find(type, disk, &tap);
+    if (err < 0) return;
+
+    tap_ctl_destroy(tap.id, tap.minor);
+}
diff -r a866cc5b8235 -r 255a0b6a8104 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/libxl/libxl_device.c	Wed Dec 12 17:41:15 2012 +0000
@@ -250,6 +250,7 @@ int libxl__device_destroy(libxl_ctx *ctx
     if (!state)
         goto out;
     if (atoi(state) != 4) {
+        libxl__device_destroy_tapdisk(&gc, be_path);
         xs_rm(ctx->xsh, XBT_NULL, be_path);
         goto out;
     }
@@ -368,6 +369,7 @@ int libxl__devices_destroy(libxl_ctx *ct
             }
         }
     }
+    libxl__device_destroy_tapdisk(&gc, be_path);
 out:
     libxl__free_all(&gc);
     return 0;
diff -r a866cc5b8235 -r 255a0b6a8104 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Wed Dec 12 17:41:15 2012 +0000
@@ -314,6 +314,12 @@ _hidden const char *libxl__blktap_devpat
                                  const char *disk,
                                  libxl_disk_format format);
 
+/* libxl__device_destroy_tapdisk:
+ *   Destroys any tapdisk process associated with the backend represented
+ *   by be_path.
+ */
+_hidden void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path);
+
 _hidden char *libxl__uuid2string(libxl__gc *gc, const libxl_uuid uuid);
 
 struct libxl__xen_console_reader {
diff -r a866cc5b8235 -r 255a0b6a8104 tools/libxl/libxl_noblktap2.c
--- a/tools/libxl/libxl_noblktap2.c	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/libxl/libxl_noblktap2.c	Wed Dec 12 17:41:15 2012 +0000
@@ -27,3 +27,7 @@ const char *libxl__blktap_devpath(libxl_
 {
     return NULL;
 }
+
+void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
+{
+}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 13 13:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 13 Dec 2012 13:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tj8ZH-0001jh-GI; Thu, 13 Dec 2012 13:11:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tj8ZG-0001jZ-4w
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 13:11:14 +0000
Received: from [85.158.137.99:24294] by server-10.bemta-3.messagelabs.com id
	CC/BB-07616-1F3D9C05; Thu, 13 Dec 2012 13:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-217.messagelabs.com!1355404270!14109486!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19015 invoked from network); 13 Dec 2012 13:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Dec 2012 13:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tj8ZB-0006io-SY
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 13:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tj8ZB-0005dO-Cb
	for xen-changelog@lists.xensource.com; Thu, 13 Dec 2012 13:11:09 +0000
Message-Id: <E1Tj8ZB-0005dO-Cb@xenbits.xen.org>
Date: Thu, 13 Dec 2012 13:11:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] From: Ian Campbell
	<ian.campbell@citrix.com>
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355334075 0
# Node ID 255a0b6a81041e51fe38ef0e919a6541ffe0d119
# Parent  a866cc5b8235ae05b178b9a904a59569b005f177
From: Ian Campbell <ian.campbell@citrix.com>

libxl: attempt to cleanup tapdisk processes on disk backend destroy.

This patch properly terminates the tapdisk2 process(es) started
to service a virtual block device.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-unstable changeset: 23883:7998217630e2
xen-unstable date: Wed Sep 28 16:42:11 2011 +0100
Signed-off-by: Greg Wettstein <greg@enjellic.com>
Backport-requested-by: Greg Wettstein <greg@enjellic.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r a866cc5b8235 -r 255a0b6a8104 tools/blktap2/control/tap-ctl-list.c
--- a/tools/blktap2/control/tap-ctl-list.c	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/blktap2/control/tap-ctl-list.c	Wed Dec 12 17:41:15 2012 +0000
@@ -506,17 +506,15 @@ out:
 }
 
 int
-tap_ctl_find_minor(const char *type, const char *path)
+tap_ctl_find(const char *type, const char *path, tap_list_t *tap)
 {
 	tap_list_t **list, **_entry;
-	int minor, err;
+	int ret = -ENOENT, err;
 
 	err = tap_ctl_list(&list);
 	if (err)
 		return err;
 
-	minor = -1;
-
 	for (_entry = list; *_entry != NULL; ++_entry) {
 		tap_list_t *entry  = *_entry;
 
@@ -526,11 +524,13 @@ tap_ctl_find_minor(const char *type, con
 		if (path && (!entry->path || strcmp(entry->path, path)))
 			continue;
 
-		minor = entry->minor;
+		*tap = *entry;
+		tap->type = tap->path = NULL;
+		ret = 0;
 		break;
 	}
 
 	tap_ctl_free_list(list);
 
-	return minor >= 0 ? minor : -ENOENT;
+	return ret;
 }
diff -r a866cc5b8235 -r 255a0b6a8104 tools/blktap2/control/tap-ctl.h
--- a/tools/blktap2/control/tap-ctl.h	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/blktap2/control/tap-ctl.h	Wed Dec 12 17:41:15 2012 +0000
@@ -76,7 +76,7 @@ int tap_ctl_get_driver_id(const char *ha
 
 int tap_ctl_list(tap_list_t ***list);
 void tap_ctl_free_list(tap_list_t **list);
-int tap_ctl_find_minor(const char *type, const char *path);
+int tap_ctl_find(const char *type, const char *path, tap_list_t *tap);
 
 int tap_ctl_allocate(int *minor, char **devname);
 int tap_ctl_free(const int minor);
diff -r a866cc5b8235 -r 255a0b6a8104 tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/libxl/libxl_blktap2.c	Wed Dec 12 17:41:15 2012 +0000
@@ -18,6 +18,8 @@
 
 #include "tap-ctl.h"
 
+#include <string.h>
+
 int libxl__blktap_enabled(libxl__gc *gc)
 {
     const char *msg;
@@ -30,12 +32,13 @@ const char *libxl__blktap_devpath(libxl_
 {
     const char *type;
     char *params, *devname = NULL;
-    int minor, err;
+    tap_list_t tap;
+    int err;
 
     type = libxl__device_disk_string_of_format(format);
-    minor = tap_ctl_find_minor(type, disk);
-    if (minor >= 0) {
-        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", minor);
+    err = tap_ctl_find(type, disk, &tap);
+    if (err == 0) {
+        devname = libxl__sprintf(gc, "/dev/xen/blktap-2/tapdev%d", tap.minor);
         if (devname)
             return devname;
     }
@@ -49,3 +52,28 @@ const char *libxl__blktap_devpath(libxl_
 
     return NULL;
 }
+
+
+void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
+{
+    char *path, *params, *type, *disk;
+    int err;
+    tap_list_t tap;
+
+    path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
+    if (!path) return;
+
+    params = libxl__xs_read(gc, XBT_NULL, path);
+    if (!params) return;
+
+    type = params;
+    disk = strchr(params, ':');
+    if (!disk) return;
+
+    *disk++ = '\0';
+
+    err = tap_ctl_find(type, disk, &tap);
+    if (err < 0) return;
+
+    tap_ctl_destroy(tap.id, tap.minor);
+}
diff -r a866cc5b8235 -r 255a0b6a8104 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/libxl/libxl_device.c	Wed Dec 12 17:41:15 2012 +0000
@@ -250,6 +250,7 @@ int libxl__device_destroy(libxl_ctx *ctx
     if (!state)
         goto out;
     if (atoi(state) != 4) {
+        libxl__device_destroy_tapdisk(&gc, be_path);
         xs_rm(ctx->xsh, XBT_NULL, be_path);
         goto out;
     }
@@ -368,6 +369,7 @@ int libxl__devices_destroy(libxl_ctx *ct
             }
         }
     }
+    libxl__device_destroy_tapdisk(&gc, be_path);
 out:
     libxl__free_all(&gc);
     return 0;
diff -r a866cc5b8235 -r 255a0b6a8104 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Wed Dec 12 17:41:15 2012 +0000
@@ -314,6 +314,12 @@ _hidden const char *libxl__blktap_devpat
                                  const char *disk,
                                  libxl_disk_format format);
 
+/* libxl__device_destroy_tapdisk:
+ *   Destroys any tapdisk process associated with the backend represented
+ *   by be_path.
+ */
+_hidden void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path);
+
 _hidden char *libxl__uuid2string(libxl__gc *gc, const libxl_uuid uuid);
 
 struct libxl__xen_console_reader {
diff -r a866cc5b8235 -r 255a0b6a8104 tools/libxl/libxl_noblktap2.c
--- a/tools/libxl/libxl_noblktap2.c	Wed Dec 12 09:40:16 2012 +0000
+++ b/tools/libxl/libxl_noblktap2.c	Wed Dec 12 17:41:15 2012 +0000
@@ -27,3 +27,7 @@ const char *libxl__blktap_devpath(libxl_
 {
     return NULL;
 }
+
+void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path)
+{
+}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 00:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 00:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjJYZ-0003DZ-Jq; Fri, 14 Dec 2012 00:55:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjJYY-0003DU-DO
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 00:55:14 +0000
Received: from [85.158.139.83:45548] by server-16.bemta-5.messagelabs.com id
	3D/C2-09208-1F87AC05; Fri, 14 Dec 2012 00:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1355446511!27650622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20322 invoked from network); 14 Dec 2012 00:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 00:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjJYU-0006pw-Ng
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 00:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjJYT-0007rf-TU
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 00:55:10 +0000
Message-Id: <E1TjJYT-0007rf-TU@xenbits.xen.org>
Date: Fri, 14 Dec 2012 00:55:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] libxl: fix vfb related assertion
	problem when starting pv-domU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ronny Hegewald <ronny.hegewald@online.de>
# Date 1355409044 0
# Node ID bfdbf9747fc4eb8f76dea0b881ae1c4acc6da3a8
# Parent  02140822d8335b3d1c7fe8cfc64c777dfec863ea
libxl: fix vfb related assertion problem when starting pv-domU

When a config-file for a pv-domU has a vfb section with a vnc=0
option then a "xl create" for that domU crashes with the message

xl: libxl.c:252: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)'
failed.

and the domU hangs early in the start.

This patch fixes the cause of the assertion and let the domU start
normally.

This problem exists since xen 4.2.

Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26145:8b93ac0c93f3
Backport-requested-by: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 02140822d833 -r bfdbf9747fc4 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Wed Dec 12 11:19:40 2012 +0100
+++ b/tools/libxl/libxl.c	Thu Dec 13 14:30:44 2012 +0000
@@ -3017,6 +3017,8 @@ int libxl__device_vfb_setdefault(libxl__
         }
 
         libxl_defbool_setdefault(&vfb->vnc.findunused, true);
+    } else {
+        libxl_defbool_setdefault(&vfb->vnc.findunused, false);
     }
 
     libxl_defbool_setdefault(&vfb->sdl.enable, false);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 00:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 00:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjJYZ-0003DZ-Jq; Fri, 14 Dec 2012 00:55:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjJYY-0003DU-DO
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 00:55:14 +0000
Received: from [85.158.139.83:45548] by server-16.bemta-5.messagelabs.com id
	3D/C2-09208-1F87AC05; Fri, 14 Dec 2012 00:55:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1355446511!27650622!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20322 invoked from network); 14 Dec 2012 00:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 00:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjJYU-0006pw-Ng
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 00:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjJYT-0007rf-TU
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 00:55:10 +0000
Message-Id: <E1TjJYT-0007rf-TU@xenbits.xen.org>
Date: Fri, 14 Dec 2012 00:55:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] libxl: fix vfb related assertion
	problem when starting pv-domU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ronny Hegewald <ronny.hegewald@online.de>
# Date 1355409044 0
# Node ID bfdbf9747fc4eb8f76dea0b881ae1c4acc6da3a8
# Parent  02140822d8335b3d1c7fe8cfc64c777dfec863ea
libxl: fix vfb related assertion problem when starting pv-domU

When a config-file for a pv-domU has a vfb section with a vnc=0
option then a "xl create" for that domU crashes with the message

xl: libxl.c:252: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)'
failed.

and the domU hangs early in the start.

This patch fixes the cause of the assertion and let the domU start
normally.

This problem exists since xen 4.2.

Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>

xen-unstable changeset: 26145:8b93ac0c93f3
Backport-requested-by: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 02140822d833 -r bfdbf9747fc4 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Wed Dec 12 11:19:40 2012 +0100
+++ b/tools/libxl/libxl.c	Thu Dec 13 14:30:44 2012 +0000
@@ -3017,6 +3017,8 @@ int libxl__device_vfb_setdefault(libxl__
         }
 
         libxl_defbool_setdefault(&vfb->vnc.findunused, true);
+    } else {
+        libxl_defbool_setdefault(&vfb->vnc.findunused, false);
     }
 
     libxl_defbool_setdefault(&vfb->sdl.enable, false);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGD-0002fl-3K; Fri, 14 Dec 2012 15:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGB-0002fX-Hj
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:11 +0000
Received: from [85.158.139.211:21488] by server-1.bemta-5.messagelabs.com id
	B1/EA-12813-6B64BC05; Fri, 14 Dec 2012 15:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355499188!20420620!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10771 invoked from network); 14 Dec 2012 15:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG8-0006YH-H7
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG8-0005bD-Ev
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:08 +0000
Message-Id: <E1TjXG8-0005bD-Ev@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: get GIC addresses from DT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1355399040 0
# Node ID 54340e92367f314475ba68dc9a477c3c33d9236c
# Parent  db8800f09ac1fc5617444612403ee0554b3d0bcb
xen: get GIC addresses from DT

Get the address of the GIC distributor, cpu, virtual and virtual cpu
interfaces registers from device tree.

Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
and friends because we are using them from mode_switch.S, that is
executed before device tree has been parsed. But at least mode_switch.S
is known to contain vexpress specific code anyway.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r db8800f09ac1 -r 54340e92367f xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Thu Dec 13 11:22:54 2012 +0100
+++ b/xen/arch/arm/gic.c	Thu Dec 13 11:44:00 2012 +0000
@@ -26,6 +26,7 @@
 #include <xen/errno.h>
 #include <xen/softirq.h>
 #include <xen/list.h>
+#include <xen/device_tree.h>
 #include <asm/p2m.h>
 #include <asm/domain.h>
 
@@ -33,10 +34,8 @@
 
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
-#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
-                                     + (GIC_CR_OFFSET & 0xfff)))
-#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
-                                     + (GIC_HR_OFFSET & 0xfff)))
+#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1))
+#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
 static void gic_restore_pending_irqs(struct vcpu *v);
 
 /* Global state */
@@ -44,6 +43,7 @@ static struct {
     paddr_t dbase;       /* Address of distributor registers */
     paddr_t cbase;       /* Address of CPU interface registers */
     paddr_t hbase;       /* Address of virtual interface registers */
+    paddr_t vbase;       /* Address of virtual cpu interface registers */
     unsigned int lines;
     unsigned int cpus;
     spinlock_t lock;
@@ -306,10 +306,28 @@ static void __cpuinit gic_hyp_disable(vo
 /* Set up the GIC */
 void __init gic_init(void)
 {
-    /* XXX FIXME get this from devicetree */
-    gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
-    gic.cbase = GIC_BASE_ADDRESS + GIC_CR_OFFSET;
-    gic.hbase = GIC_BASE_ADDRESS + GIC_HR_OFFSET;
+    printk("GIC initialization:\n"
+              "        gic_dist_addr=%"PRIpaddr"\n"
+              "        gic_cpu_addr=%"PRIpaddr"\n"
+              "        gic_hyp_addr=%"PRIpaddr"\n"
+              "        gic_vcpu_addr=%"PRIpaddr"\n",
+              early_info.gic.gic_dist_addr, early_info.gic.gic_cpu_addr,
+              early_info.gic.gic_hyp_addr, early_info.gic.gic_vcpu_addr);
+    if ( !early_info.gic.gic_dist_addr ||
+         !early_info.gic.gic_cpu_addr ||
+         !early_info.gic.gic_hyp_addr ||
+         !early_info.gic.gic_vcpu_addr )
+        panic("the physical address of one of the GIC interfaces is missing\n");
+    if ( (early_info.gic.gic_dist_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_cpu_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_hyp_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_vcpu_addr & ~PAGE_MASK) )
+        panic("GIC interfaces not page aligned.\n");
+
+    gic.dbase = early_info.gic.gic_dist_addr;
+    gic.cbase = early_info.gic.gic_cpu_addr;
+    gic.hbase = early_info.gic.gic_hyp_addr;
+    gic.vbase = early_info.gic.gic_vcpu_addr;
     set_fixmap(FIXMAP_GICD, gic.dbase >> PAGE_SHIFT, DEV_SHARED);
     BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
                  FIXMAP_ADDR(FIXMAP_GICC2)-PAGE_SIZE);
@@ -569,9 +587,9 @@ int gicv_setup(struct domain *d)
 {
     /* map the gic virtual cpu interface in the gic cpu interface region of
      * the guest */
-    return map_mmio_regions(d, GIC_BASE_ADDRESS + GIC_CR_OFFSET,
-                        GIC_BASE_ADDRESS + GIC_CR_OFFSET + (2 * PAGE_SIZE) - 1,
-                        GIC_BASE_ADDRESS + GIC_VR_OFFSET);
+    return map_mmio_regions(d, gic.cbase,
+                        gic.cbase + (2 * PAGE_SIZE) - 1,
+                        gic.vbase);
 }
 
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
diff -r db8800f09ac1 -r 54340e92367f xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Dec 13 11:22:54 2012 +0100
+++ b/xen/common/device_tree.c	Thu Dec 13 11:44:00 2012 +0000
@@ -54,6 +54,33 @@ bool_t device_tree_type_matches(const vo
     return !strncmp(prop, match, len);
 }
 
+bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
+{
+    int len, l;
+    const void *prop;
+
+    prop = fdt_getprop(fdt, node, "compatible", &len);
+    if ( prop == NULL )
+        return 0;
+
+    while ( len > 0 ) {
+        if ( !strcmp(prop, match) )
+            return 1;
+        l = strlen(prop) + 1;
+        prop += l;
+        len -= l;
+    }
+
+    return 0;
+}
+
+static int device_tree_nr_reg_ranges(const struct fdt_property *prop,
+        u32 address_cells, u32 size_cells)
+{
+    u32 reg_cells = address_cells + size_cells;
+    return fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
+}
+
 static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
@@ -209,7 +236,6 @@ static void __init process_memory_node(c
                                        u32 address_cells, u32 size_cells)
 {
     const struct fdt_property *prop;
-    size_t reg_cells;
     int i;
     int banks;
     const u32 *cell;
@@ -230,8 +256,7 @@ static void __init process_memory_node(c
     }
 
     cell = (const u32 *)prop->data;
-    reg_cells = address_cells + size_cells;
-    banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
+    banks = device_tree_nr_reg_ranges(prop, address_cells, size_cells);
 
     for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ )
     {
@@ -270,6 +295,46 @@ static void __init process_cpu_node(cons
     cpumask_set_cpu(start, &cpu_possible_map);
 }
 
+static void __init process_gic_node(const void *fdt, int node,
+                                    const char *name,
+                                    u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    const u32 *cell;
+    paddr_t start, size;
+    int interfaces;
+
+    if ( address_cells < 1 || size_cells < 1 )
+    {
+        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
+                     name);
+        return;
+    }
+
+    prop = fdt_get_property(fdt, node, "reg", NULL);
+    if ( !prop )
+    {
+        early_printk("fdt: node `%s': missing `reg' property\n", name);
+        return;
+    }
+
+    cell = (const u32 *)prop->data;
+    interfaces = device_tree_nr_reg_ranges(prop, address_cells, size_cells);
+    if ( interfaces < 4 )
+    {
+        early_printk("fdt: node `%s': not enough ranges\n", name);
+        return;
+    }
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_dist_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_cpu_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_hyp_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_vcpu_addr = start;
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -279,6 +344,8 @@ static int __init early_scan_node(const 
         process_memory_node(fdt, node, name, address_cells, size_cells);
     else if ( device_tree_type_matches(fdt, node, "cpu") )
         process_cpu_node(fdt, node, name, address_cells, size_cells);
+    else if ( device_tree_node_compatible(fdt, node, "arm,cortex-a15-gic") )
+        process_gic_node(fdt, node, name, address_cells, size_cells);
 
     return 0;
 }
diff -r db8800f09ac1 -r 54340e92367f xen/include/xen/device_tree.h
--- a/xen/include/xen/device_tree.h	Thu Dec 13 11:22:54 2012 +0100
+++ b/xen/include/xen/device_tree.h	Thu Dec 13 11:44:00 2012 +0000
@@ -26,8 +26,16 @@ struct dt_mem_info {
     struct membank bank[NR_MEM_BANKS];
 };
 
+struct dt_gic_info {
+    paddr_t gic_dist_addr;
+    paddr_t gic_cpu_addr;
+    paddr_t gic_hyp_addr;
+    paddr_t gic_vcpu_addr;
+};
+
 struct dt_early_info {
     struct dt_mem_info mem;
+    struct dt_gic_info gic;
 };
 
 typedef int (*device_tree_node_func)(const void *fdt,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGD-0002fl-3K; Fri, 14 Dec 2012 15:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGB-0002fX-Hj
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:11 +0000
Received: from [85.158.139.211:21488] by server-1.bemta-5.messagelabs.com id
	B1/EA-12813-6B64BC05; Fri, 14 Dec 2012 15:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355499188!20420620!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10771 invoked from network); 14 Dec 2012 15:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG8-0006YH-H7
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG8-0005bD-Ev
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:08 +0000
Message-Id: <E1TjXG8-0005bD-Ev@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: get GIC addresses from DT
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1355399040 0
# Node ID 54340e92367f314475ba68dc9a477c3c33d9236c
# Parent  db8800f09ac1fc5617444612403ee0554b3d0bcb
xen: get GIC addresses from DT

Get the address of the GIC distributor, cpu, virtual and virtual cpu
interfaces registers from device tree.

Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET
and friends because we are using them from mode_switch.S, that is
executed before device tree has been parsed. But at least mode_switch.S
is known to contain vexpress specific code anyway.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r db8800f09ac1 -r 54340e92367f xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Thu Dec 13 11:22:54 2012 +0100
+++ b/xen/arch/arm/gic.c	Thu Dec 13 11:44:00 2012 +0000
@@ -26,6 +26,7 @@
 #include <xen/errno.h>
 #include <xen/softirq.h>
 #include <xen/list.h>
+#include <xen/device_tree.h>
 #include <asm/p2m.h>
 #include <asm/domain.h>
 
@@ -33,10 +34,8 @@
 
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
-#define GICC ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICC1)  \
-                                     + (GIC_CR_OFFSET & 0xfff)))
-#define GICH ((volatile uint32_t *) (FIXMAP_ADDR(FIXMAP_GICH)  \
-                                     + (GIC_HR_OFFSET & 0xfff)))
+#define GICC ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICC1))
+#define GICH ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICH))
 static void gic_restore_pending_irqs(struct vcpu *v);
 
 /* Global state */
@@ -44,6 +43,7 @@ static struct {
     paddr_t dbase;       /* Address of distributor registers */
     paddr_t cbase;       /* Address of CPU interface registers */
     paddr_t hbase;       /* Address of virtual interface registers */
+    paddr_t vbase;       /* Address of virtual cpu interface registers */
     unsigned int lines;
     unsigned int cpus;
     spinlock_t lock;
@@ -306,10 +306,28 @@ static void __cpuinit gic_hyp_disable(vo
 /* Set up the GIC */
 void __init gic_init(void)
 {
-    /* XXX FIXME get this from devicetree */
-    gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
-    gic.cbase = GIC_BASE_ADDRESS + GIC_CR_OFFSET;
-    gic.hbase = GIC_BASE_ADDRESS + GIC_HR_OFFSET;
+    printk("GIC initialization:\n"
+              "        gic_dist_addr=%"PRIpaddr"\n"
+              "        gic_cpu_addr=%"PRIpaddr"\n"
+              "        gic_hyp_addr=%"PRIpaddr"\n"
+              "        gic_vcpu_addr=%"PRIpaddr"\n",
+              early_info.gic.gic_dist_addr, early_info.gic.gic_cpu_addr,
+              early_info.gic.gic_hyp_addr, early_info.gic.gic_vcpu_addr);
+    if ( !early_info.gic.gic_dist_addr ||
+         !early_info.gic.gic_cpu_addr ||
+         !early_info.gic.gic_hyp_addr ||
+         !early_info.gic.gic_vcpu_addr )
+        panic("the physical address of one of the GIC interfaces is missing\n");
+    if ( (early_info.gic.gic_dist_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_cpu_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_hyp_addr & ~PAGE_MASK) ||
+         (early_info.gic.gic_vcpu_addr & ~PAGE_MASK) )
+        panic("GIC interfaces not page aligned.\n");
+
+    gic.dbase = early_info.gic.gic_dist_addr;
+    gic.cbase = early_info.gic.gic_cpu_addr;
+    gic.hbase = early_info.gic.gic_hyp_addr;
+    gic.vbase = early_info.gic.gic_vcpu_addr;
     set_fixmap(FIXMAP_GICD, gic.dbase >> PAGE_SHIFT, DEV_SHARED);
     BUILD_BUG_ON(FIXMAP_ADDR(FIXMAP_GICC1) !=
                  FIXMAP_ADDR(FIXMAP_GICC2)-PAGE_SIZE);
@@ -569,9 +587,9 @@ int gicv_setup(struct domain *d)
 {
     /* map the gic virtual cpu interface in the gic cpu interface region of
      * the guest */
-    return map_mmio_regions(d, GIC_BASE_ADDRESS + GIC_CR_OFFSET,
-                        GIC_BASE_ADDRESS + GIC_CR_OFFSET + (2 * PAGE_SIZE) - 1,
-                        GIC_BASE_ADDRESS + GIC_VR_OFFSET);
+    return map_mmio_regions(d, gic.cbase,
+                        gic.cbase + (2 * PAGE_SIZE) - 1,
+                        gic.vbase);
 }
 
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
diff -r db8800f09ac1 -r 54340e92367f xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Dec 13 11:22:54 2012 +0100
+++ b/xen/common/device_tree.c	Thu Dec 13 11:44:00 2012 +0000
@@ -54,6 +54,33 @@ bool_t device_tree_type_matches(const vo
     return !strncmp(prop, match, len);
 }
 
+bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)
+{
+    int len, l;
+    const void *prop;
+
+    prop = fdt_getprop(fdt, node, "compatible", &len);
+    if ( prop == NULL )
+        return 0;
+
+    while ( len > 0 ) {
+        if ( !strcmp(prop, match) )
+            return 1;
+        l = strlen(prop) + 1;
+        prop += l;
+        len -= l;
+    }
+
+    return 0;
+}
+
+static int device_tree_nr_reg_ranges(const struct fdt_property *prop,
+        u32 address_cells, u32 size_cells)
+{
+    u32 reg_cells = address_cells + size_cells;
+    return fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
+}
+
 static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
@@ -209,7 +236,6 @@ static void __init process_memory_node(c
                                        u32 address_cells, u32 size_cells)
 {
     const struct fdt_property *prop;
-    size_t reg_cells;
     int i;
     int banks;
     const u32 *cell;
@@ -230,8 +256,7 @@ static void __init process_memory_node(c
     }
 
     cell = (const u32 *)prop->data;
-    reg_cells = address_cells + size_cells;
-    banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
+    banks = device_tree_nr_reg_ranges(prop, address_cells, size_cells);
 
     for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ )
     {
@@ -270,6 +295,46 @@ static void __init process_cpu_node(cons
     cpumask_set_cpu(start, &cpu_possible_map);
 }
 
+static void __init process_gic_node(const void *fdt, int node,
+                                    const char *name,
+                                    u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    const u32 *cell;
+    paddr_t start, size;
+    int interfaces;
+
+    if ( address_cells < 1 || size_cells < 1 )
+    {
+        early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
+                     name);
+        return;
+    }
+
+    prop = fdt_get_property(fdt, node, "reg", NULL);
+    if ( !prop )
+    {
+        early_printk("fdt: node `%s': missing `reg' property\n", name);
+        return;
+    }
+
+    cell = (const u32 *)prop->data;
+    interfaces = device_tree_nr_reg_ranges(prop, address_cells, size_cells);
+    if ( interfaces < 4 )
+    {
+        early_printk("fdt: node `%s': not enough ranges\n", name);
+        return;
+    }
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_dist_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_cpu_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_hyp_addr = start;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+    early_info.gic.gic_vcpu_addr = start;
+}
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -279,6 +344,8 @@ static int __init early_scan_node(const 
         process_memory_node(fdt, node, name, address_cells, size_cells);
     else if ( device_tree_type_matches(fdt, node, "cpu") )
         process_cpu_node(fdt, node, name, address_cells, size_cells);
+    else if ( device_tree_node_compatible(fdt, node, "arm,cortex-a15-gic") )
+        process_gic_node(fdt, node, name, address_cells, size_cells);
 
     return 0;
 }
diff -r db8800f09ac1 -r 54340e92367f xen/include/xen/device_tree.h
--- a/xen/include/xen/device_tree.h	Thu Dec 13 11:22:54 2012 +0100
+++ b/xen/include/xen/device_tree.h	Thu Dec 13 11:44:00 2012 +0000
@@ -26,8 +26,16 @@ struct dt_mem_info {
     struct membank bank[NR_MEM_BANKS];
 };
 
+struct dt_gic_info {
+    paddr_t gic_dist_addr;
+    paddr_t gic_cpu_addr;
+    paddr_t gic_hyp_addr;
+    paddr_t gic_vcpu_addr;
+};
+
 struct dt_early_info {
     struct dt_mem_info mem;
+    struct dt_gic_info gic;
 };
 
 typedef int (*device_tree_node_func)(const void *fdt,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGD-0002fg-0q; Fri, 14 Dec 2012 15:33:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGB-0002fW-Bv
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:11 +0000
Received: from [85.158.143.99:22532] by server-2.bemta-4.messagelabs.com id
	BA/87-30861-6B64BC05; Fri, 14 Dec 2012 15:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1355499188!18320333!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26496 invoked from network); 14 Dec 2012 15:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG8-0006YF-Ao
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG7-0005ay-RM
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:07 +0000
Message-Id: <E1TjXG7-0005ay-RM@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vscsiif: allow larger
	segments-per-request values
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355394174 -3600
# Node ID db8800f09ac1fc5617444612403ee0554b3d0bcb
# Parent  74d4a6cc5392363170397143c65f291a791aebf0
vscsiif: allow larger segments-per-request values

At least certain tape devices require fixed size blocks to be operated
upon, i.e. breaking up of I/O requests is not permitted. Consequently
we need an interface extension that (leaving aside implementation
limitations) doesn't impose a limit on the number of segments that can
be associated with an individual request.

This, in turn, excludes the blkif extension FreeBSD folks implemented,
as that still imposes an upper limit (the actual I/O request still
specifies the full number of segments - as an 8-bit quantity -, and
subsequent ring slots get used to carry the excess segment
descriptors).

The alternative therefore is to allow the frontend to pre-set segment
descriptors _before_ actually issuing the I/O request. I/O will then
be done by the backend for the accumulated set of segments.

To properly associate segment preset operations with the main request,
the rqid-s between them should match (originally I had hoped to use
this to avoid producing individual responses for the pre-set
operations, but that turned out to violate the underlying shared ring
implementation).

Negotiation of the maximum number of segments a particular backend
implementation supports happens through a new "segs-per-req" xenstore
node.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 74d4a6cc5392 -r db8800f09ac1 xen/include/public/io/vscsiif.h
--- a/xen/include/public/io/vscsiif.h	Wed Dec 12 10:47:18 2012 +0100
+++ b/xen/include/public/io/vscsiif.h	Thu Dec 13 11:22:54 2012 +0100
@@ -34,6 +34,7 @@
 #define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
 #define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
 #define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
+#define VSCSIIF_ACT_SCSI_SG_PRESET   4    /* Preset SG elements */
 
 /*
  * Maximum scatter/gather segments per request.
@@ -50,6 +51,12 @@
 #define VSCSIIF_MAX_COMMAND_SIZE         16
 #define VSCSIIF_SENSE_BUFFERSIZE         96
 
+struct scsiif_request_segment {
+    grant_ref_t gref;
+    uint16_t offset;
+    uint16_t length;
+};
+typedef struct scsiif_request_segment vscsiif_segment_t;
 
 struct vscsiif_request {
     uint16_t rqid;          /* private guest value, echoed in resp  */
@@ -66,18 +73,26 @@ struct vscsiif_request {
                                          DMA_NONE(3) requests  */
     uint8_t nr_segments;              /* Number of pieces of scatter-gather */
 
-    struct scsiif_request_segment {
-        grant_ref_t gref;
-        uint16_t offset;
-        uint16_t length;
-    } seg[VSCSIIF_SG_TABLESIZE];
+    vscsiif_segment_t seg[VSCSIIF_SG_TABLESIZE];
     uint32_t reserved[3];
 };
 typedef struct vscsiif_request vscsiif_request_t;
 
+#define VSCSIIF_SG_LIST_SIZE ((sizeof(vscsiif_request_t) - 4) \
+                              / sizeof(vscsiif_segment_t))
+
+struct vscsiif_sg_list {
+    /* First two fields must match struct vscsiif_request! */
+    uint16_t rqid;          /* private guest value, must match main req */
+    uint8_t act;            /* VSCSIIF_ACT_SCSI_SG_PRESET */
+    uint8_t nr_segments;    /* Number of pieces of scatter-gather */
+    vscsiif_segment_t seg[VSCSIIF_SG_LIST_SIZE];
+};
+typedef struct vscsiif_sg_list vscsiif_sg_list_t;
+
 struct vscsiif_response {
     uint16_t rqid;
-    uint8_t padding;
+    uint8_t act;               /* valid only when backend supports SG_PRESET */
     uint8_t sense_len;
     uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];
     int32_t rslt;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGD-0002fg-0q; Fri, 14 Dec 2012 15:33:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGB-0002fW-Bv
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:11 +0000
Received: from [85.158.143.99:22532] by server-2.bemta-4.messagelabs.com id
	BA/87-30861-6B64BC05; Fri, 14 Dec 2012 15:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1355499188!18320333!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26496 invoked from network); 14 Dec 2012 15:33:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG8-0006YF-Ao
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG7-0005ay-RM
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:07 +0000
Message-Id: <E1TjXG7-0005ay-RM@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vscsiif: allow larger
	segments-per-request values
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355394174 -3600
# Node ID db8800f09ac1fc5617444612403ee0554b3d0bcb
# Parent  74d4a6cc5392363170397143c65f291a791aebf0
vscsiif: allow larger segments-per-request values

At least certain tape devices require fixed size blocks to be operated
upon, i.e. breaking up of I/O requests is not permitted. Consequently
we need an interface extension that (leaving aside implementation
limitations) doesn't impose a limit on the number of segments that can
be associated with an individual request.

This, in turn, excludes the blkif extension FreeBSD folks implemented,
as that still imposes an upper limit (the actual I/O request still
specifies the full number of segments - as an 8-bit quantity -, and
subsequent ring slots get used to carry the excess segment
descriptors).

The alternative therefore is to allow the frontend to pre-set segment
descriptors _before_ actually issuing the I/O request. I/O will then
be done by the backend for the accumulated set of segments.

To properly associate segment preset operations with the main request,
the rqid-s between them should match (originally I had hoped to use
this to avoid producing individual responses for the pre-set
operations, but that turned out to violate the underlying shared ring
implementation).

Negotiation of the maximum number of segments a particular backend
implementation supports happens through a new "segs-per-req" xenstore
node.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 74d4a6cc5392 -r db8800f09ac1 xen/include/public/io/vscsiif.h
--- a/xen/include/public/io/vscsiif.h	Wed Dec 12 10:47:18 2012 +0100
+++ b/xen/include/public/io/vscsiif.h	Thu Dec 13 11:22:54 2012 +0100
@@ -34,6 +34,7 @@
 #define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
 #define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
 #define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
+#define VSCSIIF_ACT_SCSI_SG_PRESET   4    /* Preset SG elements */
 
 /*
  * Maximum scatter/gather segments per request.
@@ -50,6 +51,12 @@
 #define VSCSIIF_MAX_COMMAND_SIZE         16
 #define VSCSIIF_SENSE_BUFFERSIZE         96
 
+struct scsiif_request_segment {
+    grant_ref_t gref;
+    uint16_t offset;
+    uint16_t length;
+};
+typedef struct scsiif_request_segment vscsiif_segment_t;
 
 struct vscsiif_request {
     uint16_t rqid;          /* private guest value, echoed in resp  */
@@ -66,18 +73,26 @@ struct vscsiif_request {
                                          DMA_NONE(3) requests  */
     uint8_t nr_segments;              /* Number of pieces of scatter-gather */
 
-    struct scsiif_request_segment {
-        grant_ref_t gref;
-        uint16_t offset;
-        uint16_t length;
-    } seg[VSCSIIF_SG_TABLESIZE];
+    vscsiif_segment_t seg[VSCSIIF_SG_TABLESIZE];
     uint32_t reserved[3];
 };
 typedef struct vscsiif_request vscsiif_request_t;
 
+#define VSCSIIF_SG_LIST_SIZE ((sizeof(vscsiif_request_t) - 4) \
+                              / sizeof(vscsiif_segment_t))
+
+struct vscsiif_sg_list {
+    /* First two fields must match struct vscsiif_request! */
+    uint16_t rqid;          /* private guest value, must match main req */
+    uint8_t act;            /* VSCSIIF_ACT_SCSI_SG_PRESET */
+    uint8_t nr_segments;    /* Number of pieces of scatter-gather */
+    vscsiif_segment_t seg[VSCSIIF_SG_LIST_SIZE];
+};
+typedef struct vscsiif_sg_list vscsiif_sg_list_t;
+
 struct vscsiif_response {
     uint16_t rqid;
-    uint8_t padding;
+    uint8_t act;               /* valid only when backend supports SG_PRESET */
     uint8_t sense_len;
     uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];
     int32_t rslt;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGG-0002fz-63; Fri, 14 Dec 2012 15:33:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGE-0002fs-6R
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:14 +0000
Received: from [85.158.139.83:23818] by server-9.bemta-5.messagelabs.com id
	D9/D5-10690-6B64BC05; Fri, 14 Dec 2012 15:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1355499189!29200106!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30901 invoked from network); 14 Dec 2012 15:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG9-0006YL-3r
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG9-0005bU-0g
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:09 +0000
Message-Id: <E1TjXG9-0005bU-0g@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: use strcmp in
	device_tree_type_matches
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1355399041 0
# Node ID 69ec301b8ec20eacd3ebe87f56baca8b0e22c83f
# Parent  54340e92367f314475ba68dc9a477c3c33d9236c
xen/arm: use strcmp in device_tree_type_matches

We want to match the exact string rather than the first subset.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 54340e92367f -r 69ec301b8ec2 xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Dec 13 11:44:00 2012 +0000
+++ b/xen/common/device_tree.c	Thu Dec 13 11:44:01 2012 +0000
@@ -44,14 +44,13 @@ bool_t device_tree_node_matches(const vo
 
 bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
 {
-    int len;
     const void *prop;
 
-    prop = fdt_getprop(fdt, node, "device_type", &len);
+    prop = fdt_getprop(fdt, node, "device_type", NULL);
     if ( prop == NULL )
         return 0;
 
-    return !strncmp(prop, match, len);
+    return !strcmp(prop, match);
 }
 
 bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGG-0002fz-63; Fri, 14 Dec 2012 15:33:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGE-0002fs-6R
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:14 +0000
Received: from [85.158.139.83:23818] by server-9.bemta-5.messagelabs.com id
	D9/D5-10690-6B64BC05; Fri, 14 Dec 2012 15:33:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1355499189!29200106!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30901 invoked from network); 14 Dec 2012 15:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG9-0006YL-3r
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG9-0005bU-0g
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:09 +0000
Message-Id: <E1TjXG9-0005bU-0g@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: use strcmp in
	device_tree_type_matches
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1355399041 0
# Node ID 69ec301b8ec20eacd3ebe87f56baca8b0e22c83f
# Parent  54340e92367f314475ba68dc9a477c3c33d9236c
xen/arm: use strcmp in device_tree_type_matches

We want to match the exact string rather than the first subset.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 54340e92367f -r 69ec301b8ec2 xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Dec 13 11:44:00 2012 +0000
+++ b/xen/common/device_tree.c	Thu Dec 13 11:44:01 2012 +0000
@@ -44,14 +44,13 @@ bool_t device_tree_node_matches(const vo
 
 bool_t device_tree_type_matches(const void *fdt, int node, const char *match)
 {
-    int len;
     const void *prop;
 
-    prop = fdt_getprop(fdt, node, "device_type", &len);
+    prop = fdt_getprop(fdt, node, "device_type", NULL);
     if ( prop == NULL )
         return 0;
 
-    return !strncmp(prop, match, len);
+    return !strcmp(prop, match);
 }
 
 bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGM-0002hc-E1; Fri, 14 Dec 2012 15:33:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGJ-0002gk-U5
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:20 +0000
Received: from [85.158.138.51:16436] by server-16.bemta-3.messagelabs.com id
	BE/E7-27634-AB64BC05; Fri, 14 Dec 2012 15:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1355499192!22582607!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1624 invoked from network); 14 Dec 2012 15:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGB-0006YX-Ey
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGB-0005cS-9o
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:11 +0000
Message-Id: <E1TjXGB-0005cS-9o@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/kexec: Change NMI and MCE
	handling on kexec path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1355409571 0
# Node ID f50aab21f9f2ca3411df7881b2b92293b3af3771
# Parent  3dbd0a9be0cc730a1869d2d82b0fd6286af35533
x86/kexec: Change NMI and MCE handling on kexec path

Experimentally, certain crash kernels will triple fault very early
after starting if started with NMIs disabled.  This was discovered
when experimenting with a debug keyhandler which deliberately created
a reentrant NMI, causing stack corruption.

Because of this discovered bug, and that the future changes to the NMI
handling will make the kexec path more fragile, take the time now to
bullet-proof the kexec behaviour to be safer in more circumstances.

This patch adds three new low level routines:
 * nmi_crash
    This is a special NMI handler for using during a kexec crash.
 * enable_nmis
    This function enables NMIs by executing an iret-to-self, to
    disengage the hardware NMI latch.
 * trap_nop
    This is a no op handler which irets immediately.  It is not
    declared
    with ENTRY() to avoid the extra alignment overhead.

And adds three new IDT entry helper routines:
 * _write_gate_lower
    This is a substitute for using cmpxchg16b to update a 128bit
    structure at once.  It assumes that the top 64 bits are unchanged
    (and ASSERT()s the fact) and performs a regular write on the lower
    64 bits.
 * _set_gate_lower
    This is functionally equivalent to the already present
    _set_gate(), except it uses _write_gate_lower rather than updating
    both 64bit values.
 * _update_gate_addr_lower
    This is designed to update an IDT entry handler only, without
    altering any other settings in the entry.  It also uses
    _write_gate_lower.

The IDT entry helpers are required because:
  * Is it unsafe to attempt a disable/update/re-enable cycle on the
    NMI or MCE IDT entries.
  * We need to be able to update NMI handlers without changing the IST
    entry.

As a result, the new behaviour of the kexec_crash path is:

nmi_shootdown_cpus() will:

 * Disable the crashing cpus NMI/MCE interrupt stack tables.
    Disabling the stack tables removes race conditions which would
    lead
    to corrupt exception frames and infinite loops.  As this pcpu is
    never planning to execute a sysret back to a pv vcpu, the update
    is
    safe from a security point of view.

 * Swap the NMI trap handlers.
    The crashing pcpu gets the nop handler, to prevent it getting
    stuck in
    an NMI context, causing a hang instead of crash.  The non-crashing
    pcpus all get the nmi_crash handler which is designed never to
    return.

do_nmi_crash() will:

 * Save the crash notes and shut the pcpu down.
    There is now an extra per-cpu variable to prevent us from
    executing this multiple times.  In the case where we reenter
    midway through, attempt the whole operation again in preference to
    not completing it in the first place.

 * Set up another NMI at the LAPIC.
    Even when the LAPIC has been disabled, the ID and command
    registers are still usable.  As a result, we can deliberately
    queue up a new NMI to re-interrupt us later if NMIs get unlatched.
    Because of the call to __stop_this_cpu(), we have to hand craft
    self_nmi() to be safe from General Protection Faults.

 * Fall into infinite loop.

machine_kexec() will:

  * Swap the MCE handlers to be a nop.
     We cannot prevent MCEs from being delivered when we pass off to
     the crash kernel, and the less Xen context is being touched the
     better.

  * Explicitly enable NMIs.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>

Minor style changes.

Signed-off-by: Keir Fraser <keir@xen.org>

Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3dbd0a9be0cc -r f50aab21f9f2 xen/arch/x86/crash.c
--- a/xen/arch/x86/crash.c	Thu Dec 13 12:10:14 2012 +0000
+++ b/xen/arch/x86/crash.c	Thu Dec 13 14:39:31 2012 +0000
@@ -32,41 +32,130 @@
 
 static atomic_t waiting_for_crash_ipi;
 static unsigned int crashing_cpu;
+static DEFINE_PER_CPU_READ_MOSTLY(bool_t, crash_save_done);
 
-static int crash_nmi_callback(struct cpu_user_regs *regs, int cpu)
+/* This becomes the NMI handler for non-crashing CPUs, when Xen is crashing. */
+void __attribute__((noreturn)) do_nmi_crash(struct cpu_user_regs *regs)
 {
-    /* Don't do anything if this handler is invoked on crashing cpu.
-     * Otherwise, system will completely hang. Crashing cpu can get
-     * an NMI if system was initially booted with nmi_watchdog parameter.
+    int cpu = smp_processor_id();
+
+    /* nmi_shootdown_cpus() should ensure that this assertion is correct. */
+    ASSERT(cpu != crashing_cpu);
+
+    /* Save crash information and shut down CPU.  Attempt only once. */
+    if ( !this_cpu(crash_save_done) )
+    {
+        /* Disable the interrupt stack table for the MCE handler.  This
+         * prevents race conditions between clearing MCIP and receving a
+         * new MCE, during which the exception frame would be clobbered
+         * and the MCE handler fall into an infinite loop.  We are soon
+         * going to disable the NMI watchdog, so the loop would not be
+         * caught.
+         *
+         * We do not need to change the NMI IST, as the nmi_crash
+         * handler is immue to corrupt exception frames, by virtue of
+         * being designed never to return.
+         *
+         * This update is safe from a security point of view, as this
+         * pcpu is never going to try to sysret back to a PV vcpu.
+         */
+        set_ist(&idt_tables[cpu][TRAP_machine_check], IST_NONE);
+
+        kexec_crash_save_cpu();
+        __stop_this_cpu();
+
+        this_cpu(crash_save_done) = 1;
+        atomic_dec(&waiting_for_crash_ipi);
+    }
+
+    /* Poor mans self_nmi().  __stop_this_cpu() has reverted the LAPIC
+     * back to its boot state, so we are unable to rely on the regular
+     * apic_* functions, due to 'x2apic_enabled' being possibly wrong.
+     * (The likely scenario is that we have reverted from x2apic mode to
+     * xapic, at which point #GPFs will occur if we use the apic_*
+     * functions)
+     *
+     * The ICR and APIC ID of the LAPIC are still valid even during
+     * software disable (Intel SDM Vol 3, 10.4.7.2).  As a result, we
+     * can deliberately queue up another NMI at the LAPIC which will not
+     * be delivered as the hardware NMI latch is currently in effect.
+     * This means that if NMIs become unlatched (e.g. following a
+     * non-fatal MCE), the LAPIC will force us back here rather than
+     * wandering back into regular Xen code.
      */
-    if ( cpu == crashing_cpu )
-        return 1;
-    local_irq_disable();
+    switch ( current_local_apic_mode() )
+    {
+        u32 apic_id;
 
-    kexec_crash_save_cpu();
+    case APIC_MODE_X2APIC:
+        apic_id = apic_rdmsr(APIC_ID);
 
-    __stop_this_cpu();
+        apic_wrmsr(APIC_ICR, APIC_DM_NMI | APIC_DEST_PHYSICAL
+                   | ((u64)apic_id << 32));
+        break;
 
-    atomic_dec(&waiting_for_crash_ipi);
+    case APIC_MODE_XAPIC:
+        apic_id = GET_xAPIC_ID(apic_mem_read(APIC_ID));
+
+        while ( apic_mem_read(APIC_ICR) & APIC_ICR_BUSY )
+            cpu_relax();
+
+        apic_mem_write(APIC_ICR2, apic_id << 24);
+        apic_mem_write(APIC_ICR, APIC_DM_NMI | APIC_DEST_PHYSICAL);
+        break;
+
+    default:
+        break;
+    }
 
     for ( ; ; )
         halt();
-
-    return 1;
 }
 
 static void nmi_shootdown_cpus(void)
 {
     unsigned long msecs;
+    int i, cpu = smp_processor_id();
 
     local_irq_disable();
 
-    crashing_cpu = smp_processor_id();
+    crashing_cpu = cpu;
     local_irq_count(crashing_cpu) = 0;
 
     atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
-    /* Would it be better to replace the trap vector here? */
-    set_nmi_callback(crash_nmi_callback);
+
+    /* Change NMI trap handlers.  Non-crashing pcpus get nmi_crash which
+     * invokes do_nmi_crash (above), which cause them to write state and
+     * fall into a loop.  The crashing pcpu gets the nop handler to
+     * cause it to return to this function ASAP.
+     */
+    for ( i = 0; i < nr_cpu_ids; i++ )
+    {
+        if ( idt_tables[i] == NULL )
+            continue;
+
+        if ( i == cpu )
+        {
+            /*
+             * Disable the interrupt stack tables for this cpu's MCE and NMI 
+             * handlers, and alter the NMI handler to have no operation.  
+             * Disabling the stack tables prevents stack corruption race 
+             * conditions, while changing the handler helps prevent cascading 
+             * faults; we are certainly going to crash by this point.
+             *
+             * This update is safe from a security point of view, as this pcpu 
+             * is never going to try to sysret back to a PV vcpu.
+             */
+            _set_gate_lower(&idt_tables[i][TRAP_nmi], 14, 0, &trap_nop);
+            set_ist(&idt_tables[i][TRAP_machine_check], IST_NONE);
+        }
+        else
+        {
+            /* Do not update stack table for other pcpus. */
+            _update_gate_addr_lower(&idt_tables[i][TRAP_nmi], &nmi_crash);
+        }
+    }
+
     /* Ensure the new callback function is set before sending out the NMI. */
     wmb();
 
diff -r 3dbd0a9be0cc -r f50aab21f9f2 xen/arch/x86/machine_kexec.c
--- a/xen/arch/x86/machine_kexec.c	Thu Dec 13 12:10:14 2012 +0000
+++ b/xen/arch/x86/machine_kexec.c	Thu Dec 13 14:39:31 2012 +0000
@@ -81,12 +81,34 @@ void machine_kexec(xen_kexec_image_t *im
         .base = (unsigned long)(boot_cpu_gdt_table - FIRST_RESERVED_GDT_ENTRY),
         .limit = LAST_RESERVED_GDT_BYTE
     };
+    int i;
 
     /* We are about to permenantly jump out of the Xen context into the kexec
      * purgatory code.  We really dont want to be still servicing interupts.
      */
     local_irq_disable();
 
+    /* Now regular interrupts are disabled, we need to reduce the impact
+     * of interrupts not disabled by 'cli'.
+     *
+     * The NMI handlers have already been set up nmi_shootdown_cpus().  All
+     * pcpus other than us have the nmi_crash handler, while we have the nop
+     * handler.
+     *
+     * The MCE handlers touch extensive areas of Xen code and data.  At this
+     * point, there is nothing we can usefully do, so set the nop handler.
+     */
+    for ( i = 0; i < nr_cpu_ids; i++ )
+    {
+        if ( idt_tables[i] == NULL )
+            continue;
+        _update_gate_addr_lower(&idt_tables[i][TRAP_machine_check], &trap_nop);
+    }
+
+    /* Explicitly enable NMIs on this CPU.  Some crashdump kernels do
+     * not like running with NMIs disabled. */
+    enable_nmis();
+
     /*
      * compat_machine_kexec() returns to idle pagetables, which requires us
      * to be running on a static GDT mapping (idle pagetables have no GDT
diff -r 3dbd0a9be0cc -r f50aab21f9f2 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Thu Dec 13 12:10:14 2012 +0000
+++ b/xen/arch/x86/x86_64/entry.S	Thu Dec 13 14:39:31 2012 +0000
@@ -635,11 +635,44 @@ ENTRY(nmi)
         movl  $TRAP_nmi,4(%rsp)
         jmp   handle_ist_exception
 
+ENTRY(nmi_crash)
+        pushq $0
+        movl $TRAP_nmi,4(%rsp)
+        SAVE_ALL
+        movq %rsp,%rdi
+        callq do_nmi_crash /* Does not return */
+        ud2
+
 ENTRY(machine_check)
         pushq $0
         movl  $TRAP_machine_check,4(%rsp)
         jmp   handle_ist_exception
 
+/* Enable NMIs.  No special register assumptions. Only %rax is not preserved. */
+ENTRY(enable_nmis)
+        movq  %rsp, %rax /* Grab RSP before pushing */
+
+        /* Set up stack frame */
+        pushq $0               /* SS */
+        pushq %rax             /* RSP */
+        pushfq                 /* RFLAGS */
+        pushq $__HYPERVISOR_CS /* CS */
+        leaq  1f(%rip),%rax
+        pushq %rax             /* RIP */
+
+        iretq /* Disable the hardware NMI latch */
+1:
+        retq
+
+/* No op trap handler.  Required for kexec crash path.  This is not
+ * declared with the ENTRY() macro to avoid wasted alignment space.
+ */
+.globl trap_nop
+trap_nop:
+        iretq
+
+
+
 .section .rodata, "a", @progbits
 
 ENTRY(exception_table)
diff -r 3dbd0a9be0cc -r f50aab21f9f2 xen/include/asm-x86/desc.h
--- a/xen/include/asm-x86/desc.h	Thu Dec 13 12:10:14 2012 +0000
+++ b/xen/include/asm-x86/desc.h	Thu Dec 13 14:39:31 2012 +0000
@@ -106,6 +106,21 @@ typedef struct {
     u64 a, b;
 } idt_entry_t;
 
+/* Write the lower 64 bits of an IDT Entry. This relies on the upper 32
+ * bits of the address not changing, which is a safe assumption as all
+ * functions we are likely to load will live inside the 1GB
+ * code/data/bss address range.
+ *
+ * Ideally, we would use cmpxchg16b, but this is not supported on some
+ * old AMD 64bit capable processors, and has no safe equivalent.
+ */
+static inline void _write_gate_lower(volatile idt_entry_t *gate,
+                                     const idt_entry_t *new)
+{
+    ASSERT(gate->b == new->b);
+    gate->a = new->a;
+}
+
 #define _set_gate(gate_addr,type,dpl,addr)               \
 do {                                                     \
     (gate_addr)->a = 0;                                  \
@@ -122,6 +137,36 @@ do {                                    
         (1UL << 47);                                     \
 } while (0)
 
+static inline void _set_gate_lower(idt_entry_t *gate, unsigned long type,
+                                   unsigned long dpl, void *addr)
+{
+    idt_entry_t idte;
+    idte.b = gate->b;
+    idte.a =
+        (((unsigned long)(addr) & 0xFFFF0000UL) << 32) |
+        ((unsigned long)(dpl) << 45) |
+        ((unsigned long)(type) << 40) |
+        ((unsigned long)(addr) & 0xFFFFUL) |
+        ((unsigned long)__HYPERVISOR_CS64 << 16) |
+        (1UL << 47);
+    _write_gate_lower(gate, &idte);
+}
+
+/* Update the lower half handler of an IDT Entry, without changing any
+ * other configuration. */
+static inline void _update_gate_addr_lower(idt_entry_t *gate, void *addr)
+{
+    idt_entry_t idte;
+    idte.a = gate->a;
+
+    idte.b = ((unsigned long)(addr) >> 32);
+    idte.a &= 0x0000FFFFFFFF0000ULL;
+    idte.a |= (((unsigned long)(addr) & 0xFFFF0000UL) << 32) |
+        ((unsigned long)(addr) & 0xFFFFUL);
+
+    _write_gate_lower(gate, &idte);
+}
+
 #define _set_tssldt_desc(desc,addr,limit,type)           \
 do {                                                     \
     (desc)[0].b = (desc)[1].b = 0;                       \
diff -r 3dbd0a9be0cc -r f50aab21f9f2 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Thu Dec 13 12:10:14 2012 +0000
+++ b/xen/include/asm-x86/processor.h	Thu Dec 13 14:39:31 2012 +0000
@@ -527,6 +527,7 @@ void do_ ## _name(struct cpu_user_regs *
 DECLARE_TRAP_HANDLER(divide_error);
 DECLARE_TRAP_HANDLER(debug);
 DECLARE_TRAP_HANDLER(nmi);
+DECLARE_TRAP_HANDLER(nmi_crash);
 DECLARE_TRAP_HANDLER(int3);
 DECLARE_TRAP_HANDLER(overflow);
 DECLARE_TRAP_HANDLER(bounds);
@@ -545,6 +546,9 @@ DECLARE_TRAP_HANDLER(alignment_check);
 DECLARE_TRAP_HANDLER(spurious_interrupt_bug);
 #undef DECLARE_TRAP_HANDLER
 
+void trap_nop(void);
+void enable_nmis(void);
+
 void syscall_enter(void);
 void sysenter_entry(void);
 void sysenter_eflags_saved(void);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGM-0002hc-E1; Fri, 14 Dec 2012 15:33:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGJ-0002gk-U5
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:20 +0000
Received: from [85.158.138.51:16436] by server-16.bemta-3.messagelabs.com id
	BE/E7-27634-AB64BC05; Fri, 14 Dec 2012 15:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1355499192!22582607!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1624 invoked from network); 14 Dec 2012 15:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGB-0006YX-Ey
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGB-0005cS-9o
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:11 +0000
Message-Id: <E1TjXGB-0005cS-9o@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/kexec: Change NMI and MCE
	handling on kexec path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andrew Cooper <andrew.cooper3@citrix.com>
# Date 1355409571 0
# Node ID f50aab21f9f2ca3411df7881b2b92293b3af3771
# Parent  3dbd0a9be0cc730a1869d2d82b0fd6286af35533
x86/kexec: Change NMI and MCE handling on kexec path

Experimentally, certain crash kernels will triple fault very early
after starting if started with NMIs disabled.  This was discovered
when experimenting with a debug keyhandler which deliberately created
a reentrant NMI, causing stack corruption.

Because of this discovered bug, and that the future changes to the NMI
handling will make the kexec path more fragile, take the time now to
bullet-proof the kexec behaviour to be safer in more circumstances.

This patch adds three new low level routines:
 * nmi_crash
    This is a special NMI handler for using during a kexec crash.
 * enable_nmis
    This function enables NMIs by executing an iret-to-self, to
    disengage the hardware NMI latch.
 * trap_nop
    This is a no op handler which irets immediately.  It is not
    declared
    with ENTRY() to avoid the extra alignment overhead.

And adds three new IDT entry helper routines:
 * _write_gate_lower
    This is a substitute for using cmpxchg16b to update a 128bit
    structure at once.  It assumes that the top 64 bits are unchanged
    (and ASSERT()s the fact) and performs a regular write on the lower
    64 bits.
 * _set_gate_lower
    This is functionally equivalent to the already present
    _set_gate(), except it uses _write_gate_lower rather than updating
    both 64bit values.
 * _update_gate_addr_lower
    This is designed to update an IDT entry handler only, without
    altering any other settings in the entry.  It also uses
    _write_gate_lower.

The IDT entry helpers are required because:
  * Is it unsafe to attempt a disable/update/re-enable cycle on the
    NMI or MCE IDT entries.
  * We need to be able to update NMI handlers without changing the IST
    entry.

As a result, the new behaviour of the kexec_crash path is:

nmi_shootdown_cpus() will:

 * Disable the crashing cpus NMI/MCE interrupt stack tables.
    Disabling the stack tables removes race conditions which would
    lead
    to corrupt exception frames and infinite loops.  As this pcpu is
    never planning to execute a sysret back to a pv vcpu, the update
    is
    safe from a security point of view.

 * Swap the NMI trap handlers.
    The crashing pcpu gets the nop handler, to prevent it getting
    stuck in
    an NMI context, causing a hang instead of crash.  The non-crashing
    pcpus all get the nmi_crash handler which is designed never to
    return.

do_nmi_crash() will:

 * Save the crash notes and shut the pcpu down.
    There is now an extra per-cpu variable to prevent us from
    executing this multiple times.  In the case where we reenter
    midway through, attempt the whole operation again in preference to
    not completing it in the first place.

 * Set up another NMI at the LAPIC.
    Even when the LAPIC has been disabled, the ID and command
    registers are still usable.  As a result, we can deliberately
    queue up a new NMI to re-interrupt us later if NMIs get unlatched.
    Because of the call to __stop_this_cpu(), we have to hand craft
    self_nmi() to be safe from General Protection Faults.

 * Fall into infinite loop.

machine_kexec() will:

  * Swap the MCE handlers to be a nop.
     We cannot prevent MCEs from being delivered when we pass off to
     the crash kernel, and the less Xen context is being touched the
     better.

  * Explicitly enable NMIs.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>

Minor style changes.

Signed-off-by: Keir Fraser <keir@xen.org>

Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 3dbd0a9be0cc -r f50aab21f9f2 xen/arch/x86/crash.c
--- a/xen/arch/x86/crash.c	Thu Dec 13 12:10:14 2012 +0000
+++ b/xen/arch/x86/crash.c	Thu Dec 13 14:39:31 2012 +0000
@@ -32,41 +32,130 @@
 
 static atomic_t waiting_for_crash_ipi;
 static unsigned int crashing_cpu;
+static DEFINE_PER_CPU_READ_MOSTLY(bool_t, crash_save_done);
 
-static int crash_nmi_callback(struct cpu_user_regs *regs, int cpu)
+/* This becomes the NMI handler for non-crashing CPUs, when Xen is crashing. */
+void __attribute__((noreturn)) do_nmi_crash(struct cpu_user_regs *regs)
 {
-    /* Don't do anything if this handler is invoked on crashing cpu.
-     * Otherwise, system will completely hang. Crashing cpu can get
-     * an NMI if system was initially booted with nmi_watchdog parameter.
+    int cpu = smp_processor_id();
+
+    /* nmi_shootdown_cpus() should ensure that this assertion is correct. */
+    ASSERT(cpu != crashing_cpu);
+
+    /* Save crash information and shut down CPU.  Attempt only once. */
+    if ( !this_cpu(crash_save_done) )
+    {
+        /* Disable the interrupt stack table for the MCE handler.  This
+         * prevents race conditions between clearing MCIP and receving a
+         * new MCE, during which the exception frame would be clobbered
+         * and the MCE handler fall into an infinite loop.  We are soon
+         * going to disable the NMI watchdog, so the loop would not be
+         * caught.
+         *
+         * We do not need to change the NMI IST, as the nmi_crash
+         * handler is immue to corrupt exception frames, by virtue of
+         * being designed never to return.
+         *
+         * This update is safe from a security point of view, as this
+         * pcpu is never going to try to sysret back to a PV vcpu.
+         */
+        set_ist(&idt_tables[cpu][TRAP_machine_check], IST_NONE);
+
+        kexec_crash_save_cpu();
+        __stop_this_cpu();
+
+        this_cpu(crash_save_done) = 1;
+        atomic_dec(&waiting_for_crash_ipi);
+    }
+
+    /* Poor mans self_nmi().  __stop_this_cpu() has reverted the LAPIC
+     * back to its boot state, so we are unable to rely on the regular
+     * apic_* functions, due to 'x2apic_enabled' being possibly wrong.
+     * (The likely scenario is that we have reverted from x2apic mode to
+     * xapic, at which point #GPFs will occur if we use the apic_*
+     * functions)
+     *
+     * The ICR and APIC ID of the LAPIC are still valid even during
+     * software disable (Intel SDM Vol 3, 10.4.7.2).  As a result, we
+     * can deliberately queue up another NMI at the LAPIC which will not
+     * be delivered as the hardware NMI latch is currently in effect.
+     * This means that if NMIs become unlatched (e.g. following a
+     * non-fatal MCE), the LAPIC will force us back here rather than
+     * wandering back into regular Xen code.
      */
-    if ( cpu == crashing_cpu )
-        return 1;
-    local_irq_disable();
+    switch ( current_local_apic_mode() )
+    {
+        u32 apic_id;
 
-    kexec_crash_save_cpu();
+    case APIC_MODE_X2APIC:
+        apic_id = apic_rdmsr(APIC_ID);
 
-    __stop_this_cpu();
+        apic_wrmsr(APIC_ICR, APIC_DM_NMI | APIC_DEST_PHYSICAL
+                   | ((u64)apic_id << 32));
+        break;
 
-    atomic_dec(&waiting_for_crash_ipi);
+    case APIC_MODE_XAPIC:
+        apic_id = GET_xAPIC_ID(apic_mem_read(APIC_ID));
+
+        while ( apic_mem_read(APIC_ICR) & APIC_ICR_BUSY )
+            cpu_relax();
+
+        apic_mem_write(APIC_ICR2, apic_id << 24);
+        apic_mem_write(APIC_ICR, APIC_DM_NMI | APIC_DEST_PHYSICAL);
+        break;
+
+    default:
+        break;
+    }
 
     for ( ; ; )
         halt();
-
-    return 1;
 }
 
 static void nmi_shootdown_cpus(void)
 {
     unsigned long msecs;
+    int i, cpu = smp_processor_id();
 
     local_irq_disable();
 
-    crashing_cpu = smp_processor_id();
+    crashing_cpu = cpu;
     local_irq_count(crashing_cpu) = 0;
 
     atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
-    /* Would it be better to replace the trap vector here? */
-    set_nmi_callback(crash_nmi_callback);
+
+    /* Change NMI trap handlers.  Non-crashing pcpus get nmi_crash which
+     * invokes do_nmi_crash (above), which cause them to write state and
+     * fall into a loop.  The crashing pcpu gets the nop handler to
+     * cause it to return to this function ASAP.
+     */
+    for ( i = 0; i < nr_cpu_ids; i++ )
+    {
+        if ( idt_tables[i] == NULL )
+            continue;
+
+        if ( i == cpu )
+        {
+            /*
+             * Disable the interrupt stack tables for this cpu's MCE and NMI 
+             * handlers, and alter the NMI handler to have no operation.  
+             * Disabling the stack tables prevents stack corruption race 
+             * conditions, while changing the handler helps prevent cascading 
+             * faults; we are certainly going to crash by this point.
+             *
+             * This update is safe from a security point of view, as this pcpu 
+             * is never going to try to sysret back to a PV vcpu.
+             */
+            _set_gate_lower(&idt_tables[i][TRAP_nmi], 14, 0, &trap_nop);
+            set_ist(&idt_tables[i][TRAP_machine_check], IST_NONE);
+        }
+        else
+        {
+            /* Do not update stack table for other pcpus. */
+            _update_gate_addr_lower(&idt_tables[i][TRAP_nmi], &nmi_crash);
+        }
+    }
+
     /* Ensure the new callback function is set before sending out the NMI. */
     wmb();
 
diff -r 3dbd0a9be0cc -r f50aab21f9f2 xen/arch/x86/machine_kexec.c
--- a/xen/arch/x86/machine_kexec.c	Thu Dec 13 12:10:14 2012 +0000
+++ b/xen/arch/x86/machine_kexec.c	Thu Dec 13 14:39:31 2012 +0000
@@ -81,12 +81,34 @@ void machine_kexec(xen_kexec_image_t *im
         .base = (unsigned long)(boot_cpu_gdt_table - FIRST_RESERVED_GDT_ENTRY),
         .limit = LAST_RESERVED_GDT_BYTE
     };
+    int i;
 
     /* We are about to permenantly jump out of the Xen context into the kexec
      * purgatory code.  We really dont want to be still servicing interupts.
      */
     local_irq_disable();
 
+    /* Now regular interrupts are disabled, we need to reduce the impact
+     * of interrupts not disabled by 'cli'.
+     *
+     * The NMI handlers have already been set up nmi_shootdown_cpus().  All
+     * pcpus other than us have the nmi_crash handler, while we have the nop
+     * handler.
+     *
+     * The MCE handlers touch extensive areas of Xen code and data.  At this
+     * point, there is nothing we can usefully do, so set the nop handler.
+     */
+    for ( i = 0; i < nr_cpu_ids; i++ )
+    {
+        if ( idt_tables[i] == NULL )
+            continue;
+        _update_gate_addr_lower(&idt_tables[i][TRAP_machine_check], &trap_nop);
+    }
+
+    /* Explicitly enable NMIs on this CPU.  Some crashdump kernels do
+     * not like running with NMIs disabled. */
+    enable_nmis();
+
     /*
      * compat_machine_kexec() returns to idle pagetables, which requires us
      * to be running on a static GDT mapping (idle pagetables have no GDT
diff -r 3dbd0a9be0cc -r f50aab21f9f2 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S	Thu Dec 13 12:10:14 2012 +0000
+++ b/xen/arch/x86/x86_64/entry.S	Thu Dec 13 14:39:31 2012 +0000
@@ -635,11 +635,44 @@ ENTRY(nmi)
         movl  $TRAP_nmi,4(%rsp)
         jmp   handle_ist_exception
 
+ENTRY(nmi_crash)
+        pushq $0
+        movl $TRAP_nmi,4(%rsp)
+        SAVE_ALL
+        movq %rsp,%rdi
+        callq do_nmi_crash /* Does not return */
+        ud2
+
 ENTRY(machine_check)
         pushq $0
         movl  $TRAP_machine_check,4(%rsp)
         jmp   handle_ist_exception
 
+/* Enable NMIs.  No special register assumptions. Only %rax is not preserved. */
+ENTRY(enable_nmis)
+        movq  %rsp, %rax /* Grab RSP before pushing */
+
+        /* Set up stack frame */
+        pushq $0               /* SS */
+        pushq %rax             /* RSP */
+        pushfq                 /* RFLAGS */
+        pushq $__HYPERVISOR_CS /* CS */
+        leaq  1f(%rip),%rax
+        pushq %rax             /* RIP */
+
+        iretq /* Disable the hardware NMI latch */
+1:
+        retq
+
+/* No op trap handler.  Required for kexec crash path.  This is not
+ * declared with the ENTRY() macro to avoid wasted alignment space.
+ */
+.globl trap_nop
+trap_nop:
+        iretq
+
+
+
 .section .rodata, "a", @progbits
 
 ENTRY(exception_table)
diff -r 3dbd0a9be0cc -r f50aab21f9f2 xen/include/asm-x86/desc.h
--- a/xen/include/asm-x86/desc.h	Thu Dec 13 12:10:14 2012 +0000
+++ b/xen/include/asm-x86/desc.h	Thu Dec 13 14:39:31 2012 +0000
@@ -106,6 +106,21 @@ typedef struct {
     u64 a, b;
 } idt_entry_t;
 
+/* Write the lower 64 bits of an IDT Entry. This relies on the upper 32
+ * bits of the address not changing, which is a safe assumption as all
+ * functions we are likely to load will live inside the 1GB
+ * code/data/bss address range.
+ *
+ * Ideally, we would use cmpxchg16b, but this is not supported on some
+ * old AMD 64bit capable processors, and has no safe equivalent.
+ */
+static inline void _write_gate_lower(volatile idt_entry_t *gate,
+                                     const idt_entry_t *new)
+{
+    ASSERT(gate->b == new->b);
+    gate->a = new->a;
+}
+
 #define _set_gate(gate_addr,type,dpl,addr)               \
 do {                                                     \
     (gate_addr)->a = 0;                                  \
@@ -122,6 +137,36 @@ do {                                    
         (1UL << 47);                                     \
 } while (0)
 
+static inline void _set_gate_lower(idt_entry_t *gate, unsigned long type,
+                                   unsigned long dpl, void *addr)
+{
+    idt_entry_t idte;
+    idte.b = gate->b;
+    idte.a =
+        (((unsigned long)(addr) & 0xFFFF0000UL) << 32) |
+        ((unsigned long)(dpl) << 45) |
+        ((unsigned long)(type) << 40) |
+        ((unsigned long)(addr) & 0xFFFFUL) |
+        ((unsigned long)__HYPERVISOR_CS64 << 16) |
+        (1UL << 47);
+    _write_gate_lower(gate, &idte);
+}
+
+/* Update the lower half handler of an IDT Entry, without changing any
+ * other configuration. */
+static inline void _update_gate_addr_lower(idt_entry_t *gate, void *addr)
+{
+    idt_entry_t idte;
+    idte.a = gate->a;
+
+    idte.b = ((unsigned long)(addr) >> 32);
+    idte.a &= 0x0000FFFFFFFF0000ULL;
+    idte.a |= (((unsigned long)(addr) & 0xFFFF0000UL) << 32) |
+        ((unsigned long)(addr) & 0xFFFFUL);
+
+    _write_gate_lower(gate, &idte);
+}
+
 #define _set_tssldt_desc(desc,addr,limit,type)           \
 do {                                                     \
     (desc)[0].b = (desc)[1].b = 0;                       \
diff -r 3dbd0a9be0cc -r f50aab21f9f2 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Thu Dec 13 12:10:14 2012 +0000
+++ b/xen/include/asm-x86/processor.h	Thu Dec 13 14:39:31 2012 +0000
@@ -527,6 +527,7 @@ void do_ ## _name(struct cpu_user_regs *
 DECLARE_TRAP_HANDLER(divide_error);
 DECLARE_TRAP_HANDLER(debug);
 DECLARE_TRAP_HANDLER(nmi);
+DECLARE_TRAP_HANDLER(nmi_crash);
 DECLARE_TRAP_HANDLER(int3);
 DECLARE_TRAP_HANDLER(overflow);
 DECLARE_TRAP_HANDLER(bounds);
@@ -545,6 +546,9 @@ DECLARE_TRAP_HANDLER(alignment_check);
 DECLARE_TRAP_HANDLER(spurious_interrupt_bug);
 #undef DECLARE_TRAP_HANDLER
 
+void trap_nop(void);
+void enable_nmis(void);
+
 void syscall_enter(void);
 void sysenter_entry(void);
 void sysenter_eflags_saved(void);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGL-0002h4-8y; Fri, 14 Dec 2012 15:33:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGJ-0002gi-Hr
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:19 +0000
Received: from [85.158.138.51:16380] by server-12.bemta-3.messagelabs.com id
	A2/F4-27559-9B64BC05; Fri, 14 Dec 2012 15:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1355499191!20792411!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27975 invoked from network); 14 Dec 2012 15:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGA-0006YU-Tb
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGA-0005cD-Nz
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:10 +0000
Message-Id: <E1TjXGA-0005cD-Nz@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm/hap: Adjust vram tracking to
	play nicely with log-dirty.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Robert Phillips <robert.phillips@citrix.com>
# Date 1355400614 0
# Node ID 3dbd0a9be0cc730a1869d2d82b0fd6286af35533
# Parent  c91d9f6b6fbae56d64f9a5c1803f2709e1661f09
x86/mm/hap: Adjust vram tracking to play nicely with log-dirty.

The previous code assumed the guest would be in one of three mutually exclusive
modes for bookkeeping dirty pages: (1) shadow, (2) hap utilizing the log dirty
bitmap to support functionality such as live migrate, (3) hap utilizing the
log dirty bitmap to track dirty vram pages.
Races arose when a guest attempted to track dirty vram while performing live
migrate.  (The dispatch table managed by paging_log_dirty_init() might change
in the middle of a log dirty or a vram tracking function.)

This change allows hap log dirty and hap vram tracking to be concurrent.
Vram tracking no longer uses the log dirty bitmap.  Instead it detects
dirty vram pages by examining their p2m type.  The log dirty bitmap is only
used by the log dirty code.  Because the two operations use different
mechanisms, they are no longer mutually exclusive.

Signed-Off-By: Robert Phillips <robert.phillips@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>

Minor whitespace changes to conform with coding style
Signed-off-by: Tim Deegan <tim@xen.org>

Committed-by: Tim Deegan <tim@xen.org>
---


diff -r c91d9f6b6fba -r 3dbd0a9be0cc xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Dec 13 11:44:02 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Dec 13 12:10:14 2012 +0000
@@ -56,133 +56,111 @@
 /*          HAP VRAM TRACKING SUPPORT           */
 /************************************************/
 
-static int hap_enable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    /* turn on PG_log_dirty bit in paging mode */
-    paging_lock(d);
-    d->arch.paging.mode |= PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static int hap_disable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    paging_lock(d);
-    d->arch.paging.mode &= ~PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table with normal mode */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_logdirty, p2m_ram_rw);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static void hap_clean_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return;
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-}
-
-static void hap_vram_tracking_init(struct domain *d)
-{
-    paging_log_dirty_init(d, hap_enable_vram_tracking,
-                          hap_disable_vram_tracking,
-                          hap_clean_vram_tracking);
-}
+/*
+ * hap_track_dirty_vram()
+ * Create the domain's dv_dirty_vram struct on demand.
+ * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] is
+ * first encountered.
+ * Collect the guest_dirty bitmask, a bit mask of the dirty vram pages, by
+ * calling paging_log_dirty_range(), which interrogates each vram
+ * page's p2m type looking for pages that have been made writable.
+ */
 
 int hap_track_dirty_vram(struct domain *d,
                          unsigned long begin_pfn,
                          unsigned long nr,
-                         XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
+                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
 {
     long rc = 0;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct sh_dirty_vram *dirty_vram;
+    uint8_t *dirty_bitmap = NULL;
 
     if ( nr )
     {
-        if ( paging_mode_log_dirty(d) && dirty_vram )
+        int size = (nr + BITS_PER_BYTE - 1) / BITS_PER_BYTE;
+
+        if ( !paging_mode_log_dirty(d) )
         {
-            if ( begin_pfn != dirty_vram->begin_pfn ||
-                 begin_pfn + nr != dirty_vram->end_pfn )
-            {
-                paging_log_dirty_disable(d);
-                dirty_vram->begin_pfn = begin_pfn;
-                dirty_vram->end_pfn = begin_pfn + nr;
-                rc = paging_log_dirty_enable(d);
-                if (rc != 0)
-                    goto param_fail;
-            }
+            hap_logdirty_init(d);
+            rc = paging_log_dirty_enable(d);
+            if ( rc )
+                goto out;
         }
-        else if ( !paging_mode_log_dirty(d) && !dirty_vram )
+
+        rc = -ENOMEM;
+        dirty_bitmap = xzalloc_bytes(size);
+        if ( !dirty_bitmap )
+            goto out;
+
+        paging_lock(d);
+
+        dirty_vram = d->arch.hvm_domain.dirty_vram;
+        if ( !dirty_vram )
         {
             rc = -ENOMEM;
-            if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-                goto param_fail;
+            if ( (dirty_vram = xzalloc(struct sh_dirty_vram)) == NULL )
+            {
+                paging_unlock(d);
+                goto out;
+            }
 
+            d->arch.hvm_domain.dirty_vram = dirty_vram;
+        }
+
+        if ( begin_pfn != dirty_vram->begin_pfn ||
+             begin_pfn + nr != dirty_vram->end_pfn )
+        {
             dirty_vram->begin_pfn = begin_pfn;
             dirty_vram->end_pfn = begin_pfn + nr;
-            d->arch.hvm_domain.dirty_vram = dirty_vram;
-            hap_vram_tracking_init(d);
-            rc = paging_log_dirty_enable(d);
-            if (rc != 0)
-                goto param_fail;
+
+            paging_unlock(d);
+
+            /* set l1e entries of range within P2M table to be read-only. */
+            p2m_change_type_range(d, begin_pfn, begin_pfn + nr,
+                                  p2m_ram_rw, p2m_ram_logdirty);
+
+            flush_tlb_mask(d->domain_dirty_cpumask);
+
+            memset(dirty_bitmap, 0xff, size); /* consider all pages dirty */
         }
         else
         {
-            if ( !paging_mode_log_dirty(d) && dirty_vram )
-                rc = -EINVAL;
-            else
-                rc = -ENODATA;
-            goto param_fail;
+            paging_unlock(d);
+
+            domain_pause(d);
+
+            /* get the bitmap */
+            paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
+
+            domain_unpause(d);
         }
-        /* get the bitmap */
-        rc = paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
+
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap, dirty_bitmap, size) == 0 )
+            rc = 0;
     }
     else
     {
-        if ( paging_mode_log_dirty(d) && dirty_vram ) {
-            rc = paging_log_dirty_disable(d);
+        paging_lock(d);
+
+        dirty_vram = d->arch.hvm_domain.dirty_vram;
+        if ( dirty_vram )
+        {
+            /*
+             * If zero pages specified while tracking dirty vram
+             * then stop tracking
+             */
             xfree(dirty_vram);
-            dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-        } else
-            rc = 0;
+            d->arch.hvm_domain.dirty_vram = NULL;
+        }
+
+        paging_unlock(d);
     }
+out:
+    if ( dirty_bitmap )
+        xfree(dirty_bitmap);
 
     return rc;
-
-param_fail:
-    if ( dirty_vram )
-    {
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
-    return rc;
 }
 
 /************************************************/
@@ -223,13 +201,6 @@ static void hap_clean_dirty_bitmap(struc
 
 void hap_logdirty_init(struct domain *d)
 {
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-    if ( paging_mode_log_dirty(d) && dirty_vram )
-    {
-        paging_log_dirty_disable(d);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
 
     /* Reinitialize logdirty mechanism */
     paging_log_dirty_init(d, hap_enable_log_dirty,
diff -r c91d9f6b6fba -r 3dbd0a9be0cc xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Thu Dec 13 11:44:02 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Thu Dec 13 12:10:14 2012 +0000
@@ -437,157 +437,38 @@ int paging_log_dirty_op(struct domain *d
     return rv;
 }
 
-int paging_log_dirty_range(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
+void paging_log_dirty_range(struct domain *d,
+                           unsigned long begin_pfn,
+                           unsigned long nr,
+                           uint8_t *dirty_bitmap)
 {
-    int rv = 0;
-    unsigned long pages = 0;
-    mfn_t *l4, *l3, *l2;
-    unsigned long *l1;
-    int b1, b2, b3, b4;
-    int i2, i3, i4;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    int i;
+    unsigned long pfn;
 
-    d->arch.paging.log_dirty.clean_dirty_bitmap(d);
-    paging_lock(d);
+    /*
+     * Set l1e entries of P2M table to be read-only.
+     *
+     * On first write, it page faults, its entry is changed to read-write,
+     * and on retry the write succeeds.
+     *
+     * We populate dirty_bitmap by looking for entries that have been
+     * switched to read-write.
+     */
 
-    PAGING_DEBUG(LOGDIRTY, "log-dirty-range: dom %u faults=%u dirty=%u\n",
-                 d->domain_id,
-                 d->arch.paging.log_dirty.fault_count,
-                 d->arch.paging.log_dirty.dirty_count);
+    p2m_lock(p2m);
 
-    if ( unlikely(d->arch.paging.log_dirty.failed_allocs) ) {
-        printk("%s: %d failed page allocs while logging dirty pages\n",
-               __FUNCTION__, d->arch.paging.log_dirty.failed_allocs);
-        rv = -ENOMEM;
-        goto out;
+    for ( i = 0, pfn = begin_pfn; pfn < begin_pfn + nr; i++, pfn++ )
+    {
+        p2m_type_t pt;
+        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
+        if ( pt == p2m_ram_rw )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
     }
 
-    if ( !d->arch.paging.log_dirty.fault_count &&
-         !d->arch.paging.log_dirty.dirty_count ) {
-        unsigned int size = BITS_TO_LONGS(nr);
+    p2m_unlock(p2m);
 
-        if ( clear_guest(dirty_bitmap, size * BYTES_PER_LONG) != 0 )
-            rv = -EFAULT;
-        goto out;
-    }
-    d->arch.paging.log_dirty.fault_count = 0;
-    d->arch.paging.log_dirty.dirty_count = 0;
-
-    b1 = L1_LOGDIRTY_IDX(begin_pfn);
-    b2 = L2_LOGDIRTY_IDX(begin_pfn);
-    b3 = L3_LOGDIRTY_IDX(begin_pfn);
-    b4 = L4_LOGDIRTY_IDX(begin_pfn);
-    l4 = paging_map_log_dirty_bitmap(d);
-
-    for ( i4 = b4;
-          (pages < nr) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
-    {
-        l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = b3;
-              (pages < nr) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
-        {
-            l2 = ((l3 && mfn_valid(l3[i3])) ?
-                  map_domain_page(mfn_x(l3[i3])) : NULL);
-            for ( i2 = b2;
-                  (pages < nr) && (i2 < LOGDIRTY_NODE_ENTRIES);
-                  i2++ )
-            {
-                unsigned int bytes = PAGE_SIZE;
-                uint8_t *s;
-                l1 = ((l2 && mfn_valid(l2[i2])) ?
-                      map_domain_page(mfn_x(l2[i2])) : NULL);
-
-                s = ((uint8_t*)l1) + (b1 >> 3);
-                bytes -= b1 >> 3;
-
-                if ( likely(((nr - pages + 7) >> 3) < bytes) )
-                    bytes = (unsigned int)((nr - pages + 7) >> 3);
-
-                if ( !l1 )
-                {
-                    if ( clear_guest_offset(dirty_bitmap, pages >> 3,
-                                            bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                /* begin_pfn is not 32K aligned, hence we have to bit
-                 * shift the bitmap */
-                else if ( b1 & 0x7 )
-                {
-                    int i, j;
-                    uint32_t *l = (uint32_t*) s;
-                    int bits = b1 & 0x7;
-                    int bitmask = (1 << bits) - 1;
-                    int size = (bytes + BYTES_PER_LONG - 1) / BYTES_PER_LONG;
-                    unsigned long bitmap[size];
-                    static unsigned long printed = 0;
-
-                    if ( printed != begin_pfn )
-                    {
-                        dprintk(XENLOG_DEBUG, "%s: begin_pfn %lx is not 32K aligned!\n",
-                                __FUNCTION__, begin_pfn);
-                        printed = begin_pfn;
-                    }
-
-                    for ( i = 0; i < size - 1; i++, l++ ) {
-                        bitmap[i] = ((*l) >> bits) |
-                            (((*((uint8_t*)(l + 1))) & bitmask) << (sizeof(*l) * 8 - bits));
-                    }
-                    s = (uint8_t*) l;
-                    size = BYTES_PER_LONG - ((b1 >> 3) & 0x3);
-                    bitmap[i] = 0;
-                    for ( j = 0; j < size; j++, s++ )
-                        bitmap[i] |= (*s) << (j * 8);
-                    bitmap[i] = (bitmap[i] >> bits) | (bitmask << (size * 8 - bits));
-                    if ( copy_to_guest_offset(dirty_bitmap, (pages >> 3),
-                                (uint8_t*) bitmap, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                else
-                {
-                    if ( copy_to_guest_offset(dirty_bitmap, pages >> 3,
-                                              s, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-
-                pages += bytes << 3;
-                if ( l1 )
-                {
-                    clear_page(l1);
-                    unmap_domain_page(l1);
-                }
-                b1 = b1 & 0x7;
-            }
-            b2 = 0;
-            if ( l2 )
-                unmap_domain_page(l2);
-        }
-        b3 = 0;
-        if ( l3 )
-            unmap_domain_page(l3);
-    }
-    if ( l4 )
-        unmap_domain_page(l4);
-
-    paging_unlock(d);
-
-    return rv;
-
- out:
-    paging_unlock(d);
-    return rv;
+    flush_tlb_mask(d->domain_dirty_cpumask);
 }
 
 /* Note that this function takes three function pointers. Callers must supply
diff -r c91d9f6b6fba -r 3dbd0a9be0cc xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Thu Dec 13 11:44:02 2012 +0000
+++ b/xen/include/asm-x86/config.h	Thu Dec 13 12:10:14 2012 +0000
@@ -12,6 +12,7 @@
 
 #define BYTES_PER_LONG (1 << LONG_BYTEORDER)
 #define BITS_PER_LONG (BYTES_PER_LONG << 3)
+#define BITS_PER_BYTE 8
 
 #define CONFIG_X86 1
 #define CONFIG_X86_HT 1
diff -r c91d9f6b6fba -r 3dbd0a9be0cc xen/include/asm-x86/paging.h
--- a/xen/include/asm-x86/paging.h	Thu Dec 13 11:44:02 2012 +0000
+++ b/xen/include/asm-x86/paging.h	Thu Dec 13 12:10:14 2012 +0000
@@ -137,10 +137,10 @@ struct paging_mode {
 void paging_free_log_dirty_bitmap(struct domain *d);
 
 /* get the dirty bitmap for a specific range of pfns */
-int paging_log_dirty_range(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+void paging_log_dirty_range(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            uint8_t *dirty_bitmap);
 
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGL-0002h4-8y; Fri, 14 Dec 2012 15:33:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGJ-0002gi-Hr
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:19 +0000
Received: from [85.158.138.51:16380] by server-12.bemta-3.messagelabs.com id
	A2/F4-27559-9B64BC05; Fri, 14 Dec 2012 15:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1355499191!20792411!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27975 invoked from network); 14 Dec 2012 15:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGA-0006YU-Tb
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGA-0005cD-Nz
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:10 +0000
Message-Id: <E1TjXGA-0005cD-Nz@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm/hap: Adjust vram tracking to
	play nicely with log-dirty.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Robert Phillips <robert.phillips@citrix.com>
# Date 1355400614 0
# Node ID 3dbd0a9be0cc730a1869d2d82b0fd6286af35533
# Parent  c91d9f6b6fbae56d64f9a5c1803f2709e1661f09
x86/mm/hap: Adjust vram tracking to play nicely with log-dirty.

The previous code assumed the guest would be in one of three mutually exclusive
modes for bookkeeping dirty pages: (1) shadow, (2) hap utilizing the log dirty
bitmap to support functionality such as live migrate, (3) hap utilizing the
log dirty bitmap to track dirty vram pages.
Races arose when a guest attempted to track dirty vram while performing live
migrate.  (The dispatch table managed by paging_log_dirty_init() might change
in the middle of a log dirty or a vram tracking function.)

This change allows hap log dirty and hap vram tracking to be concurrent.
Vram tracking no longer uses the log dirty bitmap.  Instead it detects
dirty vram pages by examining their p2m type.  The log dirty bitmap is only
used by the log dirty code.  Because the two operations use different
mechanisms, they are no longer mutually exclusive.

Signed-Off-By: Robert Phillips <robert.phillips@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>

Minor whitespace changes to conform with coding style
Signed-off-by: Tim Deegan <tim@xen.org>

Committed-by: Tim Deegan <tim@xen.org>
---


diff -r c91d9f6b6fba -r 3dbd0a9be0cc xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Dec 13 11:44:02 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Dec 13 12:10:14 2012 +0000
@@ -56,133 +56,111 @@
 /*          HAP VRAM TRACKING SUPPORT           */
 /************************************************/
 
-static int hap_enable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    /* turn on PG_log_dirty bit in paging mode */
-    paging_lock(d);
-    d->arch.paging.mode |= PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static int hap_disable_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return -EINVAL;
-
-    paging_lock(d);
-    d->arch.paging.mode &= ~PG_log_dirty;
-    paging_unlock(d);
-
-    /* set l1e entries of P2M table with normal mode */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_logdirty, p2m_ram_rw);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-    return 0;
-}
-
-static void hap_clean_vram_tracking(struct domain *d)
-{
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-
-    if ( !dirty_vram )
-        return;
-
-    /* set l1e entries of P2M table to be read-only. */
-    p2m_change_type_range(d, dirty_vram->begin_pfn, dirty_vram->end_pfn, 
-                          p2m_ram_rw, p2m_ram_logdirty);
-
-    flush_tlb_mask(d->domain_dirty_cpumask);
-}
-
-static void hap_vram_tracking_init(struct domain *d)
-{
-    paging_log_dirty_init(d, hap_enable_vram_tracking,
-                          hap_disable_vram_tracking,
-                          hap_clean_vram_tracking);
-}
+/*
+ * hap_track_dirty_vram()
+ * Create the domain's dv_dirty_vram struct on demand.
+ * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] is
+ * first encountered.
+ * Collect the guest_dirty bitmask, a bit mask of the dirty vram pages, by
+ * calling paging_log_dirty_range(), which interrogates each vram
+ * page's p2m type looking for pages that have been made writable.
+ */
 
 int hap_track_dirty_vram(struct domain *d,
                          unsigned long begin_pfn,
                          unsigned long nr,
-                         XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
+                         XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
 {
     long rc = 0;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
+    struct sh_dirty_vram *dirty_vram;
+    uint8_t *dirty_bitmap = NULL;
 
     if ( nr )
     {
-        if ( paging_mode_log_dirty(d) && dirty_vram )
+        int size = (nr + BITS_PER_BYTE - 1) / BITS_PER_BYTE;
+
+        if ( !paging_mode_log_dirty(d) )
         {
-            if ( begin_pfn != dirty_vram->begin_pfn ||
-                 begin_pfn + nr != dirty_vram->end_pfn )
-            {
-                paging_log_dirty_disable(d);
-                dirty_vram->begin_pfn = begin_pfn;
-                dirty_vram->end_pfn = begin_pfn + nr;
-                rc = paging_log_dirty_enable(d);
-                if (rc != 0)
-                    goto param_fail;
-            }
+            hap_logdirty_init(d);
+            rc = paging_log_dirty_enable(d);
+            if ( rc )
+                goto out;
         }
-        else if ( !paging_mode_log_dirty(d) && !dirty_vram )
+
+        rc = -ENOMEM;
+        dirty_bitmap = xzalloc_bytes(size);
+        if ( !dirty_bitmap )
+            goto out;
+
+        paging_lock(d);
+
+        dirty_vram = d->arch.hvm_domain.dirty_vram;
+        if ( !dirty_vram )
         {
             rc = -ENOMEM;
-            if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
-                goto param_fail;
+            if ( (dirty_vram = xzalloc(struct sh_dirty_vram)) == NULL )
+            {
+                paging_unlock(d);
+                goto out;
+            }
 
+            d->arch.hvm_domain.dirty_vram = dirty_vram;
+        }
+
+        if ( begin_pfn != dirty_vram->begin_pfn ||
+             begin_pfn + nr != dirty_vram->end_pfn )
+        {
             dirty_vram->begin_pfn = begin_pfn;
             dirty_vram->end_pfn = begin_pfn + nr;
-            d->arch.hvm_domain.dirty_vram = dirty_vram;
-            hap_vram_tracking_init(d);
-            rc = paging_log_dirty_enable(d);
-            if (rc != 0)
-                goto param_fail;
+
+            paging_unlock(d);
+
+            /* set l1e entries of range within P2M table to be read-only. */
+            p2m_change_type_range(d, begin_pfn, begin_pfn + nr,
+                                  p2m_ram_rw, p2m_ram_logdirty);
+
+            flush_tlb_mask(d->domain_dirty_cpumask);
+
+            memset(dirty_bitmap, 0xff, size); /* consider all pages dirty */
         }
         else
         {
-            if ( !paging_mode_log_dirty(d) && dirty_vram )
-                rc = -EINVAL;
-            else
-                rc = -ENODATA;
-            goto param_fail;
+            paging_unlock(d);
+
+            domain_pause(d);
+
+            /* get the bitmap */
+            paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
+
+            domain_unpause(d);
         }
-        /* get the bitmap */
-        rc = paging_log_dirty_range(d, begin_pfn, nr, dirty_bitmap);
+
+        rc = -EFAULT;
+        if ( copy_to_guest(guest_dirty_bitmap, dirty_bitmap, size) == 0 )
+            rc = 0;
     }
     else
     {
-        if ( paging_mode_log_dirty(d) && dirty_vram ) {
-            rc = paging_log_dirty_disable(d);
+        paging_lock(d);
+
+        dirty_vram = d->arch.hvm_domain.dirty_vram;
+        if ( dirty_vram )
+        {
+            /*
+             * If zero pages specified while tracking dirty vram
+             * then stop tracking
+             */
             xfree(dirty_vram);
-            dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-        } else
-            rc = 0;
+            d->arch.hvm_domain.dirty_vram = NULL;
+        }
+
+        paging_unlock(d);
     }
+out:
+    if ( dirty_bitmap )
+        xfree(dirty_bitmap);
 
     return rc;
-
-param_fail:
-    if ( dirty_vram )
-    {
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
-    return rc;
 }
 
 /************************************************/
@@ -223,13 +201,6 @@ static void hap_clean_dirty_bitmap(struc
 
 void hap_logdirty_init(struct domain *d)
 {
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram;
-    if ( paging_mode_log_dirty(d) && dirty_vram )
-    {
-        paging_log_dirty_disable(d);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm_domain.dirty_vram = NULL;
-    }
 
     /* Reinitialize logdirty mechanism */
     paging_log_dirty_init(d, hap_enable_log_dirty,
diff -r c91d9f6b6fba -r 3dbd0a9be0cc xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Thu Dec 13 11:44:02 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Thu Dec 13 12:10:14 2012 +0000
@@ -437,157 +437,38 @@ int paging_log_dirty_op(struct domain *d
     return rv;
 }
 
-int paging_log_dirty_range(struct domain *d,
-                            unsigned long begin_pfn,
-                            unsigned long nr,
-                            XEN_GUEST_HANDLE_64(uint8) dirty_bitmap)
+void paging_log_dirty_range(struct domain *d,
+                           unsigned long begin_pfn,
+                           unsigned long nr,
+                           uint8_t *dirty_bitmap)
 {
-    int rv = 0;
-    unsigned long pages = 0;
-    mfn_t *l4, *l3, *l2;
-    unsigned long *l1;
-    int b1, b2, b3, b4;
-    int i2, i3, i4;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    int i;
+    unsigned long pfn;
 
-    d->arch.paging.log_dirty.clean_dirty_bitmap(d);
-    paging_lock(d);
+    /*
+     * Set l1e entries of P2M table to be read-only.
+     *
+     * On first write, it page faults, its entry is changed to read-write,
+     * and on retry the write succeeds.
+     *
+     * We populate dirty_bitmap by looking for entries that have been
+     * switched to read-write.
+     */
 
-    PAGING_DEBUG(LOGDIRTY, "log-dirty-range: dom %u faults=%u dirty=%u\n",
-                 d->domain_id,
-                 d->arch.paging.log_dirty.fault_count,
-                 d->arch.paging.log_dirty.dirty_count);
+    p2m_lock(p2m);
 
-    if ( unlikely(d->arch.paging.log_dirty.failed_allocs) ) {
-        printk("%s: %d failed page allocs while logging dirty pages\n",
-               __FUNCTION__, d->arch.paging.log_dirty.failed_allocs);
-        rv = -ENOMEM;
-        goto out;
+    for ( i = 0, pfn = begin_pfn; pfn < begin_pfn + nr; i++, pfn++ )
+    {
+        p2m_type_t pt;
+        pt = p2m_change_type(d, pfn, p2m_ram_rw, p2m_ram_logdirty);
+        if ( pt == p2m_ram_rw )
+            dirty_bitmap[i >> 3] |= (1 << (i & 7));
     }
 
-    if ( !d->arch.paging.log_dirty.fault_count &&
-         !d->arch.paging.log_dirty.dirty_count ) {
-        unsigned int size = BITS_TO_LONGS(nr);
+    p2m_unlock(p2m);
 
-        if ( clear_guest(dirty_bitmap, size * BYTES_PER_LONG) != 0 )
-            rv = -EFAULT;
-        goto out;
-    }
-    d->arch.paging.log_dirty.fault_count = 0;
-    d->arch.paging.log_dirty.dirty_count = 0;
-
-    b1 = L1_LOGDIRTY_IDX(begin_pfn);
-    b2 = L2_LOGDIRTY_IDX(begin_pfn);
-    b3 = L3_LOGDIRTY_IDX(begin_pfn);
-    b4 = L4_LOGDIRTY_IDX(begin_pfn);
-    l4 = paging_map_log_dirty_bitmap(d);
-
-    for ( i4 = b4;
-          (pages < nr) && (i4 < LOGDIRTY_NODE_ENTRIES);
-          i4++ )
-    {
-        l3 = (l4 && mfn_valid(l4[i4])) ? map_domain_page(mfn_x(l4[i4])) : NULL;
-        for ( i3 = b3;
-              (pages < nr) && (i3 < LOGDIRTY_NODE_ENTRIES);
-              i3++ )
-        {
-            l2 = ((l3 && mfn_valid(l3[i3])) ?
-                  map_domain_page(mfn_x(l3[i3])) : NULL);
-            for ( i2 = b2;
-                  (pages < nr) && (i2 < LOGDIRTY_NODE_ENTRIES);
-                  i2++ )
-            {
-                unsigned int bytes = PAGE_SIZE;
-                uint8_t *s;
-                l1 = ((l2 && mfn_valid(l2[i2])) ?
-                      map_domain_page(mfn_x(l2[i2])) : NULL);
-
-                s = ((uint8_t*)l1) + (b1 >> 3);
-                bytes -= b1 >> 3;
-
-                if ( likely(((nr - pages + 7) >> 3) < bytes) )
-                    bytes = (unsigned int)((nr - pages + 7) >> 3);
-
-                if ( !l1 )
-                {
-                    if ( clear_guest_offset(dirty_bitmap, pages >> 3,
-                                            bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                /* begin_pfn is not 32K aligned, hence we have to bit
-                 * shift the bitmap */
-                else if ( b1 & 0x7 )
-                {
-                    int i, j;
-                    uint32_t *l = (uint32_t*) s;
-                    int bits = b1 & 0x7;
-                    int bitmask = (1 << bits) - 1;
-                    int size = (bytes + BYTES_PER_LONG - 1) / BYTES_PER_LONG;
-                    unsigned long bitmap[size];
-                    static unsigned long printed = 0;
-
-                    if ( printed != begin_pfn )
-                    {
-                        dprintk(XENLOG_DEBUG, "%s: begin_pfn %lx is not 32K aligned!\n",
-                                __FUNCTION__, begin_pfn);
-                        printed = begin_pfn;
-                    }
-
-                    for ( i = 0; i < size - 1; i++, l++ ) {
-                        bitmap[i] = ((*l) >> bits) |
-                            (((*((uint8_t*)(l + 1))) & bitmask) << (sizeof(*l) * 8 - bits));
-                    }
-                    s = (uint8_t*) l;
-                    size = BYTES_PER_LONG - ((b1 >> 3) & 0x3);
-                    bitmap[i] = 0;
-                    for ( j = 0; j < size; j++, s++ )
-                        bitmap[i] |= (*s) << (j * 8);
-                    bitmap[i] = (bitmap[i] >> bits) | (bitmask << (size * 8 - bits));
-                    if ( copy_to_guest_offset(dirty_bitmap, (pages >> 3),
-                                (uint8_t*) bitmap, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-                else
-                {
-                    if ( copy_to_guest_offset(dirty_bitmap, pages >> 3,
-                                              s, bytes) != 0 )
-                    {
-                        rv = -EFAULT;
-                        goto out;
-                    }
-                }
-
-                pages += bytes << 3;
-                if ( l1 )
-                {
-                    clear_page(l1);
-                    unmap_domain_page(l1);
-                }
-                b1 = b1 & 0x7;
-            }
-            b2 = 0;
-            if ( l2 )
-                unmap_domain_page(l2);
-        }
-        b3 = 0;
-        if ( l3 )
-            unmap_domain_page(l3);
-    }
-    if ( l4 )
-        unmap_domain_page(l4);
-
-    paging_unlock(d);
-
-    return rv;
-
- out:
-    paging_unlock(d);
-    return rv;
+    flush_tlb_mask(d->domain_dirty_cpumask);
 }
 
 /* Note that this function takes three function pointers. Callers must supply
diff -r c91d9f6b6fba -r 3dbd0a9be0cc xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Thu Dec 13 11:44:02 2012 +0000
+++ b/xen/include/asm-x86/config.h	Thu Dec 13 12:10:14 2012 +0000
@@ -12,6 +12,7 @@
 
 #define BYTES_PER_LONG (1 << LONG_BYTEORDER)
 #define BITS_PER_LONG (BYTES_PER_LONG << 3)
+#define BITS_PER_BYTE 8
 
 #define CONFIG_X86 1
 #define CONFIG_X86_HT 1
diff -r c91d9f6b6fba -r 3dbd0a9be0cc xen/include/asm-x86/paging.h
--- a/xen/include/asm-x86/paging.h	Thu Dec 13 11:44:02 2012 +0000
+++ b/xen/include/asm-x86/paging.h	Thu Dec 13 12:10:14 2012 +0000
@@ -137,10 +137,10 @@ struct paging_mode {
 void paging_free_log_dirty_bitmap(struct domain *d);
 
 /* get the dirty bitmap for a specific range of pfns */
-int paging_log_dirty_range(struct domain *d,
-                           unsigned long begin_pfn,
-                           unsigned long nr,
-                           XEN_GUEST_HANDLE_64(uint8) dirty_bitmap);
+void paging_log_dirty_range(struct domain *d,
+                            unsigned long begin_pfn,
+                            unsigned long nr,
+                            uint8_t *dirty_bitmap);
 
 /* enable log dirty */
 int paging_log_dirty_enable(struct domain *d);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGP-0002iH-HB; Fri, 14 Dec 2012 15:33:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGP-0002ht-2R
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:25 +0000
Received: from [193.109.254.147:55410] by server-8.bemta-14.messagelabs.com id
	19/9A-26341-4C64BC05; Fri, 14 Dec 2012 15:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1355499190!1692842!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22494 invoked from network); 14 Dec 2012 15:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG9-0006YO-KH
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG9-0005bj-HS
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:09 +0000
Message-Id: <E1TjXG9-0005bj-HS@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: qemu trad logdirty: Tolerate
	ENOENT on ret path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355399041 0
# Node ID ef9242f5846f4b73e82bf6dec3a3991f53fe9b70
# Parent  69ec301b8ec20eacd3ebe87f56baca8b0e22c83f
libxl: qemu trad logdirty: Tolerate ENOENT on ret path

It can happen in error conditions that lds->ret_path doesn't exist,
and libxl__xs_read_checked signals this by setting got_ret=NULL.  If
this happens, fail without crashing.

Reported-by: Alex Bligh <alex@alex.org.uk>,
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 69ec301b8ec2 -r ef9242f5846f tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Thu Dec 13 11:44:01 2012 +0000
@@ -725,7 +725,7 @@ static void domain_suspend_switch_qemu_x
             rc = libxl__xs_read_checked(gc, t, lds->ret_path, &got_ret);
             if (rc) goto out;
 
-            if (strcmp(got, got_ret)) {
+            if (!got_ret || strcmp(got, got_ret)) {
                 LOG(ERROR,"controlling logdirty: qemu was already sent"
                     " command `%s' (xenstore path `%s') but result is `%s'",
                     got, lds->cmd_path, got_ret ? got_ret : "<none>");

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGP-0002iH-HB; Fri, 14 Dec 2012 15:33:25 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGP-0002ht-2R
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:25 +0000
Received: from [193.109.254.147:55410] by server-8.bemta-14.messagelabs.com id
	19/9A-26341-4C64BC05; Fri, 14 Dec 2012 15:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1355499190!1692842!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22494 invoked from network); 14 Dec 2012 15:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG9-0006YO-KH
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXG9-0005bj-HS
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:09 +0000
Message-Id: <E1TjXG9-0005bj-HS@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: qemu trad logdirty: Tolerate
	ENOENT on ret path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355399041 0
# Node ID ef9242f5846f4b73e82bf6dec3a3991f53fe9b70
# Parent  69ec301b8ec20eacd3ebe87f56baca8b0e22c83f
libxl: qemu trad logdirty: Tolerate ENOENT on ret path

It can happen in error conditions that lds->ret_path doesn't exist,
and libxl__xs_read_checked signals this by setting got_ret=NULL.  If
this happens, fail without crashing.

Reported-by: Alex Bligh <alex@alex.org.uk>,
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 69ec301b8ec2 -r ef9242f5846f tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Thu Dec 13 11:44:01 2012 +0000
@@ -725,7 +725,7 @@ static void domain_suspend_switch_qemu_x
             rc = libxl__xs_read_checked(gc, t, lds->ret_path, &got_ret);
             if (rc) goto out;
 
-            if (strcmp(got, got_ret)) {
+            if (!got_ret || strcmp(got, got_ret)) {
                 LOG(ERROR,"controlling logdirty: qemu was already sent"
                     " command `%s' (xenstore path `%s') but result is `%s'",
                     got, lds->cmd_path, got_ret ? got_ret : "<none>");

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:34:02 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:34:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGy-0002oW-LH; Fri, 14 Dec 2012 15:34:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGx-0002oH-7L
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:59 +0000
Received: from [85.158.143.35:53188] by server-3.bemta-4.messagelabs.com id
	1C/9A-18211-6E64BC05; Fri, 14 Dec 2012 15:33:58 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1355499190!12484264!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2987 invoked from network); 14 Dec 2012 15:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGA-0006YR-EI
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGA-0005by-5S
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:10 +0000
Message-Id: <E1TjXGA-0005by-5S@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: introduce XSM relabel on build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1355399042 0
# Node ID c91d9f6b6fbae56d64f9a5c1803f2709e1661f09
# Parent  ef9242f5846f4b73e82bf6dec3a3991f53fe9b70
libxl: introduce XSM relabel on build

Allow a domain to be built under one security label and run using a
different label.  This can be used to prevent the domain builder or
control domain from having the ability to access a guest domain's memory
via map_foreign_range except during the build process where this is
required.

Example domain configuration snippet:
  seclabel='customer_1:vm_r:nomigrate_t'
  init_seclabel='customer_1:vm_r:nomigrate_t_building'

Note: this does not provide complete protection from a malicious dom0;
mappings created during the build process may persist after the relabel,
and could be used to indirectly access the guest's memory. However, if
dom0 correctly unmaps the domain upon building, a the domU is protected
against dom0 becoming malicious in the future.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ef9242f5846f -r c91d9f6b6fba docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Thu Dec 13 11:44:01 2012 +0000
+++ b/docs/man/xl.cfg.pod.5	Thu Dec 13 11:44:02 2012 +0000
@@ -270,6 +270,15 @@ UUID will be generated.
 
 Assign an XSM security label to this domain.
 
+=item B<init_seclabel="LABEL">
+
+Specify an XSM security label used for this domain temporarily during
+its build. The domain's XSM label will be changed to the execution
+seclabel (specified by "seclabel") once the build is complete, prior to
+unpausing the domain. With a properly constructed security policy (such
+as nomigrate_t in the example policy), this can be used to build a
+domain whose memory is not accessible to the toolstack domain.
+
 =item B<nomigrate=BOOLEAN>
 
 Disable migration of this domain.  This enables certain other features
diff -r ef9242f5846f -r c91d9f6b6fba docs/misc/xsm-flask.txt
--- a/docs/misc/xsm-flask.txt	Thu Dec 13 11:44:01 2012 +0000
+++ b/docs/misc/xsm-flask.txt	Thu Dec 13 11:44:02 2012 +0000
@@ -60,6 +60,8 @@ that can be used without dom0 disaggrega
  - domU_t is a domain that can communicate with any other domU_t
  - isolated_domU_t can only communicate with dom0
  - prot_domU_t is a domain type whose creation can be disabled with a boolean
+ - nomigrate_t is a domain that must be created via the nomigrate_t_building
+   type, and whose memory cannot be read by dom0 once created
 
 HVM domains with stubdomain device models use two types (one per domain):
  - domHVM_t is an HVM domain that uses a stubdomain device model
diff -r ef9242f5846f -r c91d9f6b6fba tools/flask/policy/policy/modules/xen/xen.if
--- a/tools/flask/policy/policy/modules/xen/xen.if	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/flask/policy/policy/modules/xen/xen.if	Thu Dec 13 11:44:02 2012 +0000
@@ -9,24 +9,47 @@
 #   Declare a type as a domain type, and allow basic domain setup
 define(`declare_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	type $1_channel, event_type;
+	type_transition $1 domain_type:event $1_channel;
 	allow $1 $1:grant { query setup };
 	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
 	allow $1 $1:hvm { getparam setparam };
 ')
 
-# create_domain(priv, target)
-#   Allow a domain to be created
-define(`create_domain', `
+# declare_build_label(type)
+#   Declare a paired _building type for the given domain type
+define(`declare_build_label', `
+	type $1_building, domain_type;
+	type_transition $1_building domain_type:event $1_channel;
+	allow $1_building $1 : domain transition;
+')
+
+define(`create_domain_common', `
 	allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize
-			getdomaininfo hypercall setvcpucontext scheduler
-			unpause getvcpuinfo getvcpuextstate getaddrsize
-			getvcpuaffinity };
+			getdomaininfo hypercall setvcpucontext setextvcpucontext
+			scheduler getvcpuinfo getvcpuextstate getaddrsize
+			getvcpuaffinity setvcpuaffinity };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
 	allow $1 $2:grant setup;
-	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute setparam pcilevel trackdirtyvram };
-	allow $1 $2_$1_channel:event create;
+	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
+')
+
+# create_domain(priv, target)
+#   Allow a domain to be created directly
+define(`create_domain', `
+	create_domain_common($1, $2)
+	allow $1 $2_channel:event create;
+')
+
+# create_domain_build_label(priv, target)
+#   Allow a domain to be created via its domain build label
+define(`create_domain_build_label', `
+	create_domain_common($1, $2_building)
+	allow $1 $2_channel:event create;
+	allow $1 $2_building:domain2 relabelfrom;
+	allow $1 $2:domain2 relabelto;
 ')
 
 # manage_domain(priv, target)
@@ -37,6 +60,15 @@ define(`manage_domain', `
 			setvcpuaffinity setdomainmaxmem };
 ')
 
+# migrate_domain_out(priv, target)
+#   Allow creation of a snapshot or migration image from a domain
+#   (inbound migration is the same as domain creation)
+define(`migrate_domain_out', `
+	allow $1 $2:hvm { gethvmc getparam irqlevel };
+	allow $1 $2:mmu { stat pageinfo map_read };
+	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
+')
+
 ################################################################################
 #
 # Inter-domain communication
@@ -47,8 +79,6 @@ define(`manage_domain', `
 #   This allows an event channel to be created from domains with labels
 #   <source> to <dest> and will label it <chan-label>
 define(`create_channel', `
-	type $3, event_type;
-	type_transition $1 $2:event $3;
 	allow $1 $3:event { create send status };
 	allow $3 $2:event { bind };
 ')
@@ -56,8 +86,8 @@ define(`create_channel', `
 # domain_event_comms(dom1, dom2)
 #   Allow two domain types to communicate using event channels
 define(`domain_event_comms', `
-	create_channel($1, $2, $1_$2_channel)
-	create_channel($2, $1, $2_$1_channel)
+	create_channel($1, $2, $1_channel)
+	create_channel($2, $1, $2_channel)
 ')
 
 # domain_comms(dom1, dom2)
@@ -72,7 +102,7 @@ define(`domain_comms', `
 #   Allow a domain types to communicate with others of its type using grants
 #   and event channels (this includes event channels to DOMID_SELF)
 define(`domain_self_comms', `
-	create_channel($1, $1, $1_self_channel)
+	create_channel($1, $1, $1_channel)
 	allow $1 $1:grant { map_read map_write copy unmap };
 ')
 
diff -r ef9242f5846f -r c91d9f6b6fba tools/flask/policy/policy/modules/xen/xen.te
--- a/tools/flask/policy/policy/modules/xen/xen.te	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/flask/policy/policy/modules/xen/xen.te	Thu Dec 13 11:44:02 2012 +0000
@@ -90,6 +90,7 @@ create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
 
+# Declare a boolean that denies creation of prot_domU_t domains
 gen_bool(prot_doms_locked, false)
 declare_domain(prot_domU_t)
 if (!prot_doms_locked) {
@@ -111,6 +112,15 @@ manage_domain(dom0_t, dm_dom_t)
 domain_comms(dom0_t, dm_dom_t)
 device_model(dm_dom_t, domHVM_t)
 
+# nomigrate_t must be built via the nomigrate_t_building label; once built,
+# dom0 cannot read its memory.
+declare_domain(nomigrate_t)
+declare_build_label(nomigrate_t)
+create_domain_build_label(dom0_t, nomigrate_t)
+manage_domain(dom0_t, nomigrate_t)
+domain_comms(dom0_t, nomigrate_t)
+domain_self_comms(nomigrate_t)
+
 ###############################################################################
 #
 # Device delegation
diff -r ef9242f5846f -r c91d9f6b6fba tools/libxc/xc_flask.c
--- a/tools/libxc/xc_flask.c	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxc/xc_flask.c	Thu Dec 13 11:44:02 2012 +0000
@@ -422,6 +422,16 @@ int xc_flask_setavc_threshold(xc_interfa
     return xc_flask_op(xch, &op);
 }
 
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid)
+{
+    DECLARE_FLASK_OP;
+    op.cmd = FLASK_RELABEL_DOMAIN;
+    op.u.relabel.domid = domid;
+    op.u.relabel.sid = sid;
+
+    return xc_flask_op(xch, &op);
+}
+
 /*
  * Local variables:
  * mode: C
diff -r ef9242f5846f -r c91d9f6b6fba tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Dec 13 11:44:02 2012 +0000
@@ -2169,6 +2169,7 @@ int xc_flask_policyvers(xc_interface *xc
 int xc_flask_avc_hashstats(xc_interface *xc_handle, char *buf, int size);
 int xc_flask_getavc_threshold(xc_interface *xc_handle);
 int xc_flask_setavc_threshold(xc_interface *xc_handle, int threshold);
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid);
 
 struct elf_binary;
 void xc_elf_set_logfile(xc_interface *xch, struct elf_binary *elf,
diff -r ef9242f5846f -r c91d9f6b6fba tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Dec 13 11:44:02 2012 +0000
@@ -1182,6 +1182,10 @@ static void domcreate_complete(libxl__eg
                                int rc)
 {
     STATE_AO_GC(dcs->ao);
+    libxl_domain_config *const d_config = dcs->guest_config;
+
+    if (!rc && d_config->b_info.exec_ssidref)
+        rc = xc_flask_relabel_domain(CTX->xch, dcs->guest_domid, d_config->b_info.exec_ssidref);
 
     if (rc) {
         if (dcs->guest_domid) {
diff -r ef9242f5846f -r c91d9f6b6fba tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Dec 13 11:44:02 2012 +0000
@@ -268,6 +268,7 @@ libxl_domain_build_info = Struct("domain
     ("video_memkb",     MemKB),
     ("shadow_memkb",    MemKB),
     ("rtc_timeoffset",  uint32),
+    ("exec_ssidref",    uint32),
     ("localtime",       libxl_defbool),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
diff -r ef9242f5846f -r c91d9f6b6fba tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Dec 13 11:44:02 2012 +0000
@@ -596,16 +596,34 @@ static void parse_config_data(const char
         exit(1);
     }
 
-    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+    if (!xlu_cfg_get_string (config, "init_seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
                                     &c_info->ssidref);
         if (e) {
             if (errno == ENOSYS) {
+                fprintf(stderr, "XSM Disabled: init_seclabel not supported\n");
+            } else {
+                fprintf(stderr, "Invalid init_seclabel: %s\n", buf);
+                exit(1);
+            }
+        }
+    }
+
+    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+        uint32_t ssidref;
+        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
+                                    &ssidref);
+        if (e) {
+            if (errno == ENOSYS) {
                 fprintf(stderr, "XSM Disabled: seclabel not supported\n");
             } else {
                 fprintf(stderr, "Invalid seclabel: %s\n", buf);
                 exit(1);
             }
+        } else if (c_info->ssidref) {
+            b_info->exec_ssidref = ssidref;
+        } else {
+            c_info->ssidref = ssidref;
         }
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 14 15:34:02 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 14 Dec 2012 15:34:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TjXGy-0002oW-LH; Fri, 14 Dec 2012 15:34:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGx-0002oH-7L
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:59 +0000
Received: from [85.158.143.35:53188] by server-3.bemta-4.messagelabs.com id
	1C/9A-18211-6E64BC05; Fri, 14 Dec 2012 15:33:58 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1355499190!12484264!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2987 invoked from network); 14 Dec 2012 15:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Dec 2012 15:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGA-0006YR-EI
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TjXGA-0005by-5S
	for xen-changelog@lists.xensource.com; Fri, 14 Dec 2012 15:33:10 +0000
Message-Id: <E1TjXGA-0005by-5S@xenbits.xen.org>
Date: Fri, 14 Dec 2012 15:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: introduce XSM relabel on build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1355399042 0
# Node ID c91d9f6b6fbae56d64f9a5c1803f2709e1661f09
# Parent  ef9242f5846f4b73e82bf6dec3a3991f53fe9b70
libxl: introduce XSM relabel on build

Allow a domain to be built under one security label and run using a
different label.  This can be used to prevent the domain builder or
control domain from having the ability to access a guest domain's memory
via map_foreign_range except during the build process where this is
required.

Example domain configuration snippet:
  seclabel='customer_1:vm_r:nomigrate_t'
  init_seclabel='customer_1:vm_r:nomigrate_t_building'

Note: this does not provide complete protection from a malicious dom0;
mappings created during the build process may persist after the relabel,
and could be used to indirectly access the guest's memory. However, if
dom0 correctly unmaps the domain upon building, a the domU is protected
against dom0 becoming malicious in the future.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ef9242f5846f -r c91d9f6b6fba docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Thu Dec 13 11:44:01 2012 +0000
+++ b/docs/man/xl.cfg.pod.5	Thu Dec 13 11:44:02 2012 +0000
@@ -270,6 +270,15 @@ UUID will be generated.
 
 Assign an XSM security label to this domain.
 
+=item B<init_seclabel="LABEL">
+
+Specify an XSM security label used for this domain temporarily during
+its build. The domain's XSM label will be changed to the execution
+seclabel (specified by "seclabel") once the build is complete, prior to
+unpausing the domain. With a properly constructed security policy (such
+as nomigrate_t in the example policy), this can be used to build a
+domain whose memory is not accessible to the toolstack domain.
+
 =item B<nomigrate=BOOLEAN>
 
 Disable migration of this domain.  This enables certain other features
diff -r ef9242f5846f -r c91d9f6b6fba docs/misc/xsm-flask.txt
--- a/docs/misc/xsm-flask.txt	Thu Dec 13 11:44:01 2012 +0000
+++ b/docs/misc/xsm-flask.txt	Thu Dec 13 11:44:02 2012 +0000
@@ -60,6 +60,8 @@ that can be used without dom0 disaggrega
  - domU_t is a domain that can communicate with any other domU_t
  - isolated_domU_t can only communicate with dom0
  - prot_domU_t is a domain type whose creation can be disabled with a boolean
+ - nomigrate_t is a domain that must be created via the nomigrate_t_building
+   type, and whose memory cannot be read by dom0 once created
 
 HVM domains with stubdomain device models use two types (one per domain):
  - domHVM_t is an HVM domain that uses a stubdomain device model
diff -r ef9242f5846f -r c91d9f6b6fba tools/flask/policy/policy/modules/xen/xen.if
--- a/tools/flask/policy/policy/modules/xen/xen.if	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/flask/policy/policy/modules/xen/xen.if	Thu Dec 13 11:44:02 2012 +0000
@@ -9,24 +9,47 @@
 #   Declare a type as a domain type, and allow basic domain setup
 define(`declare_domain', `
 	type $1, domain_type`'ifelse(`$#', `1', `', `,shift($@)');
+	type $1_channel, event_type;
+	type_transition $1 domain_type:event $1_channel;
 	allow $1 $1:grant { query setup };
 	allow $1 $1:mmu { adjust physmap map_read map_write stat pinpage };
 	allow $1 $1:hvm { getparam setparam };
 ')
 
-# create_domain(priv, target)
-#   Allow a domain to be created
-define(`create_domain', `
+# declare_build_label(type)
+#   Declare a paired _building type for the given domain type
+define(`declare_build_label', `
+	type $1_building, domain_type;
+	type_transition $1_building domain_type:event $1_channel;
+	allow $1_building $1 : domain transition;
+')
+
+define(`create_domain_common', `
 	allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize
-			getdomaininfo hypercall setvcpucontext scheduler
-			unpause getvcpuinfo getvcpuextstate getaddrsize
-			getvcpuaffinity };
+			getdomaininfo hypercall setvcpucontext setextvcpucontext
+			scheduler getvcpuinfo getvcpuextstate getaddrsize
+			getvcpuaffinity setvcpuaffinity };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu {map_read map_write adjust memorymap physmap pinpage};
 	allow $1 $2:grant setup;
-	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute setparam pcilevel trackdirtyvram };
-	allow $1 $2_$1_channel:event create;
+	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
+')
+
+# create_domain(priv, target)
+#   Allow a domain to be created directly
+define(`create_domain', `
+	create_domain_common($1, $2)
+	allow $1 $2_channel:event create;
+')
+
+# create_domain_build_label(priv, target)
+#   Allow a domain to be created via its domain build label
+define(`create_domain_build_label', `
+	create_domain_common($1, $2_building)
+	allow $1 $2_channel:event create;
+	allow $1 $2_building:domain2 relabelfrom;
+	allow $1 $2:domain2 relabelto;
 ')
 
 # manage_domain(priv, target)
@@ -37,6 +60,15 @@ define(`manage_domain', `
 			setvcpuaffinity setdomainmaxmem };
 ')
 
+# migrate_domain_out(priv, target)
+#   Allow creation of a snapshot or migration image from a domain
+#   (inbound migration is the same as domain creation)
+define(`migrate_domain_out', `
+	allow $1 $2:hvm { gethvmc getparam irqlevel };
+	allow $1 $2:mmu { stat pageinfo map_read };
+	allow $1 $2:domain { getaddrsize getvcpucontext getextvcpucontext getvcpuextstate pause destroy };
+')
+
 ################################################################################
 #
 # Inter-domain communication
@@ -47,8 +79,6 @@ define(`manage_domain', `
 #   This allows an event channel to be created from domains with labels
 #   <source> to <dest> and will label it <chan-label>
 define(`create_channel', `
-	type $3, event_type;
-	type_transition $1 $2:event $3;
 	allow $1 $3:event { create send status };
 	allow $3 $2:event { bind };
 ')
@@ -56,8 +86,8 @@ define(`create_channel', `
 # domain_event_comms(dom1, dom2)
 #   Allow two domain types to communicate using event channels
 define(`domain_event_comms', `
-	create_channel($1, $2, $1_$2_channel)
-	create_channel($2, $1, $2_$1_channel)
+	create_channel($1, $2, $1_channel)
+	create_channel($2, $1, $2_channel)
 ')
 
 # domain_comms(dom1, dom2)
@@ -72,7 +102,7 @@ define(`domain_comms', `
 #   Allow a domain types to communicate with others of its type using grants
 #   and event channels (this includes event channels to DOMID_SELF)
 define(`domain_self_comms', `
-	create_channel($1, $1, $1_self_channel)
+	create_channel($1, $1, $1_channel)
 	allow $1 $1:grant { map_read map_write copy unmap };
 ')
 
diff -r ef9242f5846f -r c91d9f6b6fba tools/flask/policy/policy/modules/xen/xen.te
--- a/tools/flask/policy/policy/modules/xen/xen.te	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/flask/policy/policy/modules/xen/xen.te	Thu Dec 13 11:44:02 2012 +0000
@@ -90,6 +90,7 @@ create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
 
+# Declare a boolean that denies creation of prot_domU_t domains
 gen_bool(prot_doms_locked, false)
 declare_domain(prot_domU_t)
 if (!prot_doms_locked) {
@@ -111,6 +112,15 @@ manage_domain(dom0_t, dm_dom_t)
 domain_comms(dom0_t, dm_dom_t)
 device_model(dm_dom_t, domHVM_t)
 
+# nomigrate_t must be built via the nomigrate_t_building label; once built,
+# dom0 cannot read its memory.
+declare_domain(nomigrate_t)
+declare_build_label(nomigrate_t)
+create_domain_build_label(dom0_t, nomigrate_t)
+manage_domain(dom0_t, nomigrate_t)
+domain_comms(dom0_t, nomigrate_t)
+domain_self_comms(nomigrate_t)
+
 ###############################################################################
 #
 # Device delegation
diff -r ef9242f5846f -r c91d9f6b6fba tools/libxc/xc_flask.c
--- a/tools/libxc/xc_flask.c	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxc/xc_flask.c	Thu Dec 13 11:44:02 2012 +0000
@@ -422,6 +422,16 @@ int xc_flask_setavc_threshold(xc_interfa
     return xc_flask_op(xch, &op);
 }
 
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid)
+{
+    DECLARE_FLASK_OP;
+    op.cmd = FLASK_RELABEL_DOMAIN;
+    op.u.relabel.domid = domid;
+    op.u.relabel.sid = sid;
+
+    return xc_flask_op(xch, &op);
+}
+
 /*
  * Local variables:
  * mode: C
diff -r ef9242f5846f -r c91d9f6b6fba tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Dec 13 11:44:02 2012 +0000
@@ -2169,6 +2169,7 @@ int xc_flask_policyvers(xc_interface *xc
 int xc_flask_avc_hashstats(xc_interface *xc_handle, char *buf, int size);
 int xc_flask_getavc_threshold(xc_interface *xc_handle);
 int xc_flask_setavc_threshold(xc_interface *xc_handle, int threshold);
+int xc_flask_relabel_domain(xc_interface *xch, int domid, uint32_t sid);
 
 struct elf_binary;
 void xc_elf_set_logfile(xc_interface *xch, struct elf_binary *elf,
diff -r ef9242f5846f -r c91d9f6b6fba tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Dec 13 11:44:02 2012 +0000
@@ -1182,6 +1182,10 @@ static void domcreate_complete(libxl__eg
                                int rc)
 {
     STATE_AO_GC(dcs->ao);
+    libxl_domain_config *const d_config = dcs->guest_config;
+
+    if (!rc && d_config->b_info.exec_ssidref)
+        rc = xc_flask_relabel_domain(CTX->xch, dcs->guest_domid, d_config->b_info.exec_ssidref);
 
     if (rc) {
         if (dcs->guest_domid) {
diff -r ef9242f5846f -r c91d9f6b6fba tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Dec 13 11:44:02 2012 +0000
@@ -268,6 +268,7 @@ libxl_domain_build_info = Struct("domain
     ("video_memkb",     MemKB),
     ("shadow_memkb",    MemKB),
     ("rtc_timeoffset",  uint32),
+    ("exec_ssidref",    uint32),
     ("localtime",       libxl_defbool),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
diff -r ef9242f5846f -r c91d9f6b6fba tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Dec 13 11:44:01 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Dec 13 11:44:02 2012 +0000
@@ -596,16 +596,34 @@ static void parse_config_data(const char
         exit(1);
     }
 
-    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+    if (!xlu_cfg_get_string (config, "init_seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
                                     &c_info->ssidref);
         if (e) {
             if (errno == ENOSYS) {
+                fprintf(stderr, "XSM Disabled: init_seclabel not supported\n");
+            } else {
+                fprintf(stderr, "Invalid init_seclabel: %s\n", buf);
+                exit(1);
+            }
+        }
+    }
+
+    if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
+        uint32_t ssidref;
+        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
+                                    &ssidref);
+        if (e) {
+            if (errno == ENOSYS) {
                 fprintf(stderr, "XSM Disabled: seclabel not supported\n");
             } else {
                 fprintf(stderr, "Invalid seclabel: %s\n", buf);
                 exit(1);
             }
+        } else if (c_info->ssidref) {
+            b_info->exec_ssidref = ssidref;
+        } else {
+            c_info->ssidref = ssidref;
         }
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Dec 17 20:33:36 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Dec 2012 20:33:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TkhNU-0004IE-7G; Mon, 17 Dec 2012 20:33:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhNS-0004Hs-KS
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:30 +0000
Received: from [85.158.143.99:32991] by server-1.bemta-4.messagelabs.com id
	D0/1A-28401-9918FC05; Mon, 17 Dec 2012 20:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1355776408!29870034!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9317 invoked from network); 17 Dec 2012 20:33:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2012 20:33:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhNP-0004nu-Va
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhNP-0005CU-G1
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:27 +0000
Message-Id: <E1TkhNP-0005CU-G1@xenbits.xen.org>
Date: Mon, 17 Dec 2012 20:33:26 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxl: revert 23428:93e17b0cd035
	"avoid blktap2 deadlock"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355745292 0
# Node ID 516dbd9deb4f2c96b9d6d6c352ca261bb2796eda
# Parent  93e17b0cd035bf2fd43c8d14931556c6b35b66cb
libxl: revert 23428:93e17b0cd035 "avoid blktap2 deadlock"

This results in additional leakage in xenstore according to the
automated tests.

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 93e17b0cd035 -r 516dbd9deb4f tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Thu Dec 13 14:35:58 2012 +0000
+++ b/tools/libxl/libxl_blktap2.c	Mon Dec 17 11:54:52 2012 +0000
@@ -59,7 +59,6 @@ void libxl__device_destroy_tapdisk(libxl
     char *path, *params, *type, *disk;
     int err;
     tap_list_t tap;
-    libxl_ctx *ctx = libxl__gc_owner(gc);
 
     path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
     if (!path) return;
@@ -76,11 +75,5 @@ void libxl__device_destroy_tapdisk(libxl
     err = tap_ctl_find(type, disk, &tap);
     if (err < 0) return;
 
-    /*
-     * Remove the instance of the backend device to avoid a deadlock with the
-     * removal of the tap device.
-     */
-    xs_rm(ctx->xsh, XBT_NULL, be_path);
-
     tap_ctl_destroy(tap.id, tap.minor);
 }
diff -r 93e17b0cd035 -r 516dbd9deb4f tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Thu Dec 13 14:35:58 2012 +0000
+++ b/tools/libxl/libxl_device.c	Mon Dec 17 11:54:52 2012 +0000
@@ -251,6 +251,7 @@ int libxl__device_destroy(libxl_ctx *ctx
         goto out;
     if (atoi(state) != 4) {
         libxl__device_destroy_tapdisk(&gc, be_path);
+        xs_rm(ctx->xsh, XBT_NULL, be_path);
         goto out;
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Dec 17 20:33:36 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Dec 2012 20:33:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TkhNU-0004IE-7G; Mon, 17 Dec 2012 20:33:32 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhNS-0004Hs-KS
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:30 +0000
Received: from [85.158.143.99:32991] by server-1.bemta-4.messagelabs.com id
	D0/1A-28401-9918FC05; Mon, 17 Dec 2012 20:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1355776408!29870034!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9317 invoked from network); 17 Dec 2012 20:33:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2012 20:33:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhNP-0004nu-Va
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhNP-0005CU-G1
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:27 +0000
Message-Id: <E1TkhNP-0005CU-G1@xenbits.xen.org>
Date: Mon, 17 Dec 2012 20:33:26 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxl: revert 23428:93e17b0cd035
	"avoid blktap2 deadlock"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355745292 0
# Node ID 516dbd9deb4f2c96b9d6d6c352ca261bb2796eda
# Parent  93e17b0cd035bf2fd43c8d14931556c6b35b66cb
libxl: revert 23428:93e17b0cd035 "avoid blktap2 deadlock"

This results in additional leakage in xenstore according to the
automated tests.

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 93e17b0cd035 -r 516dbd9deb4f tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Thu Dec 13 14:35:58 2012 +0000
+++ b/tools/libxl/libxl_blktap2.c	Mon Dec 17 11:54:52 2012 +0000
@@ -59,7 +59,6 @@ void libxl__device_destroy_tapdisk(libxl
     char *path, *params, *type, *disk;
     int err;
     tap_list_t tap;
-    libxl_ctx *ctx = libxl__gc_owner(gc);
 
     path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
     if (!path) return;
@@ -76,11 +75,5 @@ void libxl__device_destroy_tapdisk(libxl
     err = tap_ctl_find(type, disk, &tap);
     if (err < 0) return;
 
-    /*
-     * Remove the instance of the backend device to avoid a deadlock with the
-     * removal of the tap device.
-     */
-    xs_rm(ctx->xsh, XBT_NULL, be_path);
-
     tap_ctl_destroy(tap.id, tap.minor);
 }
diff -r 93e17b0cd035 -r 516dbd9deb4f tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Thu Dec 13 14:35:58 2012 +0000
+++ b/tools/libxl/libxl_device.c	Mon Dec 17 11:54:52 2012 +0000
@@ -251,6 +251,7 @@ int libxl__device_destroy(libxl_ctx *ctx
         goto out;
     if (atoi(state) != 4) {
         libxl__device_destroy_tapdisk(&gc, be_path);
+        xs_rm(ctx->xsh, XBT_NULL, be_path);
         goto out;
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Dec 17 20:33:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Dec 2012 20:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TkhNU-0004I8-4R; Mon, 17 Dec 2012 20:33:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhNS-0004Hq-40
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:30 +0000
Received: from [85.158.139.211:15867] by server-12.bemta-5.messagelabs.com id
	EE/FC-02275-9918FC05; Mon, 17 Dec 2012 20:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1355776407!18066272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2164 invoked from network); 17 Dec 2012 20:33:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2012 20:33:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhNP-0004nr-ED
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhND-0005BV-1c
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:26 +0000
Message-Id: <E1TkhND-0005BV-1c@xenbits.xen.org>
Date: Mon, 17 Dec 2012 20:33:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxl: avoid blktap2 deadlock on
	cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Greg Wettstein <greg@enjellic.com>
# Date 1355409358 0
# Node ID 93e17b0cd035bf2fd43c8d14931556c6b35b66cb
# Parent  255a0b6a81041e51fe38ef0e919a6541ffe0d119
libxl: avoid blktap2 deadlock on cleanup

Establishes correct cleanup behavior for blktap devices.  This patch
implements the release of the backend device before calling for
the destruction of the userspace component of the blktap device.

Without this patch the kernel xen-blkback driver deadlocks with
the blktap2 user control plane until the IPC channel is terminated by the
timeout on the select() call.  This results in a noticeable delay
in the termination of the guest and causes the blktap minor
number which had been allocated to be orphaned.

Signed-off-by: Greg Wettstein <greg@enjellic.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 255a0b6a8104 -r 93e17b0cd035 tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Wed Dec 12 17:41:15 2012 +0000
+++ b/tools/libxl/libxl_blktap2.c	Thu Dec 13 14:35:58 2012 +0000
@@ -59,6 +59,7 @@ void libxl__device_destroy_tapdisk(libxl
     char *path, *params, *type, *disk;
     int err;
     tap_list_t tap;
+    libxl_ctx *ctx = libxl__gc_owner(gc);
 
     path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
     if (!path) return;
@@ -75,5 +76,11 @@ void libxl__device_destroy_tapdisk(libxl
     err = tap_ctl_find(type, disk, &tap);
     if (err < 0) return;
 
+    /*
+     * Remove the instance of the backend device to avoid a deadlock with the
+     * removal of the tap device.
+     */
+    xs_rm(ctx->xsh, XBT_NULL, be_path);
+
     tap_ctl_destroy(tap.id, tap.minor);
 }
diff -r 255a0b6a8104 -r 93e17b0cd035 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Wed Dec 12 17:41:15 2012 +0000
+++ b/tools/libxl/libxl_device.c	Thu Dec 13 14:35:58 2012 +0000
@@ -251,7 +251,6 @@ int libxl__device_destroy(libxl_ctx *ctx
         goto out;
     if (atoi(state) != 4) {
         libxl__device_destroy_tapdisk(&gc, be_path);
-        xs_rm(ctx->xsh, XBT_NULL, be_path);
         goto out;
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Dec 17 20:33:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 17 Dec 2012 20:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TkhNU-0004I8-4R; Mon, 17 Dec 2012 20:33:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhNS-0004Hq-40
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:30 +0000
Received: from [85.158.139.211:15867] by server-12.bemta-5.messagelabs.com id
	EE/FC-02275-9918FC05; Mon, 17 Dec 2012 20:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-206.messagelabs.com!1355776407!18066272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2164 invoked from network); 17 Dec 2012 20:33:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Dec 2012 20:33:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhNP-0004nr-ED
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkhND-0005BV-1c
	for xen-changelog@lists.xensource.com; Mon, 17 Dec 2012 20:33:26 +0000
Message-Id: <E1TkhND-0005BV-1c@xenbits.xen.org>
Date: Mon, 17 Dec 2012 20:33:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxl: avoid blktap2 deadlock on
	cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Greg Wettstein <greg@enjellic.com>
# Date 1355409358 0
# Node ID 93e17b0cd035bf2fd43c8d14931556c6b35b66cb
# Parent  255a0b6a81041e51fe38ef0e919a6541ffe0d119
libxl: avoid blktap2 deadlock on cleanup

Establishes correct cleanup behavior for blktap devices.  This patch
implements the release of the backend device before calling for
the destruction of the userspace component of the blktap device.

Without this patch the kernel xen-blkback driver deadlocks with
the blktap2 user control plane until the IPC channel is terminated by the
timeout on the select() call.  This results in a noticeable delay
in the termination of the guest and causes the blktap minor
number which had been allocated to be orphaned.

Signed-off-by: Greg Wettstein <greg@enjellic.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 255a0b6a8104 -r 93e17b0cd035 tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c	Wed Dec 12 17:41:15 2012 +0000
+++ b/tools/libxl/libxl_blktap2.c	Thu Dec 13 14:35:58 2012 +0000
@@ -59,6 +59,7 @@ void libxl__device_destroy_tapdisk(libxl
     char *path, *params, *type, *disk;
     int err;
     tap_list_t tap;
+    libxl_ctx *ctx = libxl__gc_owner(gc);
 
     path = libxl__sprintf(gc, "%s/tapdisk-params", be_path);
     if (!path) return;
@@ -75,5 +76,11 @@ void libxl__device_destroy_tapdisk(libxl
     err = tap_ctl_find(type, disk, &tap);
     if (err < 0) return;
 
+    /*
+     * Remove the instance of the backend device to avoid a deadlock with the
+     * removal of the tap device.
+     */
+    xs_rm(ctx->xsh, XBT_NULL, be_path);
+
     tap_ctl_destroy(tap.id, tap.minor);
 }
diff -r 255a0b6a8104 -r 93e17b0cd035 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Wed Dec 12 17:41:15 2012 +0000
+++ b/tools/libxl/libxl_device.c	Thu Dec 13 14:35:58 2012 +0000
@@ -251,7 +251,6 @@ int libxl__device_destroy(libxl_ctx *ctx
         goto out;
     if (atoi(state) != 4) {
         libxl__device_destroy_tapdisk(&gc, be_path);
-        xs_rm(ctx->xsh, XBT_NULL, be_path);
         goto out;
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 02:22:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 02:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tkmow-0004GC-2o; Tue, 18 Dec 2012 02:22:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmou-0004Fw-Qe
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:13 +0000
Received: from [85.158.137.99:64630] by server-7.bemta-3.messagelabs.com id
	BB/1C-23008-353DFC05; Tue, 18 Dec 2012 02:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1355797330!18095904!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29677 invoked from network); 18 Dec 2012 02:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 02:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmor-0007Ab-TR
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmor-0005Pl-J8
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:09 +0000
Message-Id: <E1Tkmor-0005Pl-J8@xenbits.xen.org>
Date: Tue, 18 Dec 2012 02:22:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added signature for changeset
	25b021aa35eb
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355756351 0
# Node ID 11b4bc743b1f31a19a67cc4dbbb1678b875e2b86
# Parent  c5dce958ad653003539a0c592bf750be0ad1409f
Added signature for changeset 25b021aa35eb
---


diff -r c5dce958ad65 -r 11b4bc743b1f .hgsigs
--- a/.hgsigs	Mon Dec 17 15:55:06 2012 +0100
+++ b/.hgsigs	Mon Dec 17 14:59:11 2012 +0000
@@ -13,3 +13,4 @@ 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8
 af176624c3ae86141a4ad8617b5ec2a834a6c626 0 iQEcBAABAgAGBQJQVt5zAAoJEIP+FMlX6CvZ2q4H/2eEMxgwzflIPj88Y/jE1z8dTJ8E2l2FTBziMlmFYkmsiqx+BlGz9kk610DQo4mJoHrRSZOcZX0/NNUuCZntRizEorBQUcBEOBJQgTLzaxatPR49W5N7gOgqwNuWplKV0Aor7X0qX+wFZ4kZdBuqOimV7Mw43L1LsskcuDmqi8Ipvbf+JjnRPXpeTlxBOD+52ZhAirxvpA+LZfLIIYV9lx3SB7z7okxlBS+rlyL+h9cuwthWO3545QPlwXcSBY9r9m9/5ZtAiID5935JDdZGd7Dt/ZmikVs9xE6QHrHmWZFDfqgGPOmYFmVhJxk1xwwUbor3qaiUjTwfjM+zAIqtNv4=
 b6f071324f5ed076bfd28c71b51521cdd38639ab 0 iQEcBAABAgAGBQJQpLjpAAoJEIP+FMlX6CvZs2EIAM1HO25BnOPvo3fVjDErNnLo6miyentoLWJpXiDrJb+QRwuNVNGAQN0vlfd2iHcuvC9ipR1iFUizFcO1TI/wYoIOYOxs/r9Yk9cnBRThC7+yoBhCZY/LAbbd6SazEzI/86ZrMPbT4kfL8BD652UP1o9HCHgbFYDLzRMZTtep4+mA1OXCUWto4QjAJn+/SCQKI5kJXdLaj6JDS40kQoDXMlcTKu0NlftFT3zSA+U/SnOrRFwxW7uTxM09yyRLs/a/LbRcmYjeCnKUlvh8uapi5878Gxf5Bpo3XINKFsxC6p7nKF0wHzAqm63sB+o7C4fIvNY0nnWi5e7FDir+CO2yIKE=
 bfa4df1dbe1dac55428437184f811d174d806755 0 iQEcBAABAgAGBQJQyFDqAAoJEIP+FMlX6CvZcUMIAMOChtmvuIBpWhuIJofsMp4C8TDQoI2idc3s6K1OvL5YgWrcaRoqLW4C4ItyEvx0xe19GUAoqdXUkj9tQ9fwT/p6dzLIGPRnACjKs8uTopiGulFdXu6b80IK3xwG3rAjC/yz7nU6ohQpWZJQCL1CyaIPr7MEYI905luiKC18WSc+hJADKGBdTIvLgKAD7GtQkAjPq8GrrGUtEE6rwawhl9R+jQLWkRf2ucbqgtDEzNCmSICkgjK2Sudc6h+mcKX7r0s3eEEiSh0SmhR+6K3mCYicaWCxn4A/La8CKabU3jdP/+EKjnk8x/6DFqXATf3ijr1kP/ZlHnbnxpPp7UwAhho=
+25b021aa35ebdb08b53fd7acf36dfed184989933 0 iQEcBAABAgAGBQJQzzM9AAoJEIP+FMlX6CvZBNgH/iIXrpTnXRgSFMMQvlNZ2Ci7EirOdq6wmAFkNA9Fun/g2EgY2EUhtmcPPwVj273Q+I0XcaJX41Iost45ROQpaix46yAb+Oz+pEgMoqtPJmi1srdvBJJgkrsl7erbWdkcj1AmkvffBmhDG4IFvODgQTWo+lp1uASW+nPaJdmHx1sCJCiioOGkNaGRA5N9vLSuiRzuSZFePJP2BmrvjzC5A+bIyAfnCdD9izp1I5IIKB3I2/MfM+Hq2MR1XZwWJMExkQ63yuDTyP1TcpSIgqNzScu7XJbQVE1aUdPuO7GQjHn92UiSA9DEuhtfuizxafHhqr0cKfEeUF8KaMD9lV2uczw=

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 02:22:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 02:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tkmow-0004GC-2o; Tue, 18 Dec 2012 02:22:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmou-0004Fw-Qe
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:13 +0000
Received: from [85.158.137.99:64630] by server-7.bemta-3.messagelabs.com id
	BB/1C-23008-353DFC05; Tue, 18 Dec 2012 02:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-217.messagelabs.com!1355797330!18095904!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29677 invoked from network); 18 Dec 2012 02:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 02:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmor-0007Ab-TR
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmor-0005Pl-J8
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:09 +0000
Message-Id: <E1Tkmor-0005Pl-J8@xenbits.xen.org>
Date: Tue, 18 Dec 2012 02:22:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added signature for changeset
	25b021aa35eb
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355756351 0
# Node ID 11b4bc743b1f31a19a67cc4dbbb1678b875e2b86
# Parent  c5dce958ad653003539a0c592bf750be0ad1409f
Added signature for changeset 25b021aa35eb
---


diff -r c5dce958ad65 -r 11b4bc743b1f .hgsigs
--- a/.hgsigs	Mon Dec 17 15:55:06 2012 +0100
+++ b/.hgsigs	Mon Dec 17 14:59:11 2012 +0000
@@ -13,3 +13,4 @@ 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8
 af176624c3ae86141a4ad8617b5ec2a834a6c626 0 iQEcBAABAgAGBQJQVt5zAAoJEIP+FMlX6CvZ2q4H/2eEMxgwzflIPj88Y/jE1z8dTJ8E2l2FTBziMlmFYkmsiqx+BlGz9kk610DQo4mJoHrRSZOcZX0/NNUuCZntRizEorBQUcBEOBJQgTLzaxatPR49W5N7gOgqwNuWplKV0Aor7X0qX+wFZ4kZdBuqOimV7Mw43L1LsskcuDmqi8Ipvbf+JjnRPXpeTlxBOD+52ZhAirxvpA+LZfLIIYV9lx3SB7z7okxlBS+rlyL+h9cuwthWO3545QPlwXcSBY9r9m9/5ZtAiID5935JDdZGd7Dt/ZmikVs9xE6QHrHmWZFDfqgGPOmYFmVhJxk1xwwUbor3qaiUjTwfjM+zAIqtNv4=
 b6f071324f5ed076bfd28c71b51521cdd38639ab 0 iQEcBAABAgAGBQJQpLjpAAoJEIP+FMlX6CvZs2EIAM1HO25BnOPvo3fVjDErNnLo6miyentoLWJpXiDrJb+QRwuNVNGAQN0vlfd2iHcuvC9ipR1iFUizFcO1TI/wYoIOYOxs/r9Yk9cnBRThC7+yoBhCZY/LAbbd6SazEzI/86ZrMPbT4kfL8BD652UP1o9HCHgbFYDLzRMZTtep4+mA1OXCUWto4QjAJn+/SCQKI5kJXdLaj6JDS40kQoDXMlcTKu0NlftFT3zSA+U/SnOrRFwxW7uTxM09yyRLs/a/LbRcmYjeCnKUlvh8uapi5878Gxf5Bpo3XINKFsxC6p7nKF0wHzAqm63sB+o7C4fIvNY0nnWi5e7FDir+CO2yIKE=
 bfa4df1dbe1dac55428437184f811d174d806755 0 iQEcBAABAgAGBQJQyFDqAAoJEIP+FMlX6CvZcUMIAMOChtmvuIBpWhuIJofsMp4C8TDQoI2idc3s6K1OvL5YgWrcaRoqLW4C4ItyEvx0xe19GUAoqdXUkj9tQ9fwT/p6dzLIGPRnACjKs8uTopiGulFdXu6b80IK3xwG3rAjC/yz7nU6ohQpWZJQCL1CyaIPr7MEYI905luiKC18WSc+hJADKGBdTIvLgKAD7GtQkAjPq8GrrGUtEE6rwawhl9R+jQLWkRf2ucbqgtDEzNCmSICkgjK2Sudc6h+mcKX7r0s3eEEiSh0SmhR+6K3mCYicaWCxn4A/La8CKabU3jdP/+EKjnk8x/6DFqXATf3ijr1kP/ZlHnbnxpPp7UwAhho=
+25b021aa35ebdb08b53fd7acf36dfed184989933 0 iQEcBAABAgAGBQJQzzM9AAoJEIP+FMlX6CvZBNgH/iIXrpTnXRgSFMMQvlNZ2Ci7EirOdq6wmAFkNA9Fun/g2EgY2EUhtmcPPwVj273Q+I0XcaJX41Iost45ROQpaix46yAb+Oz+pEgMoqtPJmi1srdvBJJgkrsl7erbWdkcj1AmkvffBmhDG4IFvODgQTWo+lp1uASW+nPaJdmHx1sCJCiioOGkNaGRA5N9vLSuiRzuSZFePJP2BmrvjzC5A+bIyAfnCdD9izp1I5IIKB3I2/MfM+Hq2MR1XZwWJMExkQ63yuDTyP1TcpSIgqNzScu7XJbQVE1aUdPuO7GQjHn92UiSA9DEuhtfuizxafHhqr0cKfEeUF8KaMD9lV2uczw=

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 02:22:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 02:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tkmow-0004G7-05; Tue, 18 Dec 2012 02:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmou-0004Fx-Q3
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:12 +0000
Received: from [85.158.143.35:38475] by server-3.bemta-4.messagelabs.com id
	33/D7-18211-453DFC05; Tue, 18 Dec 2012 02:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1355797329!5224260!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19040 invoked from network); 18 Dec 2012 02:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 02:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmor-0007AV-47
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmoq-0005PH-Bn
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:08 +0000
Message-Id: <E1Tkmoq-0005PH-Bn@xenbits.xen.org>
Date: Tue, 18 Dec 2012 02:22:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] update Xen version to 4.2.1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355756074 -3600
# Node ID 25b021aa35ebdb08b53fd7acf36dfed184989933
# Parent  bfdbf9747fc4eb8f76dea0b881ae1c4acc6da3a8
update Xen version to 4.2.1
---


diff -r bfdbf9747fc4 -r 25b021aa35eb Config.mk
--- a/Config.mk	Thu Dec 13 14:30:44 2012 +0000
+++ b/Config.mk	Mon Dec 17 15:54:34 2012 +0100
@@ -202,7 +202,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.o
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.0
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.1
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
 # Update version to 1.6.3.2
@@ -214,7 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.1-rc2
+QEMU_TAG ?= xen-4.2.1
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
diff -r bfdbf9747fc4 -r 25b021aa35eb xen/Makefile
--- a/xen/Makefile	Thu Dec 13 14:30:44 2012 +0000
+++ b/xen/Makefile	Mon Dec 17 15:54:34 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .1-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 02:22:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 02:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tkmow-0004G7-05; Tue, 18 Dec 2012 02:22:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmou-0004Fx-Q3
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:12 +0000
Received: from [85.158.143.35:38475] by server-3.bemta-4.messagelabs.com id
	33/D7-18211-453DFC05; Tue, 18 Dec 2012 02:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1355797329!5224260!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19040 invoked from network); 18 Dec 2012 02:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 02:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmor-0007AV-47
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmoq-0005PH-Bn
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:08 +0000
Message-Id: <E1Tkmoq-0005PH-Bn@xenbits.xen.org>
Date: Tue, 18 Dec 2012 02:22:07 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] update Xen version to 4.2.1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355756074 -3600
# Node ID 25b021aa35ebdb08b53fd7acf36dfed184989933
# Parent  bfdbf9747fc4eb8f76dea0b881ae1c4acc6da3a8
update Xen version to 4.2.1
---


diff -r bfdbf9747fc4 -r 25b021aa35eb Config.mk
--- a/Config.mk	Thu Dec 13 14:30:44 2012 +0000
+++ b/Config.mk	Mon Dec 17 15:54:34 2012 +0100
@@ -202,7 +202,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.o
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.0
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.1
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
 # Update version to 1.6.3.2
@@ -214,7 +214,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.1-rc2
+QEMU_TAG ?= xen-4.2.1
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
diff -r bfdbf9747fc4 -r 25b021aa35eb xen/Makefile
--- a/xen/Makefile	Thu Dec 13 14:30:44 2012 +0000
+++ b/xen/Makefile	Mon Dec 17 15:54:34 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .1-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 02:22:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 02:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tkmp1-0004GX-5h; Tue, 18 Dec 2012 02:22:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmoz-0004GO-Ke
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:17 +0000
Received: from [85.158.143.35:27934] by server-2.bemta-4.messagelabs.com id
	62/AA-30861-853DFC05; Tue, 18 Dec 2012 02:22:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1355797329!13202431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23440 invoked from network); 18 Dec 2012 02:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 02:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmor-0007AY-CM
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmor-0005PW-1s
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:09 +0000
Message-Id: <E1Tkmor-0005PW-1s@xenbits.xen.org>
Date: Tue, 18 Dec 2012 02:22:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag RELEASE-4.2.1 for
	changeset 25b021aa35eb
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355756106 -3600
# Node ID c5dce958ad653003539a0c592bf750be0ad1409f
# Parent  25b021aa35ebdb08b53fd7acf36dfed184989933
Added tag RELEASE-4.2.1 for changeset 25b021aa35eb
---


diff -r 25b021aa35eb -r c5dce958ad65 .hgtags
--- a/.hgtags	Mon Dec 17 15:54:34 2012 +0100
+++ b/.hgtags	Mon Dec 17 15:55:06 2012 +0100
@@ -61,3 +61,4 @@ 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8
 af176624c3ae86141a4ad8617b5ec2a834a6c626 RELEASE-4.2.0
 b6f071324f5ed076bfd28c71b51521cdd38639ab 4.2.1-rc1
 bfa4df1dbe1dac55428437184f811d174d806755 4.2.1-rc2
+25b021aa35ebdb08b53fd7acf36dfed184989933 RELEASE-4.2.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 02:22:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 02:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tkmp1-0004GX-5h; Tue, 18 Dec 2012 02:22:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmoz-0004GO-Ke
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:17 +0000
Received: from [85.158.143.35:27934] by server-2.bemta-4.messagelabs.com id
	62/AA-30861-853DFC05; Tue, 18 Dec 2012 02:22:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1355797329!13202431!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23440 invoked from network); 18 Dec 2012 02:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 02:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmor-0007AY-CM
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tkmor-0005PW-1s
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 02:22:09 +0000
Message-Id: <E1Tkmor-0005PW-1s@xenbits.xen.org>
Date: Tue, 18 Dec 2012 02:22:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] Added tag RELEASE-4.2.1 for
	changeset 25b021aa35eb
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355756106 -3600
# Node ID c5dce958ad653003539a0c592bf750be0ad1409f
# Parent  25b021aa35ebdb08b53fd7acf36dfed184989933
Added tag RELEASE-4.2.1 for changeset 25b021aa35eb
---


diff -r 25b021aa35eb -r c5dce958ad65 .hgtags
--- a/.hgtags	Mon Dec 17 15:54:34 2012 +0100
+++ b/.hgtags	Mon Dec 17 15:55:06 2012 +0100
@@ -61,3 +61,4 @@ 14164c5f22c88a9dc1cfd7178f84a7fab2b82aa8
 af176624c3ae86141a4ad8617b5ec2a834a6c626 RELEASE-4.2.0
 b6f071324f5ed076bfd28c71b51521cdd38639ab 4.2.1-rc1
 bfa4df1dbe1dac55428437184f811d174d806755 4.2.1-rc2
+25b021aa35ebdb08b53fd7acf36dfed184989933 RELEASE-4.2.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 09:55:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 09:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TkttG-00089T-3q; Tue, 18 Dec 2012 09:55:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttE-00089O-CC
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:08 +0000
Received: from [85.158.139.83:45424] by server-16.bemta-5.messagelabs.com id
	0E/17-09208-B7D30D05; Tue, 18 Dec 2012 09:55:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1355824505!22987268!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4841 invoked from network); 18 Dec 2012 09:55:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 09:55:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttB-000432-37
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttA-0008Pq-JM
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:04 +0000
Message-Id: <E1TkttA-0008Pq-JM@xenbits.xen.org>
Date: Tue, 18 Dec 2012 09:55:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] blkback: do not leak mode
	property
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355822128 -3600
# Node ID 864f8414c071d33b4fdc51229055783df1619cf5
# Parent  b9b0a1e9130eb933a34b548508f9ee43fd6e4871
blkback: do not leak mode property

"be->mode" is obtained from xenbus_read(), which does a kmalloc() for
the message body. The short string is never released, so do it along
with freeing "be" itself, and make sure the string isn't kept when
backend_changed() doesn't complete successfully (which made it
desirable to slightly re-structure that function, so that the error
cleanup can be done in one place).

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r b9b0a1e9130e -r 864f8414c071 drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c	Mon Nov 26 09:30:49 2012 +0100
+++ b/drivers/xen/blkback/xenbus.c	Tue Dec 18 10:15:28 2012 +0100
@@ -198,6 +198,7 @@ static int blkback_remove(struct xenbus_
 		be->blkif = NULL;
 	}
 
+	kfree(be->mode);
 	kfree(be);
 	dev->dev.driver_data = NULL;
 	write_unlock(&sysfs_read_lock);
@@ -278,6 +279,7 @@ static void backend_changed(struct xenbu
 		= container_of(watch, struct backend_info, backend_watch);
 	struct xenbus_device *dev = be->dev;
 	int cdrom = 0;
+	unsigned long handle;
 	char *device_type;
 
 	DPRINTK("");
@@ -295,12 +297,12 @@ static void backend_changed(struct xenbu
 		return;
 	}
 
-	if ((be->major || be->minor) &&
-	    ((be->major != major) || (be->minor != minor))) {
-		printk(KERN_WARNING
-		       "blkback: changing physical device (from %x:%x to "
-		       "%x:%x) not supported.\n", be->major, be->minor,
-		       major, minor);
+	if (be->major | be->minor) {
+		if (be->major != major || be->minor != minor)
+			printk(KERN_WARNING "blkback: "
+			       "changing physical device (from %x:%x to "
+			       "%x:%x) not supported.\n",
+			       be->major, be->minor, major, minor);
 		return;
 	}
 
@@ -318,31 +320,30 @@ static void backend_changed(struct xenbu
 		kfree(device_type);
 	}
 
-	if (be->major == 0 && be->minor == 0) {
-		/* Front end dir is a number, which is used as the handle. */
+	/* Front end dir is a number, which is used as the handle. */
+	handle = simple_strtoul(strrchr(dev->otherend, '/') + 1, NULL, 0);
 
-		char *p = strrchr(dev->otherend, '/') + 1;
-		long handle = simple_strtoul(p, NULL, 0);
+	be->major = major;
+	be->minor = minor;
 
-		be->major = major;
-		be->minor = minor;
+	err = vbd_create(be->blkif, handle, major, minor,
+			 (NULL == strchr(be->mode, 'w')), cdrom);
 
-		err = vbd_create(be->blkif, handle, major, minor,
-				 (NULL == strchr(be->mode, 'w')), cdrom);
-		if (err) {
-			be->major = be->minor = 0;
-			xenbus_dev_fatal(dev, err, "creating vbd structure");
-			return;
-		}
-
+	if (err)
+		xenbus_dev_fatal(dev, err, "creating vbd structure");
+	else {
 		err = xenvbd_sysfs_addif(dev);
 		if (err) {
 			vbd_free(&be->blkif->vbd);
-			be->major = be->minor = 0;
 			xenbus_dev_fatal(dev, err, "creating sysfs entries");
-			return;
 		}
+	}
 
+	if (err) {
+		kfree(be->mode);
+		be->mode = NULL;
+		be->major = be->minor = 0;
+	} else {
 		/* We're potentially connected now */
 		update_blkif_status(be->blkif);
 	}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 09:55:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 09:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TkttG-00089T-3q; Tue, 18 Dec 2012 09:55:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttE-00089O-CC
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:08 +0000
Received: from [85.158.139.83:45424] by server-16.bemta-5.messagelabs.com id
	0E/17-09208-B7D30D05; Tue, 18 Dec 2012 09:55:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1355824505!22987268!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4841 invoked from network); 18 Dec 2012 09:55:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 09:55:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttB-000432-37
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttA-0008Pq-JM
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:04 +0000
Message-Id: <E1TkttA-0008Pq-JM@xenbits.xen.org>
Date: Tue, 18 Dec 2012 09:55:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] blkback: do not leak mode
	property
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355822128 -3600
# Node ID 864f8414c071d33b4fdc51229055783df1619cf5
# Parent  b9b0a1e9130eb933a34b548508f9ee43fd6e4871
blkback: do not leak mode property

"be->mode" is obtained from xenbus_read(), which does a kmalloc() for
the message body. The short string is never released, so do it along
with freeing "be" itself, and make sure the string isn't kept when
backend_changed() doesn't complete successfully (which made it
desirable to slightly re-structure that function, so that the error
cleanup can be done in one place).

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r b9b0a1e9130e -r 864f8414c071 drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c	Mon Nov 26 09:30:49 2012 +0100
+++ b/drivers/xen/blkback/xenbus.c	Tue Dec 18 10:15:28 2012 +0100
@@ -198,6 +198,7 @@ static int blkback_remove(struct xenbus_
 		be->blkif = NULL;
 	}
 
+	kfree(be->mode);
 	kfree(be);
 	dev->dev.driver_data = NULL;
 	write_unlock(&sysfs_read_lock);
@@ -278,6 +279,7 @@ static void backend_changed(struct xenbu
 		= container_of(watch, struct backend_info, backend_watch);
 	struct xenbus_device *dev = be->dev;
 	int cdrom = 0;
+	unsigned long handle;
 	char *device_type;
 
 	DPRINTK("");
@@ -295,12 +297,12 @@ static void backend_changed(struct xenbu
 		return;
 	}
 
-	if ((be->major || be->minor) &&
-	    ((be->major != major) || (be->minor != minor))) {
-		printk(KERN_WARNING
-		       "blkback: changing physical device (from %x:%x to "
-		       "%x:%x) not supported.\n", be->major, be->minor,
-		       major, minor);
+	if (be->major | be->minor) {
+		if (be->major != major || be->minor != minor)
+			printk(KERN_WARNING "blkback: "
+			       "changing physical device (from %x:%x to "
+			       "%x:%x) not supported.\n",
+			       be->major, be->minor, major, minor);
 		return;
 	}
 
@@ -318,31 +320,30 @@ static void backend_changed(struct xenbu
 		kfree(device_type);
 	}
 
-	if (be->major == 0 && be->minor == 0) {
-		/* Front end dir is a number, which is used as the handle. */
+	/* Front end dir is a number, which is used as the handle. */
+	handle = simple_strtoul(strrchr(dev->otherend, '/') + 1, NULL, 0);
 
-		char *p = strrchr(dev->otherend, '/') + 1;
-		long handle = simple_strtoul(p, NULL, 0);
+	be->major = major;
+	be->minor = minor;
 
-		be->major = major;
-		be->minor = minor;
+	err = vbd_create(be->blkif, handle, major, minor,
+			 (NULL == strchr(be->mode, 'w')), cdrom);
 
-		err = vbd_create(be->blkif, handle, major, minor,
-				 (NULL == strchr(be->mode, 'w')), cdrom);
-		if (err) {
-			be->major = be->minor = 0;
-			xenbus_dev_fatal(dev, err, "creating vbd structure");
-			return;
-		}
-
+	if (err)
+		xenbus_dev_fatal(dev, err, "creating vbd structure");
+	else {
 		err = xenvbd_sysfs_addif(dev);
 		if (err) {
 			vbd_free(&be->blkif->vbd);
-			be->major = be->minor = 0;
 			xenbus_dev_fatal(dev, err, "creating sysfs entries");
-			return;
 		}
+	}
 
+	if (err) {
+		kfree(be->mode);
+		be->mode = NULL;
+		be->major = be->minor = 0;
+	} else {
 		/* We're potentially connected now */
 		update_blkif_status(be->blkif);
 	}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 09:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 09:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TkttI-00089f-6q; Tue, 18 Dec 2012 09:55:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttG-00089Y-Q1
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:11 +0000
Received: from [85.158.137.99:17219] by server-15.bemta-3.messagelabs.com id
	D5/11-07921-D7D30D05; Tue, 18 Dec 2012 09:55:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1355824506!17546476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15083 invoked from network); 18 Dec 2012 09:55:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 09:55:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttB-000435-Nm
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttB-0008QB-DV
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:05 +0000
Message-Id: <E1TkttB-0008QB-DV@xenbits.xen.org>
Date: Tue, 18 Dec 2012 09:55:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] sync Xen public headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355823740 -3600
# Node ID 302f7c9423c9ab30f0cad07f334db90c05796f7d
# Parent  864f8414c071d33b4fdc51229055783df1619cf5
sync Xen public headers

(again without dropping ia64 bits)
---


diff -r 864f8414c071 -r 302f7c9423c9 drivers/xen/scsiback/scsiback.c
--- a/drivers/xen/scsiback/scsiback.c	Tue Dec 18 10:15:28 2012 +0100
+++ b/drivers/xen/scsiback/scsiback.c	Tue Dec 18 10:42:20 2012 +0100
@@ -52,8 +52,8 @@ struct list_head pending_free;
 DEFINE_SPINLOCK(pending_free_lock);
 DECLARE_WAIT_QUEUE_HEAD(pending_free_wq);
 
-int vscsiif_reqs = VSCSIIF_BACK_MAX_PENDING_REQS;
-module_param_named(reqs, vscsiif_reqs, int, 0);
+static unsigned int vscsiif_reqs = 128;
+module_param_named(reqs, vscsiif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of scsiback requests to allocate");
 
 static unsigned int log_print_stat = 0;
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/arch-arm.h
--- a/include/xen/interface/arch-arm.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/arch-arm.h	Tue Dec 18 10:42:20 2012 +0100
@@ -51,18 +51,36 @@
 
 #define XEN_HYPERCALL_TAG   0XEA1
 
+#define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 
 #ifndef __ASSEMBLY__
-#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
-    typedef struct { type *p; } __guest_handle_ ## name
+#define ___DEFINE_XEN_GUEST_HANDLE(name, type)                  \
+    typedef union { type *p; unsigned long q; }                 \
+        __guest_handle_ ## name;                                \
+    typedef union { type *p; uint64_aligned_t q; }              \
+        __guest_handle_64_ ## name;
 
+/*
+ * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
+ * in a struct in memory. On ARM is always 8 bytes sizes and 8 bytes
+ * aligned.
+ * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
+ * hypercall argument. It is 4 bytes on aarch and 8 bytes on aarch64.
+ */
 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
     ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
     ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
 #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
-#define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
+#define __XEN_GUEST_HANDLE(name)        __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
-#define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
+/* this is going to be changed on 64 bit */
+#define XEN_GUEST_HANDLE_PARAM(name)    __guest_handle_ ## name
+#define set_xen_guest_handle_raw(hnd, val)                  \
+    do {                                                    \
+        typeof(&(hnd)) _sxghr_tmp = &(hnd);                 \
+        _sxghr_tmp->q = 0;                                  \
+        _sxghr_tmp->p = val;                                \
+    } while ( 0 )
 #ifdef __XEN_TOOLS__
 #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
 #endif
@@ -122,9 +140,14 @@ typedef uint64_t xen_pfn_t;
 /* Only one. All other VCPUS must use VCPUOP_register_vcpu_info */
 #define XEN_LEGACY_MAX_VCPUS 1
 
-typedef uint32_t xen_ulong_t;
+typedef uint64_t xen_ulong_t;
+#define PRI_xen_ulong PRIx64
 
 struct vcpu_guest_context {
+#define _VGCF_online                   0
+#define VGCF_online                    (1<<_VGCF_online)
+    uint32_t flags;                         /* VGCF_* */
+
     struct cpu_user_regs user_regs;         /* User-level CPU registers     */
 
     uint32_t sctlr;
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/arch-x86/xen.h
--- a/include/xen/interface/arch-x86/xen.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/arch-x86/xen.h	Tue Dec 18 10:42:20 2012 +0100
@@ -38,12 +38,21 @@
     typedef type * __guest_handle_ ## name
 #endif
 
+/*
+ * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
+ * in a struct in memory.
+ * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
+ * hypercall argument.
+ * XEN_GUEST_HANDLE_PARAM and XEN_GUEST_HANDLE are the same on X86 but
+ * they might not be on other architectures.
+ */
 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
     ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
     ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
 #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
 #define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
+#define XEN_GUEST_HANDLE_PARAM(name)    XEN_GUEST_HANDLE(name)
 #define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
 #ifdef __XEN_TOOLS__
 #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
@@ -62,7 +71,7 @@ typedef unsigned long xen_pfn_t;
 #endif
 
 /*
- * SEGMENT DESCRIPTOR TABLES
+ * `incontents 200 segdesc Segment Descriptor Tables
  */
 /*
  * ` enum neg_errnoval
@@ -74,17 +83,31 @@ typedef unsigned long xen_pfn_t;
  * start of the GDT because some stupid OSes export hard-coded selector values
  * in their ABI. These hard-coded values are always near the start of the GDT,
  * so Xen places itself out of the way, at the far end of the GDT.
+ *
+ * NB The LDT is set using the MMUEXT_SET_LDT op of HYPERVISOR_mmuext_op
  */
 #define FIRST_RESERVED_GDT_PAGE  14
 #define FIRST_RESERVED_GDT_BYTE  (FIRST_RESERVED_GDT_PAGE * 4096)
 #define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8)
 
+
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_descriptor(u64 pa, u64 desc);
+ * `
+ * ` @pa   The machine physical address of the descriptor to
+ * `       update. Must be either a descriptor page or writable.
+ * ` @desc The descriptor value to update, in the same format as a
+ * `       native descriptor table entry.
+ */
+
 /* Maximum number of virtual CPUs in legacy multi-processor guests. */
 #define XEN_LEGACY_MAX_VCPUS 32
 
 #ifndef __ASSEMBLY__
 
 typedef unsigned long xen_ulong_t;
+#define PRI_xen_ulong "lx"
 
 /*
  * ` enum neg_errnoval
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/domctl.h	Tue Dec 18 10:42:20 2012 +0100
@@ -32,9 +32,9 @@
 #error "domctl operations are intended for use by node control tools only"
 #endif
 
-#include <xen/hvm/save.h>
 #include "xen.h"
 #include "grant_table.h"
+#include "hvm/save.h"
 
 #define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
 
@@ -136,7 +136,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getme
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
-#define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -857,6 +857,12 @@ struct xen_domctl_set_access_required {
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -922,6 +928,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -978,6 +985,7 @@ struct xen_domctl {
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/grant_table.h
--- a/include/xen/interface/grant_table.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/grant_table.h	Tue Dec 18 10:42:20 2012 +0100
@@ -385,7 +385,11 @@ struct gnttab_setup_table {
     uint32_t nr_frames;
     /* OUT parameters. */
     int16_t  status;              /* => enum grant_status */
+#if __XEN_INTERFACE_VERSION__ < 0x00040300
     XEN_GUEST_HANDLE(ulong) frame_list;
+#else
+    XEN_GUEST_HANDLE(xen_pfn_t) frame_list;
+#endif
 };
 typedef struct gnttab_setup_table gnttab_setup_table_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_t);
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/io/blkif.h
--- a/include/xen/interface/io/blkif.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/io/blkif.h	Tue Dec 18 10:42:20 2012 +0100
@@ -126,6 +126,34 @@
  *      of this type may still be returned at any time with the
  *      BLKIF_RSP_EOPNOTSUPP result code.
  *
+ * feature-persistent
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *      Notes: 7
+ *
+ *      A value of "1" indicates that the backend can keep the grants used
+ *      by the frontend driver mapped, so the same set of grants should be
+ *      used in all transactions. The maximum number of grants the backend
+ *      can map persistently depends on the implementation, but ideally it
+ *      should be RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST. Using this
+ *      feature the backend doesn't need to unmap each grant, preventing
+ *      costly TLB flushes. The backend driver should only map grants
+ *      persistently if the frontend supports it. If a backend driver chooses
+ *      to use the persistent protocol when the frontend doesn't support it,
+ *      it will probably hit the maximum number of persistently mapped grants
+ *      (due to the fact that the frontend won't be reusing the same grants),
+ *      and fall back to non-persistent mode. Backend implementations may
+ *      shrink or expand the number of persistently mapped grants without
+ *      notifying the frontend depending on memory constraints (this might
+ *      cause a performance degradation).
+ *
+ *      If a backend driver wants to limit the maximum number of persistently
+ *      mapped grants to a value less than RING_SIZE *
+ *      BLKIF_MAX_SEGMENTS_PER_REQUEST a LRU strategy should be used to
+ *      discard the grants that are less commonly used. Using a LRU in the
+ *      backend driver paired with a LIFO queue in the frontend will
+ *      allow us to have better performance in this scenario.
+ *
  *----------------------- Request Transport Parameters ------------------------
  *
  * max-ring-page-order
@@ -242,6 +270,27 @@
  *      The size of the frontend allocated request ring buffer in units of
  *      machine pages.  The value must be a power of 2.
  *
+ * feature-persistent
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *      Notes: 7, 8, 9
+ *
+ *      A value of "1" indicates that the frontend will reuse the same grants
+ *      for all transactions, allowing the backend to map them with write
+ *      access (even when it should be read-only). If the frontend hits the
+ *      maximum number of allowed persistently mapped grants, it can fallback
+ *      to non persistent mode. This will cause a performance degradation,
+ *      since the the backend driver will still try to map those grants
+ *      persistently. Since the persistent grants protocol is compatible with
+ *      the previous protocol, a frontend driver can choose to work in
+ *      persistent mode even when the backend doesn't support it.
+ *
+ *      It is recommended that the frontend driver stores the persistently
+ *      mapped grants in a LIFO queue, so a subset of all persistently mapped
+ *      grants gets used commonly. This is done in case the backend driver
+ *      decides to limit the maximum number of persistently mapped grants
+ *      to a value less than RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST.
+ *
  *------------------------- Virtual Device Properties -------------------------
  *
  * device-type
@@ -279,6 +328,17 @@
  *     'ring-ref' is used to communicate the grant reference for this
  *     page to the backend.  When using a multi-page ring, the 'ring-ref'
  *     node is not created.  Instead 'ring-ref0' - 'ring-refN' are used.
+ * (7) When using persistent grants data has to be copied from/to the page
+ *     where the grant is currently mapped. The overhead of doing this copy
+ *     however doesn't suppress the speed improvement of not having to unmap
+ *     the grants.
+ * (8) The frontend driver has to allow the backend driver to map all grants
+ *     with write access, even when they should be mapped read-only, since
+ *     further requests may reuse these grants and require write permissions.
+ * (9) Linux implementation doesn't have a limit on the maximum number of
+ *     grants that can be persistently mapped in the frontend driver, but
+ *     due to the frontent driver implementation it should never be bigger
+ *     than RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST.
  */
 
 /*
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/io/vscsiif.h
--- a/include/xen/interface/io/vscsiif.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/io/vscsiif.h	Tue Dec 18 10:42:20 2012 +0100
@@ -30,29 +30,33 @@
 #include "ring.h"
 #include "../grant_table.h"
 
-/* command between backend and frontend */
+/* commands between backend and frontend */
 #define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
 #define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
 #define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
-
-
-#define VSCSIIF_BACK_MAX_PENDING_REQS    128
+#define VSCSIIF_ACT_SCSI_SG_PRESET   4    /* Preset SG elements */
 
 /*
  * Maximum scatter/gather segments per request.
  *
- * Considering balance between allocating al least 16 "vscsiif_request"
- * structures on one page (4096bytes) and number of scatter gather 
- * needed, we decided to use 26 as a magic number.
+ * Considering balance between allocating at least 16 "vscsiif_request"
+ * structures on one page (4096 bytes) and the number of scatter/gather
+ * elements needed, we decided to use 26 as a magic number.
  */
 #define VSCSIIF_SG_TABLESIZE             26
 
 /*
- * base on linux kernel 2.6.18
+ * based on Linux kernel 2.6.18
  */
 #define VSCSIIF_MAX_COMMAND_SIZE         16
 #define VSCSIIF_SENSE_BUFFERSIZE         96
 
+struct scsiif_request_segment {
+    grant_ref_t gref;
+    uint16_t offset;
+    uint16_t length;
+};
+typedef struct scsiif_request_segment vscsiif_segment_t;
 
 struct vscsiif_request {
     uint16_t rqid;          /* private guest value, echoed in resp  */
@@ -69,18 +73,26 @@ struct vscsiif_request {
                                          DMA_NONE(3) requests  */
     uint8_t nr_segments;              /* Number of pieces of scatter-gather */
 
-    struct scsiif_request_segment {
-        grant_ref_t gref;
-        uint16_t offset;
-        uint16_t length;
-    } seg[VSCSIIF_SG_TABLESIZE];
+    vscsiif_segment_t seg[VSCSIIF_SG_TABLESIZE];
     uint32_t reserved[3];
 };
 typedef struct vscsiif_request vscsiif_request_t;
 
+#define VSCSIIF_SG_LIST_SIZE ((sizeof(vscsiif_request_t) - 4) \
+                              / sizeof(vscsiif_segment_t))
+
+struct vscsiif_sg_list {
+    /* First two fields must match struct vscsiif_request! */
+    uint16_t rqid;          /* private guest value, must match main req */
+    uint8_t act;            /* VSCSIIF_ACT_SCSI_SG_PRESET */
+    uint8_t nr_segments;    /* Number of pieces of scatter-gather */
+    vscsiif_segment_t seg[VSCSIIF_SG_LIST_SIZE];
+};
+typedef struct vscsiif_sg_list vscsiif_sg_list_t;
+
 struct vscsiif_response {
     uint16_t rqid;
-    uint8_t padding;
+    uint8_t act;               /* valid only when backend supports SG_PRESET */
     uint8_t sense_len;
     uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];
     int32_t rslt;
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/memory.h
--- a/include/xen/interface/memory.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/memory.h	Tue Dec 18 10:42:20 2012 +0100
@@ -198,6 +198,15 @@ struct xen_machphys_mapping {
 typedef struct xen_machphys_mapping xen_machphys_mapping_t;
 DEFINE_XEN_GUEST_HANDLE(xen_machphys_mapping_t);
 
+/* Source mapping space. */
+/* ` enum phys_map_space { */
+#define XENMAPSPACE_shared_info  0 /* shared info page */
+#define XENMAPSPACE_grant_table  1 /* grant table page */
+#define XENMAPSPACE_gmfn         2 /* GMFN */
+#define XENMAPSPACE_gmfn_range   3 /* GMFN range */
+#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom */
+/* ` } */
+
 /*
  * Sets the GPFN at which a particular page appears in the specified guest's
  * pseudophysical address space.
@@ -211,24 +220,39 @@ struct xen_add_to_physmap {
     /* Number of pages to go through for gmfn_range */
     uint16_t    size;
 
-    /* Source mapping space. */
-#define XENMAPSPACE_shared_info 0 /* shared info page */
-#define XENMAPSPACE_grant_table 1 /* grant table page */
-#define XENMAPSPACE_gmfn        2 /* GMFN */
-#define XENMAPSPACE_gmfn_range  3 /* GMFN range */
-    unsigned int space;
+    unsigned int space; /* => enum phys_map_space */
 
 #define XENMAPIDX_grant_table_status 0x80000000
 
-    /* Index into source mapping space. */
+    /* Index into space being mapped. */
     xen_ulong_t idx;
 
-    /* GPFN where the source mapping page should appear. */
+    /* GPFN in domid where the source mapping page should appear. */
     xen_pfn_t     gpfn;
 };
 typedef struct xen_add_to_physmap xen_add_to_physmap_t;
 DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);
 
+/* A batched version of add_to_physmap. */
+#define XENMEM_add_to_physmap_range 23
+struct xen_add_to_physmap_range {
+    /* Which domain to change the mapping for. */
+    domid_t domid;
+    uint16_t space; /* => enum phys_map_space */
+
+    /* Number of pages to go through */
+    uint16_t size;
+    domid_t foreign_domid; /* IFF gmfn_foreign */
+
+    /* Indexes into space being mapped. */
+    XEN_GUEST_HANDLE(xen_ulong_t) idxs;
+
+    /* GPFN in domdwhere the source mapping page should appear. */
+    XEN_GUEST_HANDLE(xen_pfn_t) gpfns;
+};
+typedef struct xen_add_to_physmap_range xen_add_to_physmap_range_t;
+DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_range_t);
+
 /*
  * Unmaps the page appearing at a particular GPFN from the specified guest's
  * pseudophysical address space.
@@ -397,6 +421,12 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
 
+/*
+ * Reserve ops for future/out-of-tree "claim" patches (Oracle)
+ */
+#define XENMEM_claim_pages                  24
+#define XENMEM_get_unclaimed_pages          25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/sched.h
--- a/include/xen/interface/sched.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/sched.h	Tue Dec 18 10:42:20 2012 +0100
@@ -1,8 +1,8 @@
 /******************************************************************************
  * sched.h
- * 
+ *
  * Scheduler state interactions
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
  * deal in the Software without restriction, including without limitation the
@@ -30,20 +30,33 @@
 #include "event_channel.h"
 
 /*
+ * `incontents 150 sched Guest Scheduler Operations
+ *
+ * The SCHEDOP interface provides mechanisms for a guest to interact
+ * with the scheduler, including yield, blocking and shutting itself
+ * down.
+ */
+
+/*
  * The prototype for this hypercall is:
- *  long sched_op(int cmd, void *arg)
+ * ` long HYPERVISOR_sched_op(enum sched_op cmd, void *arg, ...)
+ *
  * @cmd == SCHEDOP_??? (scheduler operation).
  * @arg == Operation-specific extra argument(s), as described below.
- * 
+ * ...  == Additional Operation-specific extra arguments, described below.
+ *
  * Versions of Xen prior to 3.0.2 provided only the following legacy version
  * of this hypercall, supporting only the commands yield, block and shutdown:
  *  long sched_op(int cmd, unsigned long arg)
  * @cmd == SCHEDOP_??? (scheduler operation).
  * @arg == 0               (SCHEDOP_yield and SCHEDOP_block)
  *      == SHUTDOWN_* code (SCHEDOP_shutdown)
- * This legacy version is available to new guests as sched_op_compat().
+ *
+ * This legacy version is available to new guests as:
+ * ` long HYPERVISOR_sched_op_compat(enum sched_op cmd, unsigned long arg)
  */
 
+/* ` enum sched_op { // SCHEDOP_* => struct sched_* */
 /*
  * Voluntarily yield the CPU.
  * @arg == NULL.
@@ -61,21 +74,57 @@
 
 /*
  * Halt execution of this domain (all VCPUs) and notify the system controller.
- * @arg == pointer to sched_shutdown structure.
+ * @arg == pointer to sched_shutdown_t structure.
+ *
+ * If the sched_shutdown_t reason is SHUTDOWN_suspend then this
+ * hypercall takes an additional extra argument which should be the
+ * MFN of the guest's start_info_t.
+ *
+ * In addition, which reason is SHUTDOWN_suspend this hypercall
+ * returns 1 if suspend was cancelled or the domain was merely
+ * checkpointed, and 0 if it is resuming in a new domain.
  */
 #define SCHEDOP_shutdown    2
+
+/*
+ * Poll a set of event-channel ports. Return when one or more are pending. An
+ * optional timeout may be specified.
+ * @arg == pointer to sched_poll_t structure.
+ */
+#define SCHEDOP_poll        3
+
+/*
+ * Declare a shutdown for another domain. The main use of this function is
+ * in interpreting shutdown requests and reasons for fully-virtualized
+ * domains.  A para-virtualized domain may use SCHEDOP_shutdown directly.
+ * @arg == pointer to sched_remote_shutdown_t structure.
+ */
+#define SCHEDOP_remote_shutdown        4
+
+/*
+ * Latch a shutdown code, so that when the domain later shuts down it
+ * reports this code to the control tools.
+ * @arg == sched_shutdown_t, as for SCHEDOP_shutdown.
+ */
+#define SCHEDOP_shutdown_code 5
+
+/*
+ * Setup, poke and destroy a domain watchdog timer.
+ * @arg == pointer to sched_watchdog_t structure.
+ * With id == 0, setup a domain watchdog timer to cause domain shutdown
+ *               after timeout, returns watchdog id.
+ * With id != 0 and timeout == 0, destroy domain watchdog timer.
+ * With id != 0 and timeout != 0, poke watchdog timer and set new timeout.
+ */
+#define SCHEDOP_watchdog    6
+/* ` } */
+
 struct sched_shutdown {
-    unsigned int reason; /* SHUTDOWN_* */
+    unsigned int reason; /* SHUTDOWN_* => enum sched_shutdown_reason */
 };
 typedef struct sched_shutdown sched_shutdown_t;
 DEFINE_XEN_GUEST_HANDLE(sched_shutdown_t);
 
-/*
- * Poll a set of event-channel ports. Return when one or more are pending. An
- * optional timeout may be specified.
- * @arg == pointer to sched_poll structure.
- */
-#define SCHEDOP_poll        3
 struct sched_poll {
     XEN_GUEST_HANDLE(evtchn_port_t) ports;
     unsigned int nr_ports;
@@ -84,36 +133,13 @@ struct sched_poll {
 typedef struct sched_poll sched_poll_t;
 DEFINE_XEN_GUEST_HANDLE(sched_poll_t);
 
-/*
- * Declare a shutdown for another domain. The main use of this function is
- * in interpreting shutdown requests and reasons for fully-virtualized
- * domains.  A para-virtualized domain may use SCHEDOP_shutdown directly.
- * @arg == pointer to sched_remote_shutdown structure.
- */
-#define SCHEDOP_remote_shutdown        4
 struct sched_remote_shutdown {
     domid_t domain_id;         /* Remote domain ID */
-    unsigned int reason;       /* SHUTDOWN_xxx reason */
+    unsigned int reason;       /* SHUTDOWN_* => enum sched_shutdown_reason */
 };
 typedef struct sched_remote_shutdown sched_remote_shutdown_t;
 DEFINE_XEN_GUEST_HANDLE(sched_remote_shutdown_t);
 
-/*
- * Latch a shutdown code, so that when the domain later shuts down it
- * reports this code to the control tools.
- * @arg == as for SCHEDOP_shutdown.
- */
-#define SCHEDOP_shutdown_code 5
-
-/*
- * Setup, poke and destroy a domain watchdog timer.
- * @arg == pointer to sched_watchdog structure.
- * With id == 0, setup a domain watchdog timer to cause domain shutdown
- *               after timeout, returns watchdog id.
- * With id != 0 and timeout == 0, destroy domain watchdog timer.
- * With id != 0 and timeout != 0, poke watchdog timer and set new timeout.
- */
-#define SCHEDOP_watchdog    6
 struct sched_watchdog {
     uint32_t id;                /* watchdog ID */
     uint32_t timeout;           /* timeout */
@@ -126,11 +152,13 @@ DEFINE_XEN_GUEST_HANDLE(sched_watchdog_t
  * software to determine the appropriate action. For the most part, Xen does
  * not care about the shutdown code.
  */
+/* ` enum sched_shutdown_reason { */
 #define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
 #define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
 #define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
 #define SHUTDOWN_crash      3  /* Tell controller we've crashed.             */
 #define SHUTDOWN_watchdog   4  /* Restart because watchdog time expired.     */
+/* ` } */
 
 #endif /* __XEN_PUBLIC_SCHED_H__ */
 
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/version.h
--- a/include/xen/interface/version.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/version.h	Tue Dec 18 10:42:20 2012 +0100
@@ -28,6 +28,8 @@
 #ifndef __XEN_PUBLIC_VERSION_H__
 #define __XEN_PUBLIC_VERSION_H__
 
+#include "xen.h"
+
 /* NB. All ops return zero on success, except XENVER_{version,pagesize} */
 
 /* arg == NULL; returns major:minor (16:16). */
@@ -58,7 +60,7 @@ typedef char xen_changeset_info_t[64];
 
 #define XENVER_platform_parameters 5
 struct xen_platform_parameters {
-    unsigned long virt_start;
+    xen_ulong_t virt_start;
 };
 typedef struct xen_platform_parameters xen_platform_parameters_t;
 
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/xen-compat.h
--- a/include/xen/interface/xen-compat.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/xen-compat.h	Tue Dec 18 10:42:20 2012 +0100
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040200
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040300
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/xen.h
--- a/include/xen/interface/xen.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/xen.h	Tue Dec 18 10:42:20 2012 +0100
@@ -45,12 +45,15 @@ DEFINE_XEN_GUEST_HANDLE(char);
 __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
 DEFINE_XEN_GUEST_HANDLE(int);
 __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
+#if __XEN_INTERFACE_VERSION__ < 0x00040300
 DEFINE_XEN_GUEST_HANDLE(long);
 __DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
+#endif
 DEFINE_XEN_GUEST_HANDLE(void);
 
 DEFINE_XEN_GUEST_HANDLE(uint64_t);
 DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
+DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #endif
 
 /*
@@ -318,48 +321,54 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 
 /*
  * MMU EXTENDED OPERATIONS
- * 
- * HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
+ *
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_mmuext_op(mmuext_op_t uops[],
+ * `                      unsigned int count,
+ * `                      unsigned int *pdone,
+ * `                      unsigned int foreigndom)
+ */
+/* HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
  * A foreigndom (FD) can be specified (or DOMID_SELF for none).
  * Where the FD has some effect, it is described below.
- * 
+ *
  * cmd: MMUEXT_(UN)PIN_*_TABLE
  * mfn: Machine frame number to be (un)pinned as a p.t. page.
  *      The frame must belong to the FD, if one is specified.
- * 
+ *
  * cmd: MMUEXT_NEW_BASEPTR
  * mfn: Machine frame number of new page-table base to install in MMU.
- * 
+ *
  * cmd: MMUEXT_NEW_USER_BASEPTR [x86/64 only]
  * mfn: Machine frame number of new page-table base to install in MMU
  *      when in user space.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_LOCAL
  * No additional arguments. Flushes local TLB.
- * 
+ *
  * cmd: MMUEXT_INVLPG_LOCAL
  * linear_addr: Linear address to be flushed from the local TLB.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_MULTI
  * vcpumask: Pointer to bitmap of VCPUs to be flushed.
- * 
+ *
  * cmd: MMUEXT_INVLPG_MULTI
  * linear_addr: Linear address to be flushed.
  * vcpumask: Pointer to bitmap of VCPUs to be flushed.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_ALL
  * No additional arguments. Flushes all VCPUs' TLBs.
- * 
+ *
  * cmd: MMUEXT_INVLPG_ALL
  * linear_addr: Linear address to be flushed from all VCPUs' TLBs.
- * 
+ *
  * cmd: MMUEXT_FLUSH_CACHE
  * No additional arguments. Writes back and flushes cache contents.
  *
  * cmd: MMUEXT_FLUSH_CACHE_GLOBAL
  * No additional arguments. Writes back and flushes cache contents
  * on all CPUs in the system.
- * 
+ *
  * cmd: MMUEXT_SET_LDT
  * linear_addr: Linear address of LDT base (NB. must be page-aligned).
  * nr_ents: Number of entries in LDT.
@@ -374,6 +383,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
  * cmd: MMUEXT_[UN]MARK_SUPER
  * mfn: Machine frame number of head of superpage to be [un]marked.
  */
+/* ` enum mmuext_cmd { */
 #define MMUEXT_PIN_L1_TABLE      0
 #define MMUEXT_PIN_L2_TABLE      1
 #define MMUEXT_PIN_L3_TABLE      2
@@ -394,10 +404,11 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define MMUEXT_FLUSH_CACHE_GLOBAL 18
 #define MMUEXT_MARK_SUPER       19
 #define MMUEXT_UNMARK_SUPER     20
+/* ` } */
 
 #ifndef __ASSEMBLY__
 struct mmuext_op {
-    unsigned int cmd;
+    unsigned int cmd; /* => enum mmuext_cmd */
     union {
         /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR
          * CLEAR_PAGE, COPY_PAGE, [UN]MARK_SUPER */
@@ -422,9 +433,24 @@ typedef struct mmuext_op mmuext_op_t;
 DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #endif
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
+ * `                              enum uvm_flags flags)
+ * `
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, u64 val,
+ * `                                          enum uvm_flags flags,
+ * `                                          domid_t domid)
+ * `
+ * ` @va: The virtual address whose mapping we want to change
+ * ` @val: The new page table entry, must contain a machine address
+ * ` @flags: Control TLB flushes
+ */
 /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
 /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap.   */
 /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer.         */
+/* ` enum uvm_flags { */
 #define UVMF_NONE               (0UL<<0) /* No flushing at all.   */
 #define UVMF_TLB_FLUSH          (1UL<<0) /* Flush entire TLB(s).  */
 #define UVMF_INVLPG             (2UL<<0) /* Flush only one entry. */
@@ -432,6 +458,7 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #define UVMF_MULTI              (0UL<<2) /* Flush subset of TLBs. */
 #define UVMF_LOCAL              (0UL<<2) /* Flush local TLB.      */
 #define UVMF_ALL                (1UL<<2) /* Flush all TLBs.       */
+/* ` } */
 
 /*
  * Commands to HYPERVISOR_console_io().
@@ -514,7 +541,10 @@ typedef struct mmu_update mmu_update_t;
 DEFINE_XEN_GUEST_HANDLE(mmu_update_t);
 
 /*
- * Send an array of these to HYPERVISOR_multicall().
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_multicall(multicall_entry_t call_list[],
+ * `                      unsigned int nr_calls);
+ *
  * NB. The fields are natural register size for this architecture.
  */
 struct multicall_entry {
@@ -654,7 +684,8 @@ typedef struct shared_info shared_info_t
 #endif
 
 /*
- * Start-of-day memory layout:
+ * `incontents 200 startofday Start-of-day memory layout
+ *
  *  1. The domain is started within contiguous virtual-memory region.
  *  2. The contiguous region ends on an aligned 4MB boundary.
  *  3. This the order of bootstrap elements in the initial virtual region:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 09:55:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 09:55:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TkttI-00089f-6q; Tue, 18 Dec 2012 09:55:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttG-00089Y-Q1
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:11 +0000
Received: from [85.158.137.99:17219] by server-15.bemta-3.messagelabs.com id
	D5/11-07921-D7D30D05; Tue, 18 Dec 2012 09:55:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1355824506!17546476!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15083 invoked from network); 18 Dec 2012 09:55:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 09:55:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttB-000435-Nm
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkttB-0008QB-DV
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 09:55:05 +0000
Message-Id: <E1TkttB-0008QB-DV@xenbits.xen.org>
Date: Tue, 18 Dec 2012 09:55:04 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] sync Xen public headers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355823740 -3600
# Node ID 302f7c9423c9ab30f0cad07f334db90c05796f7d
# Parent  864f8414c071d33b4fdc51229055783df1619cf5
sync Xen public headers

(again without dropping ia64 bits)
---


diff -r 864f8414c071 -r 302f7c9423c9 drivers/xen/scsiback/scsiback.c
--- a/drivers/xen/scsiback/scsiback.c	Tue Dec 18 10:15:28 2012 +0100
+++ b/drivers/xen/scsiback/scsiback.c	Tue Dec 18 10:42:20 2012 +0100
@@ -52,8 +52,8 @@ struct list_head pending_free;
 DEFINE_SPINLOCK(pending_free_lock);
 DECLARE_WAIT_QUEUE_HEAD(pending_free_wq);
 
-int vscsiif_reqs = VSCSIIF_BACK_MAX_PENDING_REQS;
-module_param_named(reqs, vscsiif_reqs, int, 0);
+static unsigned int vscsiif_reqs = 128;
+module_param_named(reqs, vscsiif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of scsiback requests to allocate");
 
 static unsigned int log_print_stat = 0;
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/arch-arm.h
--- a/include/xen/interface/arch-arm.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/arch-arm.h	Tue Dec 18 10:42:20 2012 +0100
@@ -51,18 +51,36 @@
 
 #define XEN_HYPERCALL_TAG   0XEA1
 
+#define uint64_aligned_t uint64_t __attribute__((aligned(8)))
 
 #ifndef __ASSEMBLY__
-#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
-    typedef struct { type *p; } __guest_handle_ ## name
+#define ___DEFINE_XEN_GUEST_HANDLE(name, type)                  \
+    typedef union { type *p; unsigned long q; }                 \
+        __guest_handle_ ## name;                                \
+    typedef union { type *p; uint64_aligned_t q; }              \
+        __guest_handle_64_ ## name;
 
+/*
+ * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
+ * in a struct in memory. On ARM is always 8 bytes sizes and 8 bytes
+ * aligned.
+ * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
+ * hypercall argument. It is 4 bytes on aarch and 8 bytes on aarch64.
+ */
 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
     ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
     ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
 #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
-#define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
+#define __XEN_GUEST_HANDLE(name)        __guest_handle_64_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
-#define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
+/* this is going to be changed on 64 bit */
+#define XEN_GUEST_HANDLE_PARAM(name)    __guest_handle_ ## name
+#define set_xen_guest_handle_raw(hnd, val)                  \
+    do {                                                    \
+        typeof(&(hnd)) _sxghr_tmp = &(hnd);                 \
+        _sxghr_tmp->q = 0;                                  \
+        _sxghr_tmp->p = val;                                \
+    } while ( 0 )
 #ifdef __XEN_TOOLS__
 #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
 #endif
@@ -122,9 +140,14 @@ typedef uint64_t xen_pfn_t;
 /* Only one. All other VCPUS must use VCPUOP_register_vcpu_info */
 #define XEN_LEGACY_MAX_VCPUS 1
 
-typedef uint32_t xen_ulong_t;
+typedef uint64_t xen_ulong_t;
+#define PRI_xen_ulong PRIx64
 
 struct vcpu_guest_context {
+#define _VGCF_online                   0
+#define VGCF_online                    (1<<_VGCF_online)
+    uint32_t flags;                         /* VGCF_* */
+
     struct cpu_user_regs user_regs;         /* User-level CPU registers     */
 
     uint32_t sctlr;
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/arch-x86/xen.h
--- a/include/xen/interface/arch-x86/xen.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/arch-x86/xen.h	Tue Dec 18 10:42:20 2012 +0100
@@ -38,12 +38,21 @@
     typedef type * __guest_handle_ ## name
 #endif
 
+/*
+ * XEN_GUEST_HANDLE represents a guest pointer, when passed as a field
+ * in a struct in memory.
+ * XEN_GUEST_HANDLE_PARAM represent a guest pointer, when passed as an
+ * hypercall argument.
+ * XEN_GUEST_HANDLE_PARAM and XEN_GUEST_HANDLE are the same on X86 but
+ * they might not be on other architectures.
+ */
 #define __DEFINE_XEN_GUEST_HANDLE(name, type) \
     ___DEFINE_XEN_GUEST_HANDLE(name, type);   \
     ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
 #define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name, name)
 #define __XEN_GUEST_HANDLE(name)        __guest_handle_ ## name
 #define XEN_GUEST_HANDLE(name)          __XEN_GUEST_HANDLE(name)
+#define XEN_GUEST_HANDLE_PARAM(name)    XEN_GUEST_HANDLE(name)
 #define set_xen_guest_handle_raw(hnd, val)  do { (hnd).p = val; } while (0)
 #ifdef __XEN_TOOLS__
 #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
@@ -62,7 +71,7 @@ typedef unsigned long xen_pfn_t;
 #endif
 
 /*
- * SEGMENT DESCRIPTOR TABLES
+ * `incontents 200 segdesc Segment Descriptor Tables
  */
 /*
  * ` enum neg_errnoval
@@ -74,17 +83,31 @@ typedef unsigned long xen_pfn_t;
  * start of the GDT because some stupid OSes export hard-coded selector values
  * in their ABI. These hard-coded values are always near the start of the GDT,
  * so Xen places itself out of the way, at the far end of the GDT.
+ *
+ * NB The LDT is set using the MMUEXT_SET_LDT op of HYPERVISOR_mmuext_op
  */
 #define FIRST_RESERVED_GDT_PAGE  14
 #define FIRST_RESERVED_GDT_BYTE  (FIRST_RESERVED_GDT_PAGE * 4096)
 #define FIRST_RESERVED_GDT_ENTRY (FIRST_RESERVED_GDT_BYTE / 8)
 
+
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_descriptor(u64 pa, u64 desc);
+ * `
+ * ` @pa   The machine physical address of the descriptor to
+ * `       update. Must be either a descriptor page or writable.
+ * ` @desc The descriptor value to update, in the same format as a
+ * `       native descriptor table entry.
+ */
+
 /* Maximum number of virtual CPUs in legacy multi-processor guests. */
 #define XEN_LEGACY_MAX_VCPUS 32
 
 #ifndef __ASSEMBLY__
 
 typedef unsigned long xen_ulong_t;
+#define PRI_xen_ulong "lx"
 
 /*
  * ` enum neg_errnoval
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/domctl.h	Tue Dec 18 10:42:20 2012 +0100
@@ -32,9 +32,9 @@
 #error "domctl operations are intended for use by node control tools only"
 #endif
 
-#include <xen/hvm/save.h>
 #include "xen.h"
 #include "grant_table.h"
+#include "hvm/save.h"
 
 #define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
 
@@ -136,7 +136,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getme
 #define XEN_DOMCTL_PFINFO_LPINTAB (0x1U<<31)
 #define XEN_DOMCTL_PFINFO_XTAB    (0xfU<<28) /* invalid page */
 #define XEN_DOMCTL_PFINFO_XALLOC  (0xeU<<28) /* allocate-only page */
-#define XEN_DOMCTL_PFINFO_PAGEDTAB (0x8U<<28)
+#define XEN_DOMCTL_PFINFO_BROKEN  (0xdU<<28) /* broken page */
 #define XEN_DOMCTL_PFINFO_LTAB_MASK (0xfU<<28)
 
 struct xen_domctl_getpageframeinfo {
@@ -857,6 +857,12 @@ struct xen_domctl_set_access_required {
 typedef struct xen_domctl_set_access_required xen_domctl_set_access_required_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_access_required_t);
 
+struct xen_domctl_set_broken_page_p2m {
+    uint64_aligned_t pfn;
+};
+typedef struct xen_domctl_set_broken_page_p2m xen_domctl_set_broken_page_p2m_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_set_broken_page_p2m_t);
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -922,6 +928,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_set_access_required           64
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
+#define XEN_DOMCTL_set_broken_page_p2m           67
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -978,6 +985,7 @@ struct xen_domctl {
         struct xen_domctl_audit_p2m         audit_p2m;
         struct xen_domctl_set_virq_handler  set_virq_handler;
         struct xen_domctl_gdbsx_memio       gdbsx_guest_memio;
+        struct xen_domctl_set_broken_page_p2m set_broken_page_p2m;
         struct xen_domctl_gdbsx_pauseunp_vcpu gdbsx_pauseunp_vcpu;
         struct xen_domctl_gdbsx_domstatus   gdbsx_domstatus;
         uint8_t                             pad[128];
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/grant_table.h
--- a/include/xen/interface/grant_table.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/grant_table.h	Tue Dec 18 10:42:20 2012 +0100
@@ -385,7 +385,11 @@ struct gnttab_setup_table {
     uint32_t nr_frames;
     /* OUT parameters. */
     int16_t  status;              /* => enum grant_status */
+#if __XEN_INTERFACE_VERSION__ < 0x00040300
     XEN_GUEST_HANDLE(ulong) frame_list;
+#else
+    XEN_GUEST_HANDLE(xen_pfn_t) frame_list;
+#endif
 };
 typedef struct gnttab_setup_table gnttab_setup_table_t;
 DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_t);
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/io/blkif.h
--- a/include/xen/interface/io/blkif.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/io/blkif.h	Tue Dec 18 10:42:20 2012 +0100
@@ -126,6 +126,34 @@
  *      of this type may still be returned at any time with the
  *      BLKIF_RSP_EOPNOTSUPP result code.
  *
+ * feature-persistent
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *      Notes: 7
+ *
+ *      A value of "1" indicates that the backend can keep the grants used
+ *      by the frontend driver mapped, so the same set of grants should be
+ *      used in all transactions. The maximum number of grants the backend
+ *      can map persistently depends on the implementation, but ideally it
+ *      should be RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST. Using this
+ *      feature the backend doesn't need to unmap each grant, preventing
+ *      costly TLB flushes. The backend driver should only map grants
+ *      persistently if the frontend supports it. If a backend driver chooses
+ *      to use the persistent protocol when the frontend doesn't support it,
+ *      it will probably hit the maximum number of persistently mapped grants
+ *      (due to the fact that the frontend won't be reusing the same grants),
+ *      and fall back to non-persistent mode. Backend implementations may
+ *      shrink or expand the number of persistently mapped grants without
+ *      notifying the frontend depending on memory constraints (this might
+ *      cause a performance degradation).
+ *
+ *      If a backend driver wants to limit the maximum number of persistently
+ *      mapped grants to a value less than RING_SIZE *
+ *      BLKIF_MAX_SEGMENTS_PER_REQUEST a LRU strategy should be used to
+ *      discard the grants that are less commonly used. Using a LRU in the
+ *      backend driver paired with a LIFO queue in the frontend will
+ *      allow us to have better performance in this scenario.
+ *
  *----------------------- Request Transport Parameters ------------------------
  *
  * max-ring-page-order
@@ -242,6 +270,27 @@
  *      The size of the frontend allocated request ring buffer in units of
  *      machine pages.  The value must be a power of 2.
  *
+ * feature-persistent
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *      Notes: 7, 8, 9
+ *
+ *      A value of "1" indicates that the frontend will reuse the same grants
+ *      for all transactions, allowing the backend to map them with write
+ *      access (even when it should be read-only). If the frontend hits the
+ *      maximum number of allowed persistently mapped grants, it can fallback
+ *      to non persistent mode. This will cause a performance degradation,
+ *      since the the backend driver will still try to map those grants
+ *      persistently. Since the persistent grants protocol is compatible with
+ *      the previous protocol, a frontend driver can choose to work in
+ *      persistent mode even when the backend doesn't support it.
+ *
+ *      It is recommended that the frontend driver stores the persistently
+ *      mapped grants in a LIFO queue, so a subset of all persistently mapped
+ *      grants gets used commonly. This is done in case the backend driver
+ *      decides to limit the maximum number of persistently mapped grants
+ *      to a value less than RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST.
+ *
  *------------------------- Virtual Device Properties -------------------------
  *
  * device-type
@@ -279,6 +328,17 @@
  *     'ring-ref' is used to communicate the grant reference for this
  *     page to the backend.  When using a multi-page ring, the 'ring-ref'
  *     node is not created.  Instead 'ring-ref0' - 'ring-refN' are used.
+ * (7) When using persistent grants data has to be copied from/to the page
+ *     where the grant is currently mapped. The overhead of doing this copy
+ *     however doesn't suppress the speed improvement of not having to unmap
+ *     the grants.
+ * (8) The frontend driver has to allow the backend driver to map all grants
+ *     with write access, even when they should be mapped read-only, since
+ *     further requests may reuse these grants and require write permissions.
+ * (9) Linux implementation doesn't have a limit on the maximum number of
+ *     grants that can be persistently mapped in the frontend driver, but
+ *     due to the frontent driver implementation it should never be bigger
+ *     than RING_SIZE * BLKIF_MAX_SEGMENTS_PER_REQUEST.
  */
 
 /*
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/io/vscsiif.h
--- a/include/xen/interface/io/vscsiif.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/io/vscsiif.h	Tue Dec 18 10:42:20 2012 +0100
@@ -30,29 +30,33 @@
 #include "ring.h"
 #include "../grant_table.h"
 
-/* command between backend and frontend */
+/* commands between backend and frontend */
 #define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
 #define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
 #define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
-
-
-#define VSCSIIF_BACK_MAX_PENDING_REQS    128
+#define VSCSIIF_ACT_SCSI_SG_PRESET   4    /* Preset SG elements */
 
 /*
  * Maximum scatter/gather segments per request.
  *
- * Considering balance between allocating al least 16 "vscsiif_request"
- * structures on one page (4096bytes) and number of scatter gather 
- * needed, we decided to use 26 as a magic number.
+ * Considering balance between allocating at least 16 "vscsiif_request"
+ * structures on one page (4096 bytes) and the number of scatter/gather
+ * elements needed, we decided to use 26 as a magic number.
  */
 #define VSCSIIF_SG_TABLESIZE             26
 
 /*
- * base on linux kernel 2.6.18
+ * based on Linux kernel 2.6.18
  */
 #define VSCSIIF_MAX_COMMAND_SIZE         16
 #define VSCSIIF_SENSE_BUFFERSIZE         96
 
+struct scsiif_request_segment {
+    grant_ref_t gref;
+    uint16_t offset;
+    uint16_t length;
+};
+typedef struct scsiif_request_segment vscsiif_segment_t;
 
 struct vscsiif_request {
     uint16_t rqid;          /* private guest value, echoed in resp  */
@@ -69,18 +73,26 @@ struct vscsiif_request {
                                          DMA_NONE(3) requests  */
     uint8_t nr_segments;              /* Number of pieces of scatter-gather */
 
-    struct scsiif_request_segment {
-        grant_ref_t gref;
-        uint16_t offset;
-        uint16_t length;
-    } seg[VSCSIIF_SG_TABLESIZE];
+    vscsiif_segment_t seg[VSCSIIF_SG_TABLESIZE];
     uint32_t reserved[3];
 };
 typedef struct vscsiif_request vscsiif_request_t;
 
+#define VSCSIIF_SG_LIST_SIZE ((sizeof(vscsiif_request_t) - 4) \
+                              / sizeof(vscsiif_segment_t))
+
+struct vscsiif_sg_list {
+    /* First two fields must match struct vscsiif_request! */
+    uint16_t rqid;          /* private guest value, must match main req */
+    uint8_t act;            /* VSCSIIF_ACT_SCSI_SG_PRESET */
+    uint8_t nr_segments;    /* Number of pieces of scatter-gather */
+    vscsiif_segment_t seg[VSCSIIF_SG_LIST_SIZE];
+};
+typedef struct vscsiif_sg_list vscsiif_sg_list_t;
+
 struct vscsiif_response {
     uint16_t rqid;
-    uint8_t padding;
+    uint8_t act;               /* valid only when backend supports SG_PRESET */
     uint8_t sense_len;
     uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];
     int32_t rslt;
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/memory.h
--- a/include/xen/interface/memory.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/memory.h	Tue Dec 18 10:42:20 2012 +0100
@@ -198,6 +198,15 @@ struct xen_machphys_mapping {
 typedef struct xen_machphys_mapping xen_machphys_mapping_t;
 DEFINE_XEN_GUEST_HANDLE(xen_machphys_mapping_t);
 
+/* Source mapping space. */
+/* ` enum phys_map_space { */
+#define XENMAPSPACE_shared_info  0 /* shared info page */
+#define XENMAPSPACE_grant_table  1 /* grant table page */
+#define XENMAPSPACE_gmfn         2 /* GMFN */
+#define XENMAPSPACE_gmfn_range   3 /* GMFN range */
+#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom */
+/* ` } */
+
 /*
  * Sets the GPFN at which a particular page appears in the specified guest's
  * pseudophysical address space.
@@ -211,24 +220,39 @@ struct xen_add_to_physmap {
     /* Number of pages to go through for gmfn_range */
     uint16_t    size;
 
-    /* Source mapping space. */
-#define XENMAPSPACE_shared_info 0 /* shared info page */
-#define XENMAPSPACE_grant_table 1 /* grant table page */
-#define XENMAPSPACE_gmfn        2 /* GMFN */
-#define XENMAPSPACE_gmfn_range  3 /* GMFN range */
-    unsigned int space;
+    unsigned int space; /* => enum phys_map_space */
 
 #define XENMAPIDX_grant_table_status 0x80000000
 
-    /* Index into source mapping space. */
+    /* Index into space being mapped. */
     xen_ulong_t idx;
 
-    /* GPFN where the source mapping page should appear. */
+    /* GPFN in domid where the source mapping page should appear. */
     xen_pfn_t     gpfn;
 };
 typedef struct xen_add_to_physmap xen_add_to_physmap_t;
 DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);
 
+/* A batched version of add_to_physmap. */
+#define XENMEM_add_to_physmap_range 23
+struct xen_add_to_physmap_range {
+    /* Which domain to change the mapping for. */
+    domid_t domid;
+    uint16_t space; /* => enum phys_map_space */
+
+    /* Number of pages to go through */
+    uint16_t size;
+    domid_t foreign_domid; /* IFF gmfn_foreign */
+
+    /* Indexes into space being mapped. */
+    XEN_GUEST_HANDLE(xen_ulong_t) idxs;
+
+    /* GPFN in domdwhere the source mapping page should appear. */
+    XEN_GUEST_HANDLE(xen_pfn_t) gpfns;
+};
+typedef struct xen_add_to_physmap_range xen_add_to_physmap_range_t;
+DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_range_t);
+
 /*
  * Unmaps the page appearing at a particular GPFN from the specified guest's
  * pseudophysical address space.
@@ -397,6 +421,12 @@ struct xen_mem_sharing_op {
 typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
 
+/*
+ * Reserve ops for future/out-of-tree "claim" patches (Oracle)
+ */
+#define XENMEM_claim_pages                  24
+#define XENMEM_get_unclaimed_pages          25
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/sched.h
--- a/include/xen/interface/sched.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/sched.h	Tue Dec 18 10:42:20 2012 +0100
@@ -1,8 +1,8 @@
 /******************************************************************************
  * sched.h
- * 
+ *
  * Scheduler state interactions
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
  * deal in the Software without restriction, including without limitation the
@@ -30,20 +30,33 @@
 #include "event_channel.h"
 
 /*
+ * `incontents 150 sched Guest Scheduler Operations
+ *
+ * The SCHEDOP interface provides mechanisms for a guest to interact
+ * with the scheduler, including yield, blocking and shutting itself
+ * down.
+ */
+
+/*
  * The prototype for this hypercall is:
- *  long sched_op(int cmd, void *arg)
+ * ` long HYPERVISOR_sched_op(enum sched_op cmd, void *arg, ...)
+ *
  * @cmd == SCHEDOP_??? (scheduler operation).
  * @arg == Operation-specific extra argument(s), as described below.
- * 
+ * ...  == Additional Operation-specific extra arguments, described below.
+ *
  * Versions of Xen prior to 3.0.2 provided only the following legacy version
  * of this hypercall, supporting only the commands yield, block and shutdown:
  *  long sched_op(int cmd, unsigned long arg)
  * @cmd == SCHEDOP_??? (scheduler operation).
  * @arg == 0               (SCHEDOP_yield and SCHEDOP_block)
  *      == SHUTDOWN_* code (SCHEDOP_shutdown)
- * This legacy version is available to new guests as sched_op_compat().
+ *
+ * This legacy version is available to new guests as:
+ * ` long HYPERVISOR_sched_op_compat(enum sched_op cmd, unsigned long arg)
  */
 
+/* ` enum sched_op { // SCHEDOP_* => struct sched_* */
 /*
  * Voluntarily yield the CPU.
  * @arg == NULL.
@@ -61,21 +74,57 @@
 
 /*
  * Halt execution of this domain (all VCPUs) and notify the system controller.
- * @arg == pointer to sched_shutdown structure.
+ * @arg == pointer to sched_shutdown_t structure.
+ *
+ * If the sched_shutdown_t reason is SHUTDOWN_suspend then this
+ * hypercall takes an additional extra argument which should be the
+ * MFN of the guest's start_info_t.
+ *
+ * In addition, which reason is SHUTDOWN_suspend this hypercall
+ * returns 1 if suspend was cancelled or the domain was merely
+ * checkpointed, and 0 if it is resuming in a new domain.
  */
 #define SCHEDOP_shutdown    2
+
+/*
+ * Poll a set of event-channel ports. Return when one or more are pending. An
+ * optional timeout may be specified.
+ * @arg == pointer to sched_poll_t structure.
+ */
+#define SCHEDOP_poll        3
+
+/*
+ * Declare a shutdown for another domain. The main use of this function is
+ * in interpreting shutdown requests and reasons for fully-virtualized
+ * domains.  A para-virtualized domain may use SCHEDOP_shutdown directly.
+ * @arg == pointer to sched_remote_shutdown_t structure.
+ */
+#define SCHEDOP_remote_shutdown        4
+
+/*
+ * Latch a shutdown code, so that when the domain later shuts down it
+ * reports this code to the control tools.
+ * @arg == sched_shutdown_t, as for SCHEDOP_shutdown.
+ */
+#define SCHEDOP_shutdown_code 5
+
+/*
+ * Setup, poke and destroy a domain watchdog timer.
+ * @arg == pointer to sched_watchdog_t structure.
+ * With id == 0, setup a domain watchdog timer to cause domain shutdown
+ *               after timeout, returns watchdog id.
+ * With id != 0 and timeout == 0, destroy domain watchdog timer.
+ * With id != 0 and timeout != 0, poke watchdog timer and set new timeout.
+ */
+#define SCHEDOP_watchdog    6
+/* ` } */
+
 struct sched_shutdown {
-    unsigned int reason; /* SHUTDOWN_* */
+    unsigned int reason; /* SHUTDOWN_* => enum sched_shutdown_reason */
 };
 typedef struct sched_shutdown sched_shutdown_t;
 DEFINE_XEN_GUEST_HANDLE(sched_shutdown_t);
 
-/*
- * Poll a set of event-channel ports. Return when one or more are pending. An
- * optional timeout may be specified.
- * @arg == pointer to sched_poll structure.
- */
-#define SCHEDOP_poll        3
 struct sched_poll {
     XEN_GUEST_HANDLE(evtchn_port_t) ports;
     unsigned int nr_ports;
@@ -84,36 +133,13 @@ struct sched_poll {
 typedef struct sched_poll sched_poll_t;
 DEFINE_XEN_GUEST_HANDLE(sched_poll_t);
 
-/*
- * Declare a shutdown for another domain. The main use of this function is
- * in interpreting shutdown requests and reasons for fully-virtualized
- * domains.  A para-virtualized domain may use SCHEDOP_shutdown directly.
- * @arg == pointer to sched_remote_shutdown structure.
- */
-#define SCHEDOP_remote_shutdown        4
 struct sched_remote_shutdown {
     domid_t domain_id;         /* Remote domain ID */
-    unsigned int reason;       /* SHUTDOWN_xxx reason */
+    unsigned int reason;       /* SHUTDOWN_* => enum sched_shutdown_reason */
 };
 typedef struct sched_remote_shutdown sched_remote_shutdown_t;
 DEFINE_XEN_GUEST_HANDLE(sched_remote_shutdown_t);
 
-/*
- * Latch a shutdown code, so that when the domain later shuts down it
- * reports this code to the control tools.
- * @arg == as for SCHEDOP_shutdown.
- */
-#define SCHEDOP_shutdown_code 5
-
-/*
- * Setup, poke and destroy a domain watchdog timer.
- * @arg == pointer to sched_watchdog structure.
- * With id == 0, setup a domain watchdog timer to cause domain shutdown
- *               after timeout, returns watchdog id.
- * With id != 0 and timeout == 0, destroy domain watchdog timer.
- * With id != 0 and timeout != 0, poke watchdog timer and set new timeout.
- */
-#define SCHEDOP_watchdog    6
 struct sched_watchdog {
     uint32_t id;                /* watchdog ID */
     uint32_t timeout;           /* timeout */
@@ -126,11 +152,13 @@ DEFINE_XEN_GUEST_HANDLE(sched_watchdog_t
  * software to determine the appropriate action. For the most part, Xen does
  * not care about the shutdown code.
  */
+/* ` enum sched_shutdown_reason { */
 #define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
 #define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
 #define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
 #define SHUTDOWN_crash      3  /* Tell controller we've crashed.             */
 #define SHUTDOWN_watchdog   4  /* Restart because watchdog time expired.     */
+/* ` } */
 
 #endif /* __XEN_PUBLIC_SCHED_H__ */
 
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/version.h
--- a/include/xen/interface/version.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/version.h	Tue Dec 18 10:42:20 2012 +0100
@@ -28,6 +28,8 @@
 #ifndef __XEN_PUBLIC_VERSION_H__
 #define __XEN_PUBLIC_VERSION_H__
 
+#include "xen.h"
+
 /* NB. All ops return zero on success, except XENVER_{version,pagesize} */
 
 /* arg == NULL; returns major:minor (16:16). */
@@ -58,7 +60,7 @@ typedef char xen_changeset_info_t[64];
 
 #define XENVER_platform_parameters 5
 struct xen_platform_parameters {
-    unsigned long virt_start;
+    xen_ulong_t virt_start;
 };
 typedef struct xen_platform_parameters xen_platform_parameters_t;
 
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/xen-compat.h
--- a/include/xen/interface/xen-compat.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/xen-compat.h	Tue Dec 18 10:42:20 2012 +0100
@@ -27,7 +27,7 @@
 #ifndef __XEN_PUBLIC_XEN_COMPAT_H__
 #define __XEN_PUBLIC_XEN_COMPAT_H__
 
-#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040200
+#define __XEN_LATEST_INTERFACE_VERSION__ 0x00040300
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Xen is built with matching headers and implements the latest interface. */
diff -r 864f8414c071 -r 302f7c9423c9 include/xen/interface/xen.h
--- a/include/xen/interface/xen.h	Tue Dec 18 10:15:28 2012 +0100
+++ b/include/xen/interface/xen.h	Tue Dec 18 10:42:20 2012 +0100
@@ -45,12 +45,15 @@ DEFINE_XEN_GUEST_HANDLE(char);
 __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char);
 DEFINE_XEN_GUEST_HANDLE(int);
 __DEFINE_XEN_GUEST_HANDLE(uint,  unsigned int);
+#if __XEN_INTERFACE_VERSION__ < 0x00040300
 DEFINE_XEN_GUEST_HANDLE(long);
 __DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);
+#endif
 DEFINE_XEN_GUEST_HANDLE(void);
 
 DEFINE_XEN_GUEST_HANDLE(uint64_t);
 DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
+DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #endif
 
 /*
@@ -318,48 +321,54 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 
 /*
  * MMU EXTENDED OPERATIONS
- * 
- * HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
+ *
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_mmuext_op(mmuext_op_t uops[],
+ * `                      unsigned int count,
+ * `                      unsigned int *pdone,
+ * `                      unsigned int foreigndom)
+ */
+/* HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
  * A foreigndom (FD) can be specified (or DOMID_SELF for none).
  * Where the FD has some effect, it is described below.
- * 
+ *
  * cmd: MMUEXT_(UN)PIN_*_TABLE
  * mfn: Machine frame number to be (un)pinned as a p.t. page.
  *      The frame must belong to the FD, if one is specified.
- * 
+ *
  * cmd: MMUEXT_NEW_BASEPTR
  * mfn: Machine frame number of new page-table base to install in MMU.
- * 
+ *
  * cmd: MMUEXT_NEW_USER_BASEPTR [x86/64 only]
  * mfn: Machine frame number of new page-table base to install in MMU
  *      when in user space.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_LOCAL
  * No additional arguments. Flushes local TLB.
- * 
+ *
  * cmd: MMUEXT_INVLPG_LOCAL
  * linear_addr: Linear address to be flushed from the local TLB.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_MULTI
  * vcpumask: Pointer to bitmap of VCPUs to be flushed.
- * 
+ *
  * cmd: MMUEXT_INVLPG_MULTI
  * linear_addr: Linear address to be flushed.
  * vcpumask: Pointer to bitmap of VCPUs to be flushed.
- * 
+ *
  * cmd: MMUEXT_TLB_FLUSH_ALL
  * No additional arguments. Flushes all VCPUs' TLBs.
- * 
+ *
  * cmd: MMUEXT_INVLPG_ALL
  * linear_addr: Linear address to be flushed from all VCPUs' TLBs.
- * 
+ *
  * cmd: MMUEXT_FLUSH_CACHE
  * No additional arguments. Writes back and flushes cache contents.
  *
  * cmd: MMUEXT_FLUSH_CACHE_GLOBAL
  * No additional arguments. Writes back and flushes cache contents
  * on all CPUs in the system.
- * 
+ *
  * cmd: MMUEXT_SET_LDT
  * linear_addr: Linear address of LDT base (NB. must be page-aligned).
  * nr_ents: Number of entries in LDT.
@@ -374,6 +383,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
  * cmd: MMUEXT_[UN]MARK_SUPER
  * mfn: Machine frame number of head of superpage to be [un]marked.
  */
+/* ` enum mmuext_cmd { */
 #define MMUEXT_PIN_L1_TABLE      0
 #define MMUEXT_PIN_L2_TABLE      1
 #define MMUEXT_PIN_L3_TABLE      2
@@ -394,10 +404,11 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define MMUEXT_FLUSH_CACHE_GLOBAL 18
 #define MMUEXT_MARK_SUPER       19
 #define MMUEXT_UNMARK_SUPER     20
+/* ` } */
 
 #ifndef __ASSEMBLY__
 struct mmuext_op {
-    unsigned int cmd;
+    unsigned int cmd; /* => enum mmuext_cmd */
     union {
         /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR
          * CLEAR_PAGE, COPY_PAGE, [UN]MARK_SUPER */
@@ -422,9 +433,24 @@ typedef struct mmuext_op mmuext_op_t;
 DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #endif
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping(unsigned long va, u64 val,
+ * `                              enum uvm_flags flags)
+ * `
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, u64 val,
+ * `                                          enum uvm_flags flags,
+ * `                                          domid_t domid)
+ * `
+ * ` @va: The virtual address whose mapping we want to change
+ * ` @val: The new page table entry, must contain a machine address
+ * ` @flags: Control TLB flushes
+ */
 /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
 /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap.   */
 /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer.         */
+/* ` enum uvm_flags { */
 #define UVMF_NONE               (0UL<<0) /* No flushing at all.   */
 #define UVMF_TLB_FLUSH          (1UL<<0) /* Flush entire TLB(s).  */
 #define UVMF_INVLPG             (2UL<<0) /* Flush only one entry. */
@@ -432,6 +458,7 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 #define UVMF_MULTI              (0UL<<2) /* Flush subset of TLBs. */
 #define UVMF_LOCAL              (0UL<<2) /* Flush local TLB.      */
 #define UVMF_ALL                (1UL<<2) /* Flush all TLBs.       */
+/* ` } */
 
 /*
  * Commands to HYPERVISOR_console_io().
@@ -514,7 +541,10 @@ typedef struct mmu_update mmu_update_t;
 DEFINE_XEN_GUEST_HANDLE(mmu_update_t);
 
 /*
- * Send an array of these to HYPERVISOR_multicall().
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_multicall(multicall_entry_t call_list[],
+ * `                      unsigned int nr_calls);
+ *
  * NB. The fields are natural register size for this architecture.
  */
 struct multicall_entry {
@@ -654,7 +684,8 @@ typedef struct shared_info shared_info_t
 #endif
 
 /*
- * Start-of-day memory layout:
+ * `incontents 200 startofday Start-of-day memory layout
+ *
  *  1. The domain is started within contiguous virtual-memory region.
  *  2. The contiguous region ends on an aligned 4MB boundary.
  *  3. This the order of bootstrap elements in the initial virtual region:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 13:33:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 13:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TkxIY-00076n-0f; Tue, 18 Dec 2012 13:33:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkxIW-00076H-Gm
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 13:33:28 +0000
Received: from [85.158.139.211:10029] by server-1.bemta-5.messagelabs.com id
	4A/52-12813-7A070D05; Tue, 18 Dec 2012 13:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355837589!20893171!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22663 invoked from network); 18 Dec 2012 13:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 13:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkxIC-0006SM-Um
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 13:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkxIC-0005c0-K8
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 13:33:08 +0000
Message-Id: <E1TkxIC-0005c0-K8@xenbits.xen.org>
Date: Tue, 18 Dec 2012 13:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxenstore: filter watch events in
	libxenstore when we unwatch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Julien Grall <julien.grall@citrix.com>
# Date 1355767494 0
# Node ID 3664b0420dfa656b73e389aff39c2af5eb9d2126
# Parent  f50aab21f9f2ca3411df7881b2b92293b3af3771
libxenstore: filter watch events in libxenstore when we unwatch

XenStore puts in queued watch events via a thread and notifies the user.
Sometimes xs_unwatch is called before all related message is read. The use
case is non-threaded libevent, we have two event A and B:
    - Event A will destroy something and call xs_unwatch;
    - Event B is used to notify that a node has changed in XenStore.
As the event is called one by one, event A can be handled before event B.
So on next xs_watch_read the user could retrieve an unwatch token and
a segfault occured if the token store the pointer of the structure
(ie: "backend:0xcafe").

To avoid problem with previous application using libXenStore, this behaviour
will only be enabled if XS_UNWATCH_FILTER is given to xs_open.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r f50aab21f9f2 -r 3664b0420dfa tools/xenstore/xenstore.h
--- a/tools/xenstore/xenstore.h	Thu Dec 13 14:39:31 2012 +0000
+++ b/tools/xenstore/xenstore.h	Mon Dec 17 18:04:54 2012 +0000
@@ -27,6 +27,27 @@
 #define XS_OPEN_READONLY	1UL<<0
 #define XS_OPEN_SOCKETONLY      1UL<<1
 
+/*
+ * Setting XS_UNWATCH_FILTER arranges that after xs_unwatch, no
+ * related watch events will be delivered via xs_read_watch.  But
+ * this relies on the couple token, subpath is unique.
+ *
+ * XS_UNWATCH_FILTER clear          XS_UNWATCH_FILTER set
+ *
+ * Even after xs_unwatch, "stale"   After xs_unwatch returns, no
+ * instances of the watch event     watch events with the same
+ * may be delivered.                token and with the same subpath
+ *                                  will be delivered.
+ *
+ * A path and a subpath can be      The application must avoid
+ * register with the same token.    registering a path (/foo/) and
+ *                                  a subpath (/foo/bar) with the
+ *                                  same path until a successful
+ *                                  xs_unwatch for the first watch
+ *                                  has returned.
+ */
+#define XS_UNWATCH_FILTER     1UL<<2
+
 struct xs_handle;
 typedef uint32_t xs_transaction_t;
 
diff -r f50aab21f9f2 -r 3664b0420dfa tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Thu Dec 13 14:39:31 2012 +0000
+++ b/tools/xenstore/xs.c	Mon Dec 17 18:04:54 2012 +0000
@@ -67,6 +67,8 @@ struct xs_handle {
 
 	/* Clients can select() on this pipe to wait for a watch to fire. */
 	int watch_pipe[2];
+	/* Filtering watch event in unwatch function? */
+	bool unwatch_filter;
 
 	/*
          * A list of replies. Currently only one will ever be outstanding
@@ -125,6 +127,8 @@ struct xs_handle {
 	struct list_head watch_list;
 	/* Clients can select() on this pipe to wait for a watch to fire. */
 	int watch_pipe[2];
+	/* Filtering watch event in unwatch function? */
+	bool unwatch_filter;
 };
 
 #define mutex_lock(m)		((void)0)
@@ -247,6 +251,8 @@ static struct xs_handle *get_handle(cons
 	/* Watch pipe is allocated on demand in xs_fileno(). */
 	h->watch_pipe[0] = h->watch_pipe[1] = -1;
 
+	h->unwatch_filter = false;
+
 #ifdef USE_PTHREAD
 	pthread_mutex_init(&h->watch_mutex, NULL);
 	pthread_cond_init(&h->watch_condvar, NULL);
@@ -287,6 +293,9 @@ struct xs_handle *xs_open(unsigned long 
 	if (!xsh && !(flags & XS_OPEN_SOCKETONLY))
 		xsh = get_handle(xs_domain_dev());
 
+	if (xsh && (flags & XS_UNWATCH_FILTER))
+		xsh->unwatch_filter = true;
+
 	return xsh;
 }
 
@@ -753,6 +762,19 @@ bool xs_watch(struct xs_handle *h, const
 				ARRAY_SIZE(iov), NULL));
 }
 
+
+/* Clear the pipe token if there are no more pending watchs.
+ * We suppose the watch_mutex is already taken.
+ */
+static void xs_maybe_clear_watch_pipe(struct xs_handle *h)
+{
+	char c;
+
+	if (list_empty(&h->watch_list) && (h->watch_pipe[0] != -1))
+		while (read(h->watch_pipe[0], &c, 1) != 1)
+			continue;
+}
+
 /* Find out what node change was on (will block if nothing pending).
  * Returns array of two pointers: path and token, or NULL.
  * Call free() after use.
@@ -761,7 +783,7 @@ static char **read_watch_internal(struct
 				  int nonblocking)
 {
 	struct xs_stored_msg *msg;
-	char **ret, *strings, c = 0;
+	char **ret, *strings;
 	unsigned int num_strings, i;
 
 	mutex_lock(&h->watch_mutex);
@@ -798,11 +820,7 @@ static char **read_watch_internal(struct
 	msg = list_top(&h->watch_list, struct xs_stored_msg, list);
 	list_del(&msg->list);
 
-	/* Clear the pipe token if there are no more pending watches. */
-	if (list_empty(&h->watch_list) && (h->watch_pipe[0] != -1))
-		while (read(h->watch_pipe[0], &c, 1) != 1)
-			continue;
-
+	xs_maybe_clear_watch_pipe(h);
 	mutex_unlock(&h->watch_mutex);
 
 	assert(msg->hdr.type == XS_WATCH_EVENT);
@@ -855,14 +873,64 @@ char **xs_read_watch(struct xs_handle *h
 bool xs_unwatch(struct xs_handle *h, const char *path, const char *token)
 {
 	struct iovec iov[2];
+	struct xs_stored_msg *msg, *tmsg;
+	bool res;
+	char *s, *p;
+	unsigned int i;
+	char *l_token, *l_path;
 
 	iov[0].iov_base = (char *)path;
 	iov[0].iov_len = strlen(path) + 1;
 	iov[1].iov_base = (char *)token;
 	iov[1].iov_len = strlen(token) + 1;
 
-	return xs_bool(xs_talkv(h, XBT_NULL, XS_UNWATCH, iov,
-				ARRAY_SIZE(iov), NULL));
+	res = xs_bool(xs_talkv(h, XBT_NULL, XS_UNWATCH, iov,
+			       ARRAY_SIZE(iov), NULL));
+
+	if (!h->unwatch_filter) /* Don't filter the watch list */
+		return res;
+
+
+	/* Filter the watch list to remove potential message */
+	mutex_lock(&h->watch_mutex);
+
+	if (list_empty(&h->watch_list)) {
+		mutex_unlock(&h->watch_mutex);
+		return res;
+	}
+
+	list_for_each_entry_safe(msg, tmsg, &h->watch_list, list) {
+		assert(msg->hdr.type == XS_WATCH_EVENT);
+
+		s = msg->body;
+
+		l_token = NULL;
+		l_path = NULL;
+
+		for (p = s, i = 0; p < msg->body + msg->hdr.len; p++) {
+			if (*p == '\0')
+			{
+				if (i == XS_WATCH_TOKEN)
+					l_token = s;
+				else if (i == XS_WATCH_PATH)
+					l_path = s;
+				i++;
+				s = p + 1;
+			}
+		}
+
+		if (l_token && !strcmp(token, l_token) &&
+		    l_path && xs_path_is_subpath(path, l_path)) {
+			list_del(&msg->list);
+			free(msg);
+		}
+	}
+
+	xs_maybe_clear_watch_pipe(h);
+
+	mutex_unlock(&h->watch_mutex);
+
+	return res;
 }
 
 /* Start a transaction: changes by others will not be seen during this

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 13:33:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 13:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TkxIY-00076n-0f; Tue, 18 Dec 2012 13:33:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkxIW-00076H-Gm
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 13:33:28 +0000
Received: from [85.158.139.211:10029] by server-1.bemta-5.messagelabs.com id
	4A/52-12813-7A070D05; Tue, 18 Dec 2012 13:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-206.messagelabs.com!1355837589!20893171!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22663 invoked from network); 18 Dec 2012 13:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 13:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkxIC-0006SM-Um
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 13:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TkxIC-0005c0-K8
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 13:33:08 +0000
Message-Id: <E1TkxIC-0005c0-K8@xenbits.xen.org>
Date: Tue, 18 Dec 2012 13:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxenstore: filter watch events in
	libxenstore when we unwatch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Julien Grall <julien.grall@citrix.com>
# Date 1355767494 0
# Node ID 3664b0420dfa656b73e389aff39c2af5eb9d2126
# Parent  f50aab21f9f2ca3411df7881b2b92293b3af3771
libxenstore: filter watch events in libxenstore when we unwatch

XenStore puts in queued watch events via a thread and notifies the user.
Sometimes xs_unwatch is called before all related message is read. The use
case is non-threaded libevent, we have two event A and B:
    - Event A will destroy something and call xs_unwatch;
    - Event B is used to notify that a node has changed in XenStore.
As the event is called one by one, event A can be handled before event B.
So on next xs_watch_read the user could retrieve an unwatch token and
a segfault occured if the token store the pointer of the structure
(ie: "backend:0xcafe").

To avoid problem with previous application using libXenStore, this behaviour
will only be enabled if XS_UNWATCH_FILTER is given to xs_open.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r f50aab21f9f2 -r 3664b0420dfa tools/xenstore/xenstore.h
--- a/tools/xenstore/xenstore.h	Thu Dec 13 14:39:31 2012 +0000
+++ b/tools/xenstore/xenstore.h	Mon Dec 17 18:04:54 2012 +0000
@@ -27,6 +27,27 @@
 #define XS_OPEN_READONLY	1UL<<0
 #define XS_OPEN_SOCKETONLY      1UL<<1
 
+/*
+ * Setting XS_UNWATCH_FILTER arranges that after xs_unwatch, no
+ * related watch events will be delivered via xs_read_watch.  But
+ * this relies on the couple token, subpath is unique.
+ *
+ * XS_UNWATCH_FILTER clear          XS_UNWATCH_FILTER set
+ *
+ * Even after xs_unwatch, "stale"   After xs_unwatch returns, no
+ * instances of the watch event     watch events with the same
+ * may be delivered.                token and with the same subpath
+ *                                  will be delivered.
+ *
+ * A path and a subpath can be      The application must avoid
+ * register with the same token.    registering a path (/foo/) and
+ *                                  a subpath (/foo/bar) with the
+ *                                  same path until a successful
+ *                                  xs_unwatch for the first watch
+ *                                  has returned.
+ */
+#define XS_UNWATCH_FILTER     1UL<<2
+
 struct xs_handle;
 typedef uint32_t xs_transaction_t;
 
diff -r f50aab21f9f2 -r 3664b0420dfa tools/xenstore/xs.c
--- a/tools/xenstore/xs.c	Thu Dec 13 14:39:31 2012 +0000
+++ b/tools/xenstore/xs.c	Mon Dec 17 18:04:54 2012 +0000
@@ -67,6 +67,8 @@ struct xs_handle {
 
 	/* Clients can select() on this pipe to wait for a watch to fire. */
 	int watch_pipe[2];
+	/* Filtering watch event in unwatch function? */
+	bool unwatch_filter;
 
 	/*
          * A list of replies. Currently only one will ever be outstanding
@@ -125,6 +127,8 @@ struct xs_handle {
 	struct list_head watch_list;
 	/* Clients can select() on this pipe to wait for a watch to fire. */
 	int watch_pipe[2];
+	/* Filtering watch event in unwatch function? */
+	bool unwatch_filter;
 };
 
 #define mutex_lock(m)		((void)0)
@@ -247,6 +251,8 @@ static struct xs_handle *get_handle(cons
 	/* Watch pipe is allocated on demand in xs_fileno(). */
 	h->watch_pipe[0] = h->watch_pipe[1] = -1;
 
+	h->unwatch_filter = false;
+
 #ifdef USE_PTHREAD
 	pthread_mutex_init(&h->watch_mutex, NULL);
 	pthread_cond_init(&h->watch_condvar, NULL);
@@ -287,6 +293,9 @@ struct xs_handle *xs_open(unsigned long 
 	if (!xsh && !(flags & XS_OPEN_SOCKETONLY))
 		xsh = get_handle(xs_domain_dev());
 
+	if (xsh && (flags & XS_UNWATCH_FILTER))
+		xsh->unwatch_filter = true;
+
 	return xsh;
 }
 
@@ -753,6 +762,19 @@ bool xs_watch(struct xs_handle *h, const
 				ARRAY_SIZE(iov), NULL));
 }
 
+
+/* Clear the pipe token if there are no more pending watchs.
+ * We suppose the watch_mutex is already taken.
+ */
+static void xs_maybe_clear_watch_pipe(struct xs_handle *h)
+{
+	char c;
+
+	if (list_empty(&h->watch_list) && (h->watch_pipe[0] != -1))
+		while (read(h->watch_pipe[0], &c, 1) != 1)
+			continue;
+}
+
 /* Find out what node change was on (will block if nothing pending).
  * Returns array of two pointers: path and token, or NULL.
  * Call free() after use.
@@ -761,7 +783,7 @@ static char **read_watch_internal(struct
 				  int nonblocking)
 {
 	struct xs_stored_msg *msg;
-	char **ret, *strings, c = 0;
+	char **ret, *strings;
 	unsigned int num_strings, i;
 
 	mutex_lock(&h->watch_mutex);
@@ -798,11 +820,7 @@ static char **read_watch_internal(struct
 	msg = list_top(&h->watch_list, struct xs_stored_msg, list);
 	list_del(&msg->list);
 
-	/* Clear the pipe token if there are no more pending watches. */
-	if (list_empty(&h->watch_list) && (h->watch_pipe[0] != -1))
-		while (read(h->watch_pipe[0], &c, 1) != 1)
-			continue;
-
+	xs_maybe_clear_watch_pipe(h);
 	mutex_unlock(&h->watch_mutex);
 
 	assert(msg->hdr.type == XS_WATCH_EVENT);
@@ -855,14 +873,64 @@ char **xs_read_watch(struct xs_handle *h
 bool xs_unwatch(struct xs_handle *h, const char *path, const char *token)
 {
 	struct iovec iov[2];
+	struct xs_stored_msg *msg, *tmsg;
+	bool res;
+	char *s, *p;
+	unsigned int i;
+	char *l_token, *l_path;
 
 	iov[0].iov_base = (char *)path;
 	iov[0].iov_len = strlen(path) + 1;
 	iov[1].iov_base = (char *)token;
 	iov[1].iov_len = strlen(token) + 1;
 
-	return xs_bool(xs_talkv(h, XBT_NULL, XS_UNWATCH, iov,
-				ARRAY_SIZE(iov), NULL));
+	res = xs_bool(xs_talkv(h, XBT_NULL, XS_UNWATCH, iov,
+			       ARRAY_SIZE(iov), NULL));
+
+	if (!h->unwatch_filter) /* Don't filter the watch list */
+		return res;
+
+
+	/* Filter the watch list to remove potential message */
+	mutex_lock(&h->watch_mutex);
+
+	if (list_empty(&h->watch_list)) {
+		mutex_unlock(&h->watch_mutex);
+		return res;
+	}
+
+	list_for_each_entry_safe(msg, tmsg, &h->watch_list, list) {
+		assert(msg->hdr.type == XS_WATCH_EVENT);
+
+		s = msg->body;
+
+		l_token = NULL;
+		l_path = NULL;
+
+		for (p = s, i = 0; p < msg->body + msg->hdr.len; p++) {
+			if (*p == '\0')
+			{
+				if (i == XS_WATCH_TOKEN)
+					l_token = s;
+				else if (i == XS_WATCH_PATH)
+					l_path = s;
+				i++;
+				s = p + 1;
+			}
+		}
+
+		if (l_token && !strcmp(token, l_token) &&
+		    l_path && xs_path_is_subpath(path, l_path)) {
+			list_del(&msg->list);
+			free(msg);
+		}
+	}
+
+	xs_maybe_clear_watch_pipe(h);
+
+	mutex_unlock(&h->watch_mutex);
+
+	return res;
 }
 
 /* Start a transaction: changes by others will not be seen during this

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 21:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 21:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tl4c9-0003xU-Ea; Tue, 18 Dec 2012 21:22:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c7-0003x7-P9
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:12 +0000
Received: from [85.158.139.83:56459] by server-9.bemta-5.messagelabs.com id
	0D/B7-10690-38ED0D05; Tue, 18 Dec 2012 21:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1355865729!27720646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2242 invoked from network); 18 Dec 2012 21:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 21:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c4-0003lY-Vr
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c4-0000mN-Q8
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:08 +0000
Message-Id: <E1Tl4c4-0000mN-Q8@xenbits.xen.org>
Date: Tue, 18 Dec 2012 21:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched_credit: define and use
	curr_on_cpu(cpu)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1355836647 0
# Node ID d5c0389bf26c89969ebce71927f34f6b923af949
# Parent  e2a3d22f2c7daa9008609d6aeda2ca378501cf31
xen: sched_credit: define and use curr_on_cpu(cpu)

To fetch `per_cpu(schedule_data,cpu).curr' in a more readable
way. It's in sched-if.h as that is where `struct schedule_data'
is declared.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r e2a3d22f2c7d -r d5c0389bf26c xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Dec 18 14:08:55 2012 +0100
+++ b/xen/common/sched_credit.c	Tue Dec 18 13:17:27 2012 +0000
@@ -228,7 +228,7 @@ static void burn_credits(struct csched_v
     unsigned int credits;
 
     /* Assert svc is current */
-    ASSERT(svc==CSCHED_VCPU(per_cpu(schedule_data, svc->vcpu->processor).curr));
+    ASSERT( svc == CSCHED_VCPU(curr_on_cpu(svc->vcpu->processor)) );
 
     if ( (delta = now - svc->start_time) <= 0 )
         return;
@@ -246,8 +246,7 @@ DEFINE_PER_CPU(unsigned int, last_tickle
 static inline void
 __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 {
-    struct csched_vcpu * const cur =
-        CSCHED_VCPU(per_cpu(schedule_data, cpu).curr);
+    struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
     cpumask_t mask;
 
@@ -371,7 +370,7 @@ csched_alloc_pdata(const struct schedule
         per_cpu(schedule_data, cpu).sched_priv = spc;
 
     /* Start off idling... */
-    BUG_ON(!is_idle_vcpu(per_cpu(schedule_data, cpu).curr));
+    BUG_ON(!is_idle_vcpu(curr_on_cpu(cpu)));
     cpumask_set_cpu(cpu, prv->idlers);
 
     spin_unlock_irqrestore(&prv->lock, flags);
@@ -709,7 +708,7 @@ csched_vcpu_sleep(const struct scheduler
 
     BUG_ON( is_idle_vcpu(vc) );
 
-    if ( per_cpu(schedule_data, vc->processor).curr == vc )
+    if ( curr_on_cpu(vc->processor) == vc )
         cpu_raise_softirq(vc->processor, SCHEDULE_SOFTIRQ);
     else if ( __vcpu_on_runq(svc) )
         __runq_remove(svc);
@@ -723,7 +722,7 @@ csched_vcpu_wake(const struct scheduler 
 
     BUG_ON( is_idle_vcpu(vc) );
 
-    if ( unlikely(per_cpu(schedule_data, cpu).curr == vc) )
+    if ( unlikely(curr_on_cpu(cpu) == vc) )
     {
         SCHED_STAT_CRANK(vcpu_wake_running);
         return;
@@ -1192,7 +1191,7 @@ static struct csched_vcpu *
 csched_runq_steal(int peer_cpu, int cpu, int pri)
 {
     const struct csched_pcpu * const peer_pcpu = CSCHED_PCPU(peer_cpu);
-    const struct vcpu * const peer_vcpu = per_cpu(schedule_data, peer_cpu).curr;
+    const struct vcpu * const peer_vcpu = curr_on_cpu(peer_cpu);
     struct csched_vcpu *speer;
     struct list_head *iter;
     struct vcpu *vc;
@@ -1480,7 +1479,7 @@ csched_dump_pcpu(const struct scheduler 
     printk("core=%s\n", cpustr);
 
     /* current VCPU */
-    svc = CSCHED_VCPU(per_cpu(schedule_data, cpu).curr);
+    svc = CSCHED_VCPU(curr_on_cpu(cpu));
     if ( svc )
     {
         printk("\trun: ");
diff -r e2a3d22f2c7d -r d5c0389bf26c xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h	Tue Dec 18 14:08:55 2012 +0100
+++ b/xen/include/xen/sched-if.h	Tue Dec 18 13:17:27 2012 +0000
@@ -41,6 +41,8 @@ struct schedule_data {
     atomic_t            urgent_count;   /* how many urgent vcpus           */
 };
 
+#define curr_on_cpu(c)    (per_cpu(schedule_data, c).curr)
+
 DECLARE_PER_CPU(struct schedule_data, schedule_data);
 DECLARE_PER_CPU(struct scheduler *, scheduler);
 DECLARE_PER_CPU(struct cpupool *, cpupool);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 21:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 21:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tl4c9-0003xU-Ea; Tue, 18 Dec 2012 21:22:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c7-0003x7-P9
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:12 +0000
Received: from [85.158.139.83:56459] by server-9.bemta-5.messagelabs.com id
	0D/B7-10690-38ED0D05; Tue, 18 Dec 2012 21:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1355865729!27720646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2242 invoked from network); 18 Dec 2012 21:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 21:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c4-0003lY-Vr
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c4-0000mN-Q8
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:08 +0000
Message-Id: <E1Tl4c4-0000mN-Q8@xenbits.xen.org>
Date: Tue, 18 Dec 2012 21:22:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched_credit: define and use
	curr_on_cpu(cpu)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1355836647 0
# Node ID d5c0389bf26c89969ebce71927f34f6b923af949
# Parent  e2a3d22f2c7daa9008609d6aeda2ca378501cf31
xen: sched_credit: define and use curr_on_cpu(cpu)

To fetch `per_cpu(schedule_data,cpu).curr' in a more readable
way. It's in sched-if.h as that is where `struct schedule_data'
is declared.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r e2a3d22f2c7d -r d5c0389bf26c xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Dec 18 14:08:55 2012 +0100
+++ b/xen/common/sched_credit.c	Tue Dec 18 13:17:27 2012 +0000
@@ -228,7 +228,7 @@ static void burn_credits(struct csched_v
     unsigned int credits;
 
     /* Assert svc is current */
-    ASSERT(svc==CSCHED_VCPU(per_cpu(schedule_data, svc->vcpu->processor).curr));
+    ASSERT( svc == CSCHED_VCPU(curr_on_cpu(svc->vcpu->processor)) );
 
     if ( (delta = now - svc->start_time) <= 0 )
         return;
@@ -246,8 +246,7 @@ DEFINE_PER_CPU(unsigned int, last_tickle
 static inline void
 __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 {
-    struct csched_vcpu * const cur =
-        CSCHED_VCPU(per_cpu(schedule_data, cpu).curr);
+    struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
     cpumask_t mask;
 
@@ -371,7 +370,7 @@ csched_alloc_pdata(const struct schedule
         per_cpu(schedule_data, cpu).sched_priv = spc;
 
     /* Start off idling... */
-    BUG_ON(!is_idle_vcpu(per_cpu(schedule_data, cpu).curr));
+    BUG_ON(!is_idle_vcpu(curr_on_cpu(cpu)));
     cpumask_set_cpu(cpu, prv->idlers);
 
     spin_unlock_irqrestore(&prv->lock, flags);
@@ -709,7 +708,7 @@ csched_vcpu_sleep(const struct scheduler
 
     BUG_ON( is_idle_vcpu(vc) );
 
-    if ( per_cpu(schedule_data, vc->processor).curr == vc )
+    if ( curr_on_cpu(vc->processor) == vc )
         cpu_raise_softirq(vc->processor, SCHEDULE_SOFTIRQ);
     else if ( __vcpu_on_runq(svc) )
         __runq_remove(svc);
@@ -723,7 +722,7 @@ csched_vcpu_wake(const struct scheduler 
 
     BUG_ON( is_idle_vcpu(vc) );
 
-    if ( unlikely(per_cpu(schedule_data, cpu).curr == vc) )
+    if ( unlikely(curr_on_cpu(cpu) == vc) )
     {
         SCHED_STAT_CRANK(vcpu_wake_running);
         return;
@@ -1192,7 +1191,7 @@ static struct csched_vcpu *
 csched_runq_steal(int peer_cpu, int cpu, int pri)
 {
     const struct csched_pcpu * const peer_pcpu = CSCHED_PCPU(peer_cpu);
-    const struct vcpu * const peer_vcpu = per_cpu(schedule_data, peer_cpu).curr;
+    const struct vcpu * const peer_vcpu = curr_on_cpu(peer_cpu);
     struct csched_vcpu *speer;
     struct list_head *iter;
     struct vcpu *vc;
@@ -1480,7 +1479,7 @@ csched_dump_pcpu(const struct scheduler 
     printk("core=%s\n", cpustr);
 
     /* current VCPU */
-    svc = CSCHED_VCPU(per_cpu(schedule_data, cpu).curr);
+    svc = CSCHED_VCPU(curr_on_cpu(cpu));
     if ( svc )
     {
         printk("\trun: ");
diff -r e2a3d22f2c7d -r d5c0389bf26c xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h	Tue Dec 18 14:08:55 2012 +0100
+++ b/xen/include/xen/sched-if.h	Tue Dec 18 13:17:27 2012 +0000
@@ -41,6 +41,8 @@ struct schedule_data {
     atomic_t            urgent_count;   /* how many urgent vcpus           */
 };
 
+#define curr_on_cpu(c)    (per_cpu(schedule_data, c).curr)
+
 DECLARE_PER_CPU(struct schedule_data, schedule_data);
 DECLARE_PER_CPU(struct scheduler *, scheduler);
 DECLARE_PER_CPU(struct cpupool *, cpupool);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 21:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 21:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tl4c9-0003xZ-HN; Tue, 18 Dec 2012 21:22:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c7-0003xD-U7
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:12 +0000
Received: from [85.158.139.211:29948] by server-1.bemta-5.messagelabs.com id
	C5/29-12813-38ED0D05; Tue, 18 Dec 2012 21:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355865728!19598714!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16688 invoked from network); 18 Dec 2012 21:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 21:22:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c4-0003lS-1a
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c3-0000lr-O6
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:07 +0000
Message-Id: <E1Tl4c3-0000lr-O6@xenbits.xen.org>
Date: Tue, 18 Dec 2012 21:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] add maintainers entry for
	vendor-independent IOMMU code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355820537 -3600
# Node ID e6036f0d0236efd3e4090e4ff9ccebaabb916f2b
# Parent  3664b0420dfa656b73e389aff39c2af5eb9d2126
add maintainers entry for vendor-independent IOMMU code

As agreed to last week.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 3664b0420dfa -r e6036f0d0236 MAINTAINERS
--- a/MAINTAINERS	Mon Dec 17 18:04:54 2012 +0000
+++ b/MAINTAINERS	Tue Dec 18 09:48:57 2012 +0100
@@ -184,6 +184,15 @@ F:	xen/arch/x86/hvm/vmx/
 F:	xen/arch/x86/mm/hap/p2m-ept.c
 F:	xen/include/asm-x86/hvm/vmx/
 
+IOMMU VENDOR INDEPENDENT CODE
+M:	Xiantao Zhang <xiantao.zhang@intel.com>
+M:	Jan Beulich <jbeulich@suse.com>
+S:	Supported
+F:	xen/drivers/passthrough/
+X:	xen/drivers/passthrough/amd/
+X:	xen/drivers/passthrough/vtd/
+F:	xen/include/xen/iommu.h
+
 LINUX (PV_OPS)
 M:	Jeremy Fitzhardinge <jeremy@goop.org>
 S:	Supported

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 21:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 21:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tl4c9-0003xZ-HN; Tue, 18 Dec 2012 21:22:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c7-0003xD-U7
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:12 +0000
Received: from [85.158.139.211:29948] by server-1.bemta-5.messagelabs.com id
	C5/29-12813-38ED0D05; Tue, 18 Dec 2012 21:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-206.messagelabs.com!1355865728!19598714!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16688 invoked from network); 18 Dec 2012 21:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 21:22:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c4-0003lS-1a
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c3-0000lr-O6
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:07 +0000
Message-Id: <E1Tl4c3-0000lr-O6@xenbits.xen.org>
Date: Tue, 18 Dec 2012 21:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] add maintainers entry for
	vendor-independent IOMMU code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355820537 -3600
# Node ID e6036f0d0236efd3e4090e4ff9ccebaabb916f2b
# Parent  3664b0420dfa656b73e389aff39c2af5eb9d2126
add maintainers entry for vendor-independent IOMMU code

As agreed to last week.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 3664b0420dfa -r e6036f0d0236 MAINTAINERS
--- a/MAINTAINERS	Mon Dec 17 18:04:54 2012 +0000
+++ b/MAINTAINERS	Tue Dec 18 09:48:57 2012 +0100
@@ -184,6 +184,15 @@ F:	xen/arch/x86/hvm/vmx/
 F:	xen/arch/x86/mm/hap/p2m-ept.c
 F:	xen/include/asm-x86/hvm/vmx/
 
+IOMMU VENDOR INDEPENDENT CODE
+M:	Xiantao Zhang <xiantao.zhang@intel.com>
+M:	Jan Beulich <jbeulich@suse.com>
+S:	Supported
+F:	xen/drivers/passthrough/
+X:	xen/drivers/passthrough/amd/
+X:	xen/drivers/passthrough/vtd/
+F:	xen/include/xen/iommu.h
+
 LINUX (PV_OPS)
 M:	Jeremy Fitzhardinge <jeremy@goop.org>
 S:	Supported

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 21:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 21:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tl4c8-0003xN-Bo; Tue, 18 Dec 2012 21:22:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c7-0003x6-10
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:11 +0000
Received: from [85.158.137.99:31890] by server-2.bemta-3.messagelabs.com id
	07/59-11239-28ED0D05; Tue, 18 Dec 2012 21:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1355865728!14495500!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19881 invoked from network); 18 Dec 2012 21:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 21:22:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c4-0003lV-BB
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c4-0000m6-9o
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:08 +0000
Message-Id: <E1Tl4c4-0000m6-9o@xenbits.xen.org>
Date: Tue, 18 Dec 2012 21:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] usbif: drop bogus definition
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355836135 -3600
# Node ID e2a3d22f2c7daa9008609d6aeda2ca378501cf31
# Parent  e6036f0d0236efd3e4090e4ff9ccebaabb916f2b
usbif: drop bogus definition

Just like recently done for vSCSI, remove a backend implementation
detail from the interface header.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r e6036f0d0236 -r e2a3d22f2c7d xen/include/public/io/usbif.h
--- a/xen/include/public/io/usbif.h	Tue Dec 18 09:48:57 2012 +0100
+++ b/xen/include/public/io/usbif.h	Tue Dec 18 14:08:55 2012 +0100
@@ -71,7 +71,6 @@ enum usb_spec_version {
 #define usbif_pipesubmit(pipe) (!usbif_pipeunlink(pipe))
 #define usbif_setunlink_pipe(pipe) ((pipe)|(0x20))
 
-#define USBIF_BACK_MAX_PENDING_REQS (128)
 #define USBIF_MAX_SEGMENTS_PER_REQUEST (16)
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Dec 18 21:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 18 Dec 2012 21:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tl4c8-0003xN-Bo; Tue, 18 Dec 2012 21:22:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c7-0003x6-10
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:11 +0000
Received: from [85.158.137.99:31890] by server-2.bemta-3.messagelabs.com id
	07/59-11239-28ED0D05; Tue, 18 Dec 2012 21:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-217.messagelabs.com!1355865728!14495500!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19881 invoked from network); 18 Dec 2012 21:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Dec 2012 21:22:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c4-0003lV-BB
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tl4c4-0000m6-9o
	for xen-changelog@lists.xensource.com; Tue, 18 Dec 2012 21:22:08 +0000
Message-Id: <E1Tl4c4-0000m6-9o@xenbits.xen.org>
Date: Tue, 18 Dec 2012 21:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] usbif: drop bogus definition
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355836135 -3600
# Node ID e2a3d22f2c7daa9008609d6aeda2ca378501cf31
# Parent  e6036f0d0236efd3e4090e4ff9ccebaabb916f2b
usbif: drop bogus definition

Just like recently done for vSCSI, remove a backend implementation
detail from the interface header.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r e6036f0d0236 -r e2a3d22f2c7d xen/include/public/io/usbif.h
--- a/xen/include/public/io/usbif.h	Tue Dec 18 09:48:57 2012 +0100
+++ b/xen/include/public/io/usbif.h	Tue Dec 18 14:08:55 2012 +0100
@@ -71,7 +71,6 @@ enum usb_spec_version {
 #define usbif_pipesubmit(pipe) (!usbif_pipeunlink(pipe))
 #define usbif_setunlink_pipe(pipe) ((pipe)|(0x20))
 
-#define USBIF_BACK_MAX_PENDING_REQS (128)
 #define USBIF_MAX_SEGMENTS_PER_REQUEST (16)
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 13:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 13:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlJQX-0001PZ-Av; Wed, 19 Dec 2012 13:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQW-0001PJ-9z
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:12 +0000
Received: from [85.158.139.211:56090] by server-11.bemta-5.messagelabs.com id
	6B/AA-31624-FECB1D05; Wed, 19 Dec 2012 13:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-206.messagelabs.com!1355922669!18605684!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17677 invoked from network); 19 Dec 2012 13:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 13:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQT-0004jm-DP
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQS-0007Vz-Rm
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:08 +0000
Message-Id: <E1TlJQS-0007Vz-Rm@xenbits.xen.org>
Date: Wed, 19 Dec 2012 13:11:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Added tag RELEASE-4.1.4 for
	changeset 12c4c4c0a715
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355834194 -3600
# Node ID 0fa518f50193b509cb2295f2c14065177018d4c0
# Parent  12c4c4c0a715c8daf08222f0b4cebcf2ec3bd3a0
Added tag RELEASE-4.1.4 for changeset 12c4c4c0a715
---


diff -r 12c4c4c0a715 -r 0fa518f50193 .hgtags
--- a/.hgtags	Tue Dec 18 13:35:59 2012 +0100
+++ b/.hgtags	Tue Dec 18 13:36:34 2012 +0100
@@ -68,3 +68,4 @@ 5cdcfed7b5b129843e1602b5d43c7651de337092
 ce7195d2b80e4df9857e434fa29689fd678a2341 RELEASE-4.1.3
 500194a883bdcf77b2a0fc87de291b0c27435207 4.1.4-rc1
 0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d 4.1.4-rc2
+12c4c4c0a715c8daf08222f0b4cebcf2ec3bd3a0 RELEASE-4.1.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 13:11:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 13:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlJQX-0001PZ-Av; Wed, 19 Dec 2012 13:11:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQW-0001PJ-9z
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:12 +0000
Received: from [85.158.139.211:56090] by server-11.bemta-5.messagelabs.com id
	6B/AA-31624-FECB1D05; Wed, 19 Dec 2012 13:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-206.messagelabs.com!1355922669!18605684!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17677 invoked from network); 19 Dec 2012 13:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 13:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQT-0004jm-DP
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQS-0007Vz-Rm
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:08 +0000
Message-Id: <E1TlJQS-0007Vz-Rm@xenbits.xen.org>
Date: Wed, 19 Dec 2012 13:11:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Added tag RELEASE-4.1.4 for
	changeset 12c4c4c0a715
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355834194 -3600
# Node ID 0fa518f50193b509cb2295f2c14065177018d4c0
# Parent  12c4c4c0a715c8daf08222f0b4cebcf2ec3bd3a0
Added tag RELEASE-4.1.4 for changeset 12c4c4c0a715
---


diff -r 12c4c4c0a715 -r 0fa518f50193 .hgtags
--- a/.hgtags	Tue Dec 18 13:35:59 2012 +0100
+++ b/.hgtags	Tue Dec 18 13:36:34 2012 +0100
@@ -68,3 +68,4 @@ 5cdcfed7b5b129843e1602b5d43c7651de337092
 ce7195d2b80e4df9857e434fa29689fd678a2341 RELEASE-4.1.3
 500194a883bdcf77b2a0fc87de291b0c27435207 4.1.4-rc1
 0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d 4.1.4-rc2
+12c4c4c0a715c8daf08222f0b4cebcf2ec3bd3a0 RELEASE-4.1.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 13:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 13:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlJQY-0001Pj-DP; Wed, 19 Dec 2012 13:11:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQX-0001PN-0b
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:13 +0000
Received: from [85.158.138.51:54462] by server-4.bemta-3.messagelabs.com id
	05/EC-31835-0FCB1D05; Wed, 19 Dec 2012 13:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1355922670!29529564!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2137 invoked from network); 19 Dec 2012 13:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 13:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQT-0004jp-Oc
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQT-0007WK-Cq
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:09 +0000
Message-Id: <E1TlJQT-0007WK-Cq@xenbits.xen.org>
Date: Wed, 19 Dec 2012 13:11:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Added signature for changeset
	12c4c4c0a715
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355835195 0
# Node ID b13c5ee3c10970fe691aa585e5c8bbd44a3e4cc0
# Parent  0fa518f50193b509cb2295f2c14065177018d4c0
Added signature for changeset 12c4c4c0a715
---


diff -r 0fa518f50193 -r b13c5ee3c109 .hgsigs
--- a/.hgsigs	Tue Dec 18 13:36:34 2012 +0100
+++ b/.hgsigs	Tue Dec 18 12:53:15 2012 +0000
@@ -21,3 +21,4 @@ 5cdcfed7b5b129843e1602b5d43c7651de337092
 ce7195d2b80e4df9857e434fa29689fd678a2341 0 iQEcBAABAgAGBQJQI9u1AAoJEIP+FMlX6CvZU88IAKKz8mw53zvvdEFaV39669d+SFATRyatb9OF6L1O6RQczsdxI7koyGyLL64V6NvpMB3RLFrh3dD+1ZIy4W13AWuDSnby45oIijHpcQqZ+Zt1ijxDj/wuViSC+4S+sdkgCDfmMyGb5a8XwnoKIWb6EOJVT8FFjuVJ3UsTXfujCyDdDeKoFH7ZGfq+r7k0DoANqkNi2AIhxUrw/h/9ydNffd4Gh/BUsHHcx5DEfXUplbT3pPUvq6o38rsqM80xZNR7lgL7chxFHjs94OOqX71gEZw0sR1hi+gbL8eJTIsep4kM4Z0aOYJJCqUFYv5C31Nn54GWECKJSNSWtBo8hIqLpI0=
 500194a883bdcf77b2a0fc87de291b0c27435207 0 iQEcBAABAgAGBQJQpLjeAAoJEIP+FMlX6CvZaUUIAKXHEVEfhnGEUAnm0gA0Mao1W8yo7BrsIhgZ/TyTYmhaOBzF3ez9+oUDQ6XWAJ9zbyq4ZWBsDbKFJCSwF8nvPL2OLG2DGyqoi7UckPZshQi71h91cT8v/snsp4A2161NEh9Tyti7YrygCzZldgjYy0vVAyFGmML+swvcBI9Zufb2Vk+Lm4R6EgmmTSO+EHEPg0QDtjLcUICSPcQgzRBe2QB/xzn/h8yWJ8FoOCyNDu3zQU1RKoP3lVMT0vK6Pr/l6NC7sy2Npfhe44ysvKHCpzQD3kZMhvzLujVnm1xJs0iKifUgHLsAO7RP55i7AfUgXqEMHaMxwlRSNWBmOsLSeho=
 0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d 0 iQEcBAABAgAGBQJQyFD/AAoJEIP+FMlX6CvZdAAH/39wnElEv6/KMSdVNXvX2Fz5Q4jzw23muZsXF7e+vAJ2LOrg2vzzAyq4Clx6h2Rw0cvSHtZC8f+RbFA4cnMcm9yxAu9jO1+GViRMLi2yNaNIMiQ6+w4DCBtscRPa+t5fqVnUcSkC3xm/V1Us4whICL40AFtpi3u78d4DhbnbkH4NAbRutZD4RrI8frrTyu8X6aLVzVK+Am1yb69Y0BDQldI9L3a89o9zH3yASyo98Suvo9p+tipYv2YJMaTZaVFbPhcakg3ZnB5OVOdel1K16Rf3TB1qE+Yj654U0fFx4Tvx28q94n+HzQQiIDSanv6v1GL/lcQtcZwQtgrx4e+3jqc=
+12c4c4c0a715c8daf08222f0b4cebcf2ec3bd3a0 0 iQEcBAABAgAGBQJQ0Gc4AAoJEIP+FMlX6CvZmJcH/1QBx8vOWMUt05lO9qFtU7AT/+g0Zxgr8dNL1cI0ntn+EXoRjta4mBuKuLq35zhwzBpKOguOBVwrlwt6YTx/w/f4RtBkwqvsgZT7BJQF/iXnD8XisJIdMB9g97W3b5qLag873MzEvnE1uJJ8y82qpo4IkIEs0SkNhKFI1dPDKyn+uQFOHOQzG5lgV3IKON+R9aCGnhmMfJukufETMtaOG7aBs7a6iftDmywGnAq6zEVNDsV4KTIC21vME6mewg8WQlGf83zTBV4pFUIzyOekSPqYddNUuRu+vAT3VAInAbmb2cHZ3i/xb0tGstbrGnjNkTTHCsy9JwxtTfiqJRhBPT8=

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 13:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 13:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlJQY-0001Pj-DP; Wed, 19 Dec 2012 13:11:14 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQX-0001PN-0b
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:13 +0000
Received: from [85.158.138.51:54462] by server-4.bemta-3.messagelabs.com id
	05/EC-31835-0FCB1D05; Wed, 19 Dec 2012 13:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1355922670!29529564!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2137 invoked from network); 19 Dec 2012 13:11:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 13:11:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQT-0004jp-Oc
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQT-0007WK-Cq
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:09 +0000
Message-Id: <E1TlJQT-0007WK-Cq@xenbits.xen.org>
Date: Wed, 19 Dec 2012 13:11:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Added signature for changeset
	12c4c4c0a715
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Jackson <Ian.Jackson@eu.citrix.com>
# Date 1355835195 0
# Node ID b13c5ee3c10970fe691aa585e5c8bbd44a3e4cc0
# Parent  0fa518f50193b509cb2295f2c14065177018d4c0
Added signature for changeset 12c4c4c0a715
---


diff -r 0fa518f50193 -r b13c5ee3c109 .hgsigs
--- a/.hgsigs	Tue Dec 18 13:36:34 2012 +0100
+++ b/.hgsigs	Tue Dec 18 12:53:15 2012 +0000
@@ -21,3 +21,4 @@ 5cdcfed7b5b129843e1602b5d43c7651de337092
 ce7195d2b80e4df9857e434fa29689fd678a2341 0 iQEcBAABAgAGBQJQI9u1AAoJEIP+FMlX6CvZU88IAKKz8mw53zvvdEFaV39669d+SFATRyatb9OF6L1O6RQczsdxI7koyGyLL64V6NvpMB3RLFrh3dD+1ZIy4W13AWuDSnby45oIijHpcQqZ+Zt1ijxDj/wuViSC+4S+sdkgCDfmMyGb5a8XwnoKIWb6EOJVT8FFjuVJ3UsTXfujCyDdDeKoFH7ZGfq+r7k0DoANqkNi2AIhxUrw/h/9ydNffd4Gh/BUsHHcx5DEfXUplbT3pPUvq6o38rsqM80xZNR7lgL7chxFHjs94OOqX71gEZw0sR1hi+gbL8eJTIsep4kM4Z0aOYJJCqUFYv5C31Nn54GWECKJSNSWtBo8hIqLpI0=
 500194a883bdcf77b2a0fc87de291b0c27435207 0 iQEcBAABAgAGBQJQpLjeAAoJEIP+FMlX6CvZaUUIAKXHEVEfhnGEUAnm0gA0Mao1W8yo7BrsIhgZ/TyTYmhaOBzF3ez9+oUDQ6XWAJ9zbyq4ZWBsDbKFJCSwF8nvPL2OLG2DGyqoi7UckPZshQi71h91cT8v/snsp4A2161NEh9Tyti7YrygCzZldgjYy0vVAyFGmML+swvcBI9Zufb2Vk+Lm4R6EgmmTSO+EHEPg0QDtjLcUICSPcQgzRBe2QB/xzn/h8yWJ8FoOCyNDu3zQU1RKoP3lVMT0vK6Pr/l6NC7sy2Npfhe44ysvKHCpzQD3kZMhvzLujVnm1xJs0iKifUgHLsAO7RP55i7AfUgXqEMHaMxwlRSNWBmOsLSeho=
 0125069bc1b29b617f1e4f4f2c2fcb8547ecd45d 0 iQEcBAABAgAGBQJQyFD/AAoJEIP+FMlX6CvZdAAH/39wnElEv6/KMSdVNXvX2Fz5Q4jzw23muZsXF7e+vAJ2LOrg2vzzAyq4Clx6h2Rw0cvSHtZC8f+RbFA4cnMcm9yxAu9jO1+GViRMLi2yNaNIMiQ6+w4DCBtscRPa+t5fqVnUcSkC3xm/V1Us4whICL40AFtpi3u78d4DhbnbkH4NAbRutZD4RrI8frrTyu8X6aLVzVK+Am1yb69Y0BDQldI9L3a89o9zH3yASyo98Suvo9p+tipYv2YJMaTZaVFbPhcakg3ZnB5OVOdel1K16Rf3TB1qE+Yj654U0fFx4Tvx28q94n+HzQQiIDSanv6v1GL/lcQtcZwQtgrx4e+3jqc=
+12c4c4c0a715c8daf08222f0b4cebcf2ec3bd3a0 0 iQEcBAABAgAGBQJQ0Gc4AAoJEIP+FMlX6CvZmJcH/1QBx8vOWMUt05lO9qFtU7AT/+g0Zxgr8dNL1cI0ntn+EXoRjta4mBuKuLq35zhwzBpKOguOBVwrlwt6YTx/w/f4RtBkwqvsgZT7BJQF/iXnD8XisJIdMB9g97W3b5qLag873MzEvnE1uJJ8y82qpo4IkIEs0SkNhKFI1dPDKyn+uQFOHOQzG5lgV3IKON+R9aCGnhmMfJukufETMtaOG7aBs7a6iftDmywGnAq6zEVNDsV4KTIC21vME6mewg8WQlGf83zTBV4pFUIzyOekSPqYddNUuRu+vAT3VAInAbmb2cHZ3i/xb0tGstbrGnjNkTTHCsy9JwxtTfiqJRhBPT8=

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 13:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 13:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlJQd-0001Qv-G5; Wed, 19 Dec 2012 13:11:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQb-0001QJ-P8
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:17 +0000
Received: from [85.158.139.83:47108] by server-13.bemta-5.messagelabs.com id
	A0/82-10716-5FCB1D05; Wed, 19 Dec 2012 13:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1355922669!23290949!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19834 invoked from network); 19 Dec 2012 13:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 13:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQT-0004jj-0G
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQS-0007Vl-7s
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:08 +0000
Message-Id: <E1TlJQS-0007Vl-7s@xenbits.xen.org>
Date: Wed, 19 Dec 2012 13:11:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] update Xen version to 4.1.4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355834159 -3600
# Node ID 12c4c4c0a715c8daf08222f0b4cebcf2ec3bd3a0
# Parent  516dbd9deb4f2c96b9d6d6c352ca261bb2796eda
update Xen version to 4.1.4
---


diff -r 516dbd9deb4f -r 12c4c4c0a715 Config.mk
--- a/Config.mk	Mon Dec 17 11:54:52 2012 +0000
+++ b/Config.mk	Tue Dec 18 13:35:59 2012 +0100
@@ -179,7 +179,7 @@ endif
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.1.4-rc1
+QEMU_TAG ?= xen-4.1.4
 # Tue Nov 13 18:25:17 2012 +0000
 # mapcache: Fix invalidate if memory requested was not bucket aligned
 
diff -r 516dbd9deb4f -r 12c4c4c0a715 xen/Makefile
--- a/xen/Makefile	Mon Dec 17 11:54:52 2012 +0000
+++ b/xen/Makefile	Tue Dec 18 13:35:59 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .4-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 13:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 13:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlJQd-0001Qv-G5; Wed, 19 Dec 2012 13:11:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQb-0001QJ-P8
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:17 +0000
Received: from [85.158.139.83:47108] by server-13.bemta-5.messagelabs.com id
	A0/82-10716-5FCB1D05; Wed, 19 Dec 2012 13:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1355922669!23290949!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19834 invoked from network); 19 Dec 2012 13:11:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 13:11:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQT-0004jj-0G
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlJQS-0007Vl-7s
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 13:11:08 +0000
Message-Id: <E1TlJQS-0007Vl-7s@xenbits.xen.org>
Date: Wed, 19 Dec 2012 13:11:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] update Xen version to 4.1.4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355834159 -3600
# Node ID 12c4c4c0a715c8daf08222f0b4cebcf2ec3bd3a0
# Parent  516dbd9deb4f2c96b9d6d6c352ca261bb2796eda
update Xen version to 4.1.4
---


diff -r 516dbd9deb4f -r 12c4c4c0a715 Config.mk
--- a/Config.mk	Mon Dec 17 11:54:52 2012 +0000
+++ b/Config.mk	Tue Dec 18 13:35:59 2012 +0100
@@ -179,7 +179,7 @@ endif
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.1.4-rc1
+QEMU_TAG ?= xen-4.1.4
 # Tue Nov 13 18:25:17 2012 +0000
 # mapcache: Fix invalidate if memory requested was not bucket aligned
 
diff -r 516dbd9deb4f -r 12c4c4c0a715 xen/Makefile
--- a/xen/Makefile	Mon Dec 17 11:54:52 2012 +0000
+++ b/xen/Makefile	Tue Dec 18 13:35:59 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .4-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .4$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:55:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMvT-0003t6-F4; Wed, 19 Dec 2012 16:55:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvS-0003su-J5
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:22 +0000
Received: from [85.158.137.99:17839] by server-14.bemta-3.messagelabs.com id
	1E/27-27443-971F1D05; Wed, 19 Dec 2012 16:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1355936119!17086354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29286 invoked from network); 19 Dec 2012 16:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvP-0007l4-DE
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvP-0004iI-8i
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:19 +0000
Message-Id: <E1TlMvP-0004iI-8i@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched_credit: add some tracing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1355854320 0
# Node ID aba2d72aae6cb9dcb78edbdbb45102ff0738f6b5
# Parent  c15b2aa0571faa564cd213f18f79de65166d1615
xen: sched_credit: add some tracing

About tickling, and PCPU selection.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r c15b2aa0571f -r aba2d72aae6c xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Dec 18 18:11:33 2012 +0000
+++ b/xen/common/sched_credit.c	Tue Dec 18 18:12:00 2012 +0000
@@ -21,6 +21,7 @@
 #include <asm/atomic.h>
 #include <xen/errno.h>
 #include <xen/keyhandler.h>
+#include <xen/trace.h>
 
 
 /*
@@ -98,6 +99,18 @@
 
 
 /*
+ * Credit tracing events ("only" 512 available!). Check
+ * include/public/trace.h for more details.
+ */
+#define TRC_CSCHED_SCHED_TASKLET TRC_SCHED_CLASS_EVT(CSCHED, 1)
+#define TRC_CSCHED_ACCOUNT_START TRC_SCHED_CLASS_EVT(CSCHED, 2)
+#define TRC_CSCHED_ACCOUNT_STOP  TRC_SCHED_CLASS_EVT(CSCHED, 3)
+#define TRC_CSCHED_STOLEN_VCPU   TRC_SCHED_CLASS_EVT(CSCHED, 4)
+#define TRC_CSCHED_PICKED_CPU    TRC_SCHED_CLASS_EVT(CSCHED, 5)
+#define TRC_CSCHED_TICKLE        TRC_SCHED_CLASS_EVT(CSCHED, 6)
+
+
+/*
  * Boot parameters
  */
 static int __read_mostly sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
@@ -316,9 +329,18 @@ __runq_tickle(unsigned int cpu, struct c
         }
     }
 
-    /* Send scheduler interrupts to designated CPUs */
     if ( !cpumask_empty(&mask) )
+    {
+        if ( unlikely(tb_init_done) )
+        {
+            /* Avoid TRACE_*: saves checking !tb_init_done each step */
+            for_each_cpu(cpu, &mask)
+                __trace_var(TRC_CSCHED_TICKLE, 0, sizeof(cpu), &cpu);
+        }
+
+        /* Send scheduler interrupts to designated CPUs */
         cpumask_raise_softirq(&mask, SCHEDULE_SOFTIRQ);
+    }
 }
 
 static void
@@ -555,6 +577,8 @@ _csched_cpu_pick(const struct scheduler 
     if ( commit && spc )
        spc->idle_bias = cpu;
 
+    TRACE_3D(TRC_CSCHED_PICKED_CPU, vc->domain->domain_id, vc->vcpu_id, cpu);
+
     return cpu;
 }
 
@@ -587,6 +611,9 @@ __csched_vcpu_acct_start(struct csched_p
         }
     }
 
+    TRACE_3D(TRC_CSCHED_ACCOUNT_START, sdom->dom->domain_id,
+             svc->vcpu->vcpu_id, sdom->active_vcpu_count);
+
     spin_unlock_irqrestore(&prv->lock, flags);
 }
 
@@ -609,6 +636,9 @@ __csched_vcpu_acct_stop_locked(struct cs
     {
         list_del_init(&sdom->active_sdom_elem);
     }
+
+    TRACE_3D(TRC_CSCHED_ACCOUNT_STOP, sdom->dom->domain_id,
+             svc->vcpu->vcpu_id, sdom->active_vcpu_count);
 }
 
 static void
@@ -1242,6 +1272,8 @@ csched_runq_steal(int peer_cpu, int cpu,
             if (__csched_vcpu_is_migrateable(vc, cpu))
             {
                 /* We got a candidate. Grab it! */
+                TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
+                         vc->domain->domain_id, vc->vcpu_id);
                 SCHED_VCPU_STAT_CRANK(speer, migrate_q);
                 SCHED_STAT_CRANK(migrate_queued);
                 WARN_ON(vc->is_urgent);
@@ -1402,6 +1434,7 @@ csched_schedule(
     /* Tasklet work (which runs in idle VCPU context) overrides all else. */
     if ( tasklet_work_scheduled )
     {
+        TRACE_0D(TRC_CSCHED_SCHED_TASKLET);
         snext = CSCHED_VCPU(idle_vcpu[cpu]);
         snext->pri = CSCHED_PRI_TS_BOOST;
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:55:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMvT-0003t6-F4; Wed, 19 Dec 2012 16:55:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvS-0003su-J5
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:22 +0000
Received: from [85.158.137.99:17839] by server-14.bemta-3.messagelabs.com id
	1E/27-27443-971F1D05; Wed, 19 Dec 2012 16:55:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1355936119!17086354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29286 invoked from network); 19 Dec 2012 16:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvP-0007l4-DE
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvP-0004iI-8i
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:19 +0000
Message-Id: <E1TlMvP-0004iI-8i@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched_credit: add some tracing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1355854320 0
# Node ID aba2d72aae6cb9dcb78edbdbb45102ff0738f6b5
# Parent  c15b2aa0571faa564cd213f18f79de65166d1615
xen: sched_credit: add some tracing

About tickling, and PCPU selection.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r c15b2aa0571f -r aba2d72aae6c xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Dec 18 18:11:33 2012 +0000
+++ b/xen/common/sched_credit.c	Tue Dec 18 18:12:00 2012 +0000
@@ -21,6 +21,7 @@
 #include <asm/atomic.h>
 #include <xen/errno.h>
 #include <xen/keyhandler.h>
+#include <xen/trace.h>
 
 
 /*
@@ -98,6 +99,18 @@
 
 
 /*
+ * Credit tracing events ("only" 512 available!). Check
+ * include/public/trace.h for more details.
+ */
+#define TRC_CSCHED_SCHED_TASKLET TRC_SCHED_CLASS_EVT(CSCHED, 1)
+#define TRC_CSCHED_ACCOUNT_START TRC_SCHED_CLASS_EVT(CSCHED, 2)
+#define TRC_CSCHED_ACCOUNT_STOP  TRC_SCHED_CLASS_EVT(CSCHED, 3)
+#define TRC_CSCHED_STOLEN_VCPU   TRC_SCHED_CLASS_EVT(CSCHED, 4)
+#define TRC_CSCHED_PICKED_CPU    TRC_SCHED_CLASS_EVT(CSCHED, 5)
+#define TRC_CSCHED_TICKLE        TRC_SCHED_CLASS_EVT(CSCHED, 6)
+
+
+/*
  * Boot parameters
  */
 static int __read_mostly sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
@@ -316,9 +329,18 @@ __runq_tickle(unsigned int cpu, struct c
         }
     }
 
-    /* Send scheduler interrupts to designated CPUs */
     if ( !cpumask_empty(&mask) )
+    {
+        if ( unlikely(tb_init_done) )
+        {
+            /* Avoid TRACE_*: saves checking !tb_init_done each step */
+            for_each_cpu(cpu, &mask)
+                __trace_var(TRC_CSCHED_TICKLE, 0, sizeof(cpu), &cpu);
+        }
+
+        /* Send scheduler interrupts to designated CPUs */
         cpumask_raise_softirq(&mask, SCHEDULE_SOFTIRQ);
+    }
 }
 
 static void
@@ -555,6 +577,8 @@ _csched_cpu_pick(const struct scheduler 
     if ( commit && spc )
        spc->idle_bias = cpu;
 
+    TRACE_3D(TRC_CSCHED_PICKED_CPU, vc->domain->domain_id, vc->vcpu_id, cpu);
+
     return cpu;
 }
 
@@ -587,6 +611,9 @@ __csched_vcpu_acct_start(struct csched_p
         }
     }
 
+    TRACE_3D(TRC_CSCHED_ACCOUNT_START, sdom->dom->domain_id,
+             svc->vcpu->vcpu_id, sdom->active_vcpu_count);
+
     spin_unlock_irqrestore(&prv->lock, flags);
 }
 
@@ -609,6 +636,9 @@ __csched_vcpu_acct_stop_locked(struct cs
     {
         list_del_init(&sdom->active_sdom_elem);
     }
+
+    TRACE_3D(TRC_CSCHED_ACCOUNT_STOP, sdom->dom->domain_id,
+             svc->vcpu->vcpu_id, sdom->active_vcpu_count);
 }
 
 static void
@@ -1242,6 +1272,8 @@ csched_runq_steal(int peer_cpu, int cpu,
             if (__csched_vcpu_is_migrateable(vc, cpu))
             {
                 /* We got a candidate. Grab it! */
+                TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
+                         vc->domain->domain_id, vc->vcpu_id);
                 SCHED_VCPU_STAT_CRANK(speer, migrate_q);
                 SCHED_STAT_CRANK(migrate_queued);
                 WARN_ON(vc->is_urgent);
@@ -1402,6 +1434,7 @@ csched_schedule(
     /* Tasklet work (which runs in idle VCPU context) overrides all else. */
     if ( tasklet_work_scheduled )
     {
+        TRACE_0D(TRC_CSCHED_SCHED_TASKLET);
         snext = CSCHED_VCPU(idle_vcpu[cpu]);
         snext->pri = CSCHED_PRI_TS_BOOST;
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:55:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMvU-0003tD-Hr; Wed, 19 Dec 2012 16:55:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvT-0003sw-2G
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:23 +0000
Received: from [85.158.143.35:19786] by server-2.bemta-4.messagelabs.com id
	D3/18-30861-A71F1D05; Wed, 19 Dec 2012 16:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1355936117!14378688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28562 invoked from network); 19 Dec 2012 16:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvN-0007kT-41
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvM-0004hZ-MU
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:16 +0000
Message-Id: <E1TlMvM-0004hZ-MU@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched_credit: improve picking
	up the idle CPU for a VCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1355854218 0
# Node ID 127c2c47d440eb7f3248ab5561909e326af7e328
# Parent  d5c0389bf26c89969ebce71927f34f6b923af949
xen: sched_credit: improve picking up the idle CPU for a VCPU

In _csched_cpu_pick() we try to select the best possible CPU for
running a VCPU, considering the characteristics of the underlying
hardware (i.e., how many threads, core, sockets, and how busy they
are). What we want is "the idle execution vehicle with the most
idling neighbours in its grouping".

In order to achieve it, we select a CPU from the VCPU's affinity,
giving preference to its current processor if possible, as the basis
for the comparison with all the other CPUs. Problem is, to discount
the VCPU itself when computing this "idleness" (in an attempt to be
fair wrt its current processor), we arbitrarily and unconditionally
consider that selected CPU as idle, even when it is not the case,
for instance:
 1. If the CPU is not the one where the VCPU is running (perhaps due
    to the affinity being changed);
 2. The CPU is where the VCPU is running, but it has other VCPUs in
    its runq, so it won't go idle even if the VCPU in question goes.

This is exemplified in the trace below:

]  3.466115364 x|------|------| d10v1   22005(2:2:5) 3 [ a 1 8 ]
   ... ... ...
   3.466122856 x|------|------| d10v1 runstate_change d10v1
   running->offline
   3.466123046 x|------|------| d?v? runstate_change d32767v0
   runnable->running
   ... ... ...
]  3.466126887 x|------|------| d32767v0   28004(2:8:4) 3 [ a 1 8 ]

22005(...) line (the first line) means _csched_cpu_pick() was called
on VCPU 1 of domain 10, while it is running on CPU 0, and it choose
CPU 8, which is busy ('|'), even if there are plenty of idle
CPUs. That is because, as a consequence of changing the VCPU affinity,
CPU 8 was chosen as the basis for the comparison, and therefore
considered idle (its bit gets unconditionally set in the bitmask
representing the idle CPUs). 28004(...) line means the VCPU is woken
up and queued on CPU 8's runq, where it waits for a context switch or
a migration, in order to be able to execute.

This change fixes things by only considering the "guessed" CPU idle if
the VCPU in question is both running there and is its only runnable
VCPU.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d5c0389bf26c -r 127c2c47d440 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Dec 18 13:17:27 2012 +0000
+++ b/xen/common/sched_credit.c	Tue Dec 18 18:10:18 2012 +0000
@@ -59,6 +59,9 @@
 #define CSCHED_VCPU(_vcpu)  ((struct csched_vcpu *) (_vcpu)->sched_priv)
 #define CSCHED_DOM(_dom)    ((struct csched_dom *) (_dom)->sched_priv)
 #define RUNQ(_cpu)          (&(CSCHED_PCPU(_cpu)->runq))
+/* Is the first element of _cpu's runq its idle vcpu? */
+#define IS_RUNQ_IDLE(_cpu)  (list_empty(RUNQ(_cpu)) || \
+                             is_idle_vcpu(__runq_elem(RUNQ(_cpu)->next)->vcpu))
 
 
 /*
@@ -478,9 +481,14 @@ _csched_cpu_pick(const struct scheduler 
      * distinct cores first and guarantees we don't do something stupid
      * like run two VCPUs on co-hyperthreads while there are idle cores
      * or sockets.
+     *
+     * Notice that, when computing the "idleness" of cpu, we may want to
+     * discount vc. That is, iff vc is the currently running and the only
+     * runnable vcpu on cpu, we add cpu to the idlers.
      */
     cpumask_and(&idlers, &cpu_online_map, CSCHED_PRIV(ops)->idlers);
-    cpumask_set_cpu(cpu, &idlers);
+    if ( vc->processor == cpu && IS_RUNQ_IDLE(cpu) )
+        cpumask_set_cpu(cpu, &idlers);
     cpumask_and(&cpus, &cpus, &idlers);
     cpumask_clear_cpu(cpu, &cpus);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:55:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:55:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMvU-0003tD-Hr; Wed, 19 Dec 2012 16:55:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvT-0003sw-2G
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:23 +0000
Received: from [85.158.143.35:19786] by server-2.bemta-4.messagelabs.com id
	D3/18-30861-A71F1D05; Wed, 19 Dec 2012 16:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1355936117!14378688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28562 invoked from network); 19 Dec 2012 16:55:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvN-0007kT-41
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvM-0004hZ-MU
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:16 +0000
Message-Id: <E1TlMvM-0004hZ-MU@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched_credit: improve picking
	up the idle CPU for a VCPU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1355854218 0
# Node ID 127c2c47d440eb7f3248ab5561909e326af7e328
# Parent  d5c0389bf26c89969ebce71927f34f6b923af949
xen: sched_credit: improve picking up the idle CPU for a VCPU

In _csched_cpu_pick() we try to select the best possible CPU for
running a VCPU, considering the characteristics of the underlying
hardware (i.e., how many threads, core, sockets, and how busy they
are). What we want is "the idle execution vehicle with the most
idling neighbours in its grouping".

In order to achieve it, we select a CPU from the VCPU's affinity,
giving preference to its current processor if possible, as the basis
for the comparison with all the other CPUs. Problem is, to discount
the VCPU itself when computing this "idleness" (in an attempt to be
fair wrt its current processor), we arbitrarily and unconditionally
consider that selected CPU as idle, even when it is not the case,
for instance:
 1. If the CPU is not the one where the VCPU is running (perhaps due
    to the affinity being changed);
 2. The CPU is where the VCPU is running, but it has other VCPUs in
    its runq, so it won't go idle even if the VCPU in question goes.

This is exemplified in the trace below:

]  3.466115364 x|------|------| d10v1   22005(2:2:5) 3 [ a 1 8 ]
   ... ... ...
   3.466122856 x|------|------| d10v1 runstate_change d10v1
   running->offline
   3.466123046 x|------|------| d?v? runstate_change d32767v0
   runnable->running
   ... ... ...
]  3.466126887 x|------|------| d32767v0   28004(2:8:4) 3 [ a 1 8 ]

22005(...) line (the first line) means _csched_cpu_pick() was called
on VCPU 1 of domain 10, while it is running on CPU 0, and it choose
CPU 8, which is busy ('|'), even if there are plenty of idle
CPUs. That is because, as a consequence of changing the VCPU affinity,
CPU 8 was chosen as the basis for the comparison, and therefore
considered idle (its bit gets unconditionally set in the bitmask
representing the idle CPUs). 28004(...) line means the VCPU is woken
up and queued on CPU 8's runq, where it waits for a context switch or
a migration, in order to be able to execute.

This change fixes things by only considering the "guessed" CPU idle if
the VCPU in question is both running there and is its only runnable
VCPU.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r d5c0389bf26c -r 127c2c47d440 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Dec 18 13:17:27 2012 +0000
+++ b/xen/common/sched_credit.c	Tue Dec 18 18:10:18 2012 +0000
@@ -59,6 +59,9 @@
 #define CSCHED_VCPU(_vcpu)  ((struct csched_vcpu *) (_vcpu)->sched_priv)
 #define CSCHED_DOM(_dom)    ((struct csched_dom *) (_dom)->sched_priv)
 #define RUNQ(_cpu)          (&(CSCHED_PCPU(_cpu)->runq))
+/* Is the first element of _cpu's runq its idle vcpu? */
+#define IS_RUNQ_IDLE(_cpu)  (list_empty(RUNQ(_cpu)) || \
+                             is_idle_vcpu(__runq_elem(RUNQ(_cpu)->next)->vcpu))
 
 
 /*
@@ -478,9 +481,14 @@ _csched_cpu_pick(const struct scheduler 
      * distinct cores first and guarantees we don't do something stupid
      * like run two VCPUs on co-hyperthreads while there are idle cores
      * or sockets.
+     *
+     * Notice that, when computing the "idleness" of cpu, we may want to
+     * discount vc. That is, iff vc is the currently running and the only
+     * runnable vcpu on cpu, we add cpu to the idlers.
      */
     cpumask_and(&idlers, &cpu_online_map, CSCHED_PRIV(ops)->idlers);
-    cpumask_set_cpu(cpu, &idlers);
+    if ( vc->processor == cpu && IS_RUNQ_IDLE(cpu) )
+        cpumask_set_cpu(cpu, &idlers);
     cpumask_and(&cpus, &cpus, &idlers);
     cpumask_clear_cpu(cpu, &cpus);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:55:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMvW-0003tP-Kl; Wed, 19 Dec 2012 16:55:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvV-0003sv-0K
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:25 +0000
Received: from [85.158.137.99:22444] by server-13.bemta-3.messagelabs.com id
	F4/00-00465-A71F1D05; Wed, 19 Dec 2012 16:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1355936120!20082644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31913 invoked from network); 19 Dec 2012 16:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvQ-0007l7-3m
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvP-0004iX-VK
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:19 +0000
Message-Id: <E1TlMvP-0004iX-VK@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: nested TPR
	shadow/threshold emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1355854485 0
# Node ID 9333aa732be79962738eba5368b9af3695d8e8b1
# Parent  aba2d72aae6cb9dcb78edbdbb45102ff0738f6b5
nested vmx: nested TPR shadow/threshold emulation

TPR shadow/threshold feature is important to speedup the boot time
for Windows guest. Besides, it is a must feature for certain VMM.

We map virtual APIC page address and TPR threshold from L1 VMCS,
and synch it into shadow VMCS in virtual vmentry.
If TPR_BELOW_THRESHOLD VM exit is triggered by L2 guest, we
inject it into L1 VMM for handling.

Besides, this commit fixes an issue for apic access page, if L1
VMM didn't enable this feature, we need to fill zero into the
shadow VMCS.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r aba2d72aae6c -r 9333aa732be7 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Tue Dec 18 18:12:00 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/intr.c	Tue Dec 18 18:14:45 2012 +0000
@@ -324,7 +324,9 @@ void vmx_intr_assist(void)
     }
 
  out:
-    if ( !cpu_has_vmx_virtual_intr_delivery && cpu_has_vmx_tpr_shadow )
+    if ( !nestedhvm_vcpu_in_guestmode(v) &&
+         !cpu_has_vmx_virtual_intr_delivery &&
+         cpu_has_vmx_tpr_shadow )
         __vmwrite(TPR_THRESHOLD, tpr_threshold);
 }
 
diff -r aba2d72aae6c -r 9333aa732be7 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Tue Dec 18 18:12:00 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Tue Dec 18 18:14:45 2012 +0000
@@ -471,8 +471,7 @@ void nvmx_update_exec_control(struct vcp
     shadow_cntrl = __n2_exec_control(v);
     pio_cntrl &= shadow_cntrl;
     /* Enforce the removed features */
-    shadow_cntrl &= ~(CPU_BASED_TPR_SHADOW
-                      | CPU_BASED_ACTIVATE_MSR_BITMAP
+    shadow_cntrl &= ~(CPU_BASED_ACTIVATE_MSR_BITMAP
                       | CPU_BASED_ACTIVATE_IO_BITMAP
                       | CPU_BASED_UNCOND_IO_EXITING);
     shadow_cntrl |= host_cntrl;
@@ -570,6 +569,38 @@ static void nvmx_update_apic_access_addr
         __vmwrite(APIC_ACCESS_ADDR, (apic_mfn << PAGE_SHIFT));
         hvm_unmap_guest_frame(apic_va); 
     }
+    else
+        __vmwrite(APIC_ACCESS_ADDR, 0);
+}
+
+static void nvmx_update_virtual_apic_address(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    u64 vapic_gpfn, vapic_mfn;
+    u32 ctrl;
+    void *vapic_va;
+
+    ctrl = __n2_exec_control(v);
+    if ( ctrl & CPU_BASED_TPR_SHADOW )
+    {
+        vapic_gpfn = __get_vvmcs(nvcpu->nv_vvmcx, VIRTUAL_APIC_PAGE_ADDR) >> PAGE_SHIFT;
+        vapic_va = hvm_map_guest_frame_ro(vapic_gpfn);
+        vapic_mfn = virt_to_mfn(vapic_va);
+        __vmwrite(VIRTUAL_APIC_PAGE_ADDR, (vapic_mfn << PAGE_SHIFT));
+        hvm_unmap_guest_frame(vapic_va); 
+    }
+    else
+        __vmwrite(VIRTUAL_APIC_PAGE_ADDR, 0);
+}
+
+static void nvmx_update_tpr_threshold(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    u32 ctrl = __n2_exec_control(v);
+    if ( ctrl & CPU_BASED_TPR_SHADOW )
+        __vmwrite(TPR_THRESHOLD, __get_vvmcs(nvcpu->nv_vvmcx, TPR_THRESHOLD));
+    else
+        __vmwrite(TPR_THRESHOLD, 0);
 }
 
 static void __clear_current_vvmcs(struct vcpu *v)
@@ -780,6 +811,8 @@ static void load_shadow_control(struct v
     nvmx_update_entry_control(v);
     vmx_update_exception_bitmap(v);
     nvmx_update_apic_access_address(v);
+    nvmx_update_virtual_apic_address(v);
+    nvmx_update_tpr_threshold(v);
 }
 
 static void load_shadow_guest_state(struct vcpu *v)
@@ -1371,6 +1404,7 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_ACTIVATE_MSR_BITMAP |
                CPU_BASED_PAUSE_EXITING |
                CPU_BASED_RDPMC_EXITING |
+               CPU_BASED_TPR_SHADOW |
                CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
         data = gen_vmx_msr(data, VMX_PROCBASED_CTLS_DEFAULT1, host_data);
         break;
@@ -1707,6 +1741,11 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         if ( ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES )
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_TPR_BELOW_THRESHOLD:
+        ctrl = __n2_exec_control(v);
+        if ( ctrl & CPU_BASED_TPR_SHADOW )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     default:
         gdprintk(XENLOG_WARNING, "Unknown nested vmexit reason %x.\n",
                  exit_reason);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:55:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMvW-0003tP-Kl; Wed, 19 Dec 2012 16:55:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvV-0003sv-0K
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:25 +0000
Received: from [85.158.137.99:22444] by server-13.bemta-3.messagelabs.com id
	F4/00-00465-A71F1D05; Wed, 19 Dec 2012 16:55:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-217.messagelabs.com!1355936120!20082644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31913 invoked from network); 19 Dec 2012 16:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvQ-0007l7-3m
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvP-0004iX-VK
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:19 +0000
Message-Id: <E1TlMvP-0004iX-VK@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] nested vmx: nested TPR
	shadow/threshold emulation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1355854485 0
# Node ID 9333aa732be79962738eba5368b9af3695d8e8b1
# Parent  aba2d72aae6cb9dcb78edbdbb45102ff0738f6b5
nested vmx: nested TPR shadow/threshold emulation

TPR shadow/threshold feature is important to speedup the boot time
for Windows guest. Besides, it is a must feature for certain VMM.

We map virtual APIC page address and TPR threshold from L1 VMCS,
and synch it into shadow VMCS in virtual vmentry.
If TPR_BELOW_THRESHOLD VM exit is triggered by L2 guest, we
inject it into L1 VMM for handling.

Besides, this commit fixes an issue for apic access page, if L1
VMM didn't enable this feature, we need to fill zero into the
shadow VMCS.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r aba2d72aae6c -r 9333aa732be7 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Tue Dec 18 18:12:00 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/intr.c	Tue Dec 18 18:14:45 2012 +0000
@@ -324,7 +324,9 @@ void vmx_intr_assist(void)
     }
 
  out:
-    if ( !cpu_has_vmx_virtual_intr_delivery && cpu_has_vmx_tpr_shadow )
+    if ( !nestedhvm_vcpu_in_guestmode(v) &&
+         !cpu_has_vmx_virtual_intr_delivery &&
+         cpu_has_vmx_tpr_shadow )
         __vmwrite(TPR_THRESHOLD, tpr_threshold);
 }
 
diff -r aba2d72aae6c -r 9333aa732be7 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Tue Dec 18 18:12:00 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Tue Dec 18 18:14:45 2012 +0000
@@ -471,8 +471,7 @@ void nvmx_update_exec_control(struct vcp
     shadow_cntrl = __n2_exec_control(v);
     pio_cntrl &= shadow_cntrl;
     /* Enforce the removed features */
-    shadow_cntrl &= ~(CPU_BASED_TPR_SHADOW
-                      | CPU_BASED_ACTIVATE_MSR_BITMAP
+    shadow_cntrl &= ~(CPU_BASED_ACTIVATE_MSR_BITMAP
                       | CPU_BASED_ACTIVATE_IO_BITMAP
                       | CPU_BASED_UNCOND_IO_EXITING);
     shadow_cntrl |= host_cntrl;
@@ -570,6 +569,38 @@ static void nvmx_update_apic_access_addr
         __vmwrite(APIC_ACCESS_ADDR, (apic_mfn << PAGE_SHIFT));
         hvm_unmap_guest_frame(apic_va); 
     }
+    else
+        __vmwrite(APIC_ACCESS_ADDR, 0);
+}
+
+static void nvmx_update_virtual_apic_address(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    u64 vapic_gpfn, vapic_mfn;
+    u32 ctrl;
+    void *vapic_va;
+
+    ctrl = __n2_exec_control(v);
+    if ( ctrl & CPU_BASED_TPR_SHADOW )
+    {
+        vapic_gpfn = __get_vvmcs(nvcpu->nv_vvmcx, VIRTUAL_APIC_PAGE_ADDR) >> PAGE_SHIFT;
+        vapic_va = hvm_map_guest_frame_ro(vapic_gpfn);
+        vapic_mfn = virt_to_mfn(vapic_va);
+        __vmwrite(VIRTUAL_APIC_PAGE_ADDR, (vapic_mfn << PAGE_SHIFT));
+        hvm_unmap_guest_frame(vapic_va); 
+    }
+    else
+        __vmwrite(VIRTUAL_APIC_PAGE_ADDR, 0);
+}
+
+static void nvmx_update_tpr_threshold(struct vcpu *v)
+{
+    struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+    u32 ctrl = __n2_exec_control(v);
+    if ( ctrl & CPU_BASED_TPR_SHADOW )
+        __vmwrite(TPR_THRESHOLD, __get_vvmcs(nvcpu->nv_vvmcx, TPR_THRESHOLD));
+    else
+        __vmwrite(TPR_THRESHOLD, 0);
 }
 
 static void __clear_current_vvmcs(struct vcpu *v)
@@ -780,6 +811,8 @@ static void load_shadow_control(struct v
     nvmx_update_entry_control(v);
     vmx_update_exception_bitmap(v);
     nvmx_update_apic_access_address(v);
+    nvmx_update_virtual_apic_address(v);
+    nvmx_update_tpr_threshold(v);
 }
 
 static void load_shadow_guest_state(struct vcpu *v)
@@ -1371,6 +1404,7 @@ int nvmx_msr_read_intercept(unsigned int
                CPU_BASED_ACTIVATE_MSR_BITMAP |
                CPU_BASED_PAUSE_EXITING |
                CPU_BASED_RDPMC_EXITING |
+               CPU_BASED_TPR_SHADOW |
                CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
         data = gen_vmx_msr(data, VMX_PROCBASED_CTLS_DEFAULT1, host_data);
         break;
@@ -1707,6 +1741,11 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         if ( ctrl & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES )
             nvcpu->nv_vmexit_pending = 1;
         break;
+    case EXIT_REASON_TPR_BELOW_THRESHOLD:
+        ctrl = __n2_exec_control(v);
+        if ( ctrl & CPU_BASED_TPR_SHADOW )
+            nvcpu->nv_vmexit_pending = 1;
+        break;
     default:
         gdprintk(XENLOG_WARNING, "Unknown nested vmexit reason %x.\n",
                  exit_reason);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:55:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:55:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMvZ-0003uk-Qy; Wed, 19 Dec 2012 16:55:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvY-0003tp-CX
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:28 +0000
Received: from [85.158.143.35:51079] by server-1.bemta-4.messagelabs.com id
	19/F2-28401-F71F1D05; Wed, 19 Dec 2012 16:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1355936121!5289334!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23622 invoked from network); 19 Dec 2012 16:55:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvR-0007lA-0u
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvQ-0004im-Qm
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:20 +0000
Message-Id: <E1TlMvQ-0004im-Qm@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: lock target domain in do_domctl
	common code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1355854573 0
# Node ID 5226a0c95760479311f86f4d7be764d9cf926cbf
# Parent  9333aa732be79962738eba5368b9af3695d8e8b1
xen: lock target domain in do_domctl common code

Because almost all domctls need to lock the target domain, do this by
default instead of repeating it in each domctl. This is not currently
extended to the arch-specific domctls, but RCU locks are safe to take
recursively so this only causes duplicate but correct locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9333aa732be7 -r 5226a0c95760 xen/common/domctl.c
--- a/xen/common/domctl.c	Tue Dec 18 18:14:45 2012 +0000
+++ b/xen/common/domctl.c	Tue Dec 18 18:16:13 2012 +0000
@@ -244,6 +244,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
     long ret = 0;
     bool_t copyback = 0;
     struct xen_domctl curop, *op = &curop;
+    struct domain *d;
 
     if ( copy_from_guest(op, u_domctl, 1) )
         return -EFAULT;
@@ -253,19 +254,29 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     switch ( op->cmd )
     {
+    case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_test_assign_device:
+        d = NULL;
+        break;
+    default:
+        d = rcu_lock_domain_by_id(op->domain);
+        if ( d == NULL )
+            return -ESRCH;
+    }
+
+    switch ( op->cmd )
+    {
     case XEN_DOMCTL_ioport_mapping:
     case XEN_DOMCTL_memory_mapping:
     case XEN_DOMCTL_bind_pt_irq:
     case XEN_DOMCTL_unbind_pt_irq: {
-        struct domain *d;
-        bool_t is_priv = IS_PRIV(current->domain);
-        if ( !is_priv && ((d = rcu_lock_domain_by_id(op->domain)) != NULL) )
+        bool_t is_priv = IS_PRIV_FOR(current->domain, d);
+        if ( !is_priv )
         {
-            is_priv = IS_PRIV_FOR(current->domain, d);
-            rcu_unlock_domain(d);
+            ret = -EPERM;
+            goto domctl_out_unlock_domonly;
         }
-        if ( !is_priv )
-            return -EPERM;
         break;
     }
 #ifdef XSM_ENABLE
@@ -279,15 +290,18 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
     }
 
     if ( !domctl_lock_acquire() )
+    {
+        if ( d )
+            rcu_unlock_domain(d);
         return hypercall_create_continuation(
             __HYPERVISOR_domctl, "h", u_domctl);
+    }
 
     switch ( op->cmd )
     {
 
     case XEN_DOMCTL_setvcpucontext:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
         vcpu_guest_context_u c = { .nat = NULL };
         unsigned int vcpu = op->u.vcpucontext.vcpu;
         struct vcpu *v;
@@ -341,77 +355,48 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     svc_out:
         free_vcpu_guest_context(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
+        ret = xsm_pausedomain(d);
+        if ( ret )
+            break;
+
+        ret = -EINVAL;
+        if ( d != current->domain )
         {
-            ret = xsm_pausedomain(d);
-            if ( ret )
-                goto pausedomain_out;
-
-            ret = -EINVAL;
-            if ( d != current->domain )
-            {
-                domain_pause_by_systemcontroller(d);
-                ret = 0;
-            }
-        pausedomain_out:
-            rcu_unlock_domain(d);
+            domain_pause_by_systemcontroller(d);
+            ret = 0;
         }
     }
     break;
 
     case XEN_DOMCTL_unpausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
+        ret = xsm_unpausedomain(d);
+        if ( ret )
             break;
 
-        ret = xsm_unpausedomain(d);
-        if ( ret )
-        {
-            rcu_unlock_domain(d);
-            break;
-        }
-
         domain_unpause_by_systemcontroller(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_resumedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
+        ret = xsm_resumedomain(d);
+        if ( ret )
             break;
 
-        ret = xsm_resumedomain(d);
-        if ( ret )
-        {
-            rcu_unlock_domain(d);
-            break;
-        }
-
         domain_resume(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_createdomain:
     {
-        struct domain *d;
         domid_t        dom;
         static domid_t rover = 0;
         unsigned int domcr_flags;
@@ -461,6 +446,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         if ( IS_ERR(d) )
         {
             ret = PTR_ERR(d);
+            d = NULL;
             break;
         }
 
@@ -471,39 +457,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
         op->domain = d->domain_id;
         copyback = 1;
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_max_vcpus:
     {
-        struct domain *d;
         unsigned int i, max = op->u.max_vcpus.max, cpu;
         cpumask_t *online;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (max > MAX_VIRT_CPUS) ||
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_max_vcpus(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
-            rcu_unlock_domain(d);
             ret = -EAGAIN;
             break;
         }
@@ -578,44 +553,31 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     maxvcpu_out_novcpulock:
         domain_unpause(d);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_destroydomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
-        {
-            ret = xsm_destroydomain(d) ? : domain_kill(d);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_destroydomain(d) ? : domain_kill(d);
     }
     break;
 
     case XEN_DOMCTL_setvcpuaffinity:
     case XEN_DOMCTL_getvcpuaffinity:
     {
-        domid_t dom = op->domain;
-        struct domain *d = rcu_lock_domain_by_id(dom);
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuaffinity(op->cmd, d);
         if ( ret )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.vcpuaffinity.vcpu]) == NULL )
-            goto vcpuaffinity_out;
+            break;
 
         if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
         {
@@ -634,35 +596,22 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
             ret = cpumask_to_xenctl_cpumap(
                 &op->u.vcpuaffinity.cpumap, v->cpu_affinity);
         }
-
-    vcpuaffinity_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_scheduler_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_scheduler(d);
         if ( ret )
-            goto scheduler_op_out;
+            break;
 
         ret = sched_adjust(d, &op->u.scheduler_op);
         copyback = 1;
-
-    scheduler_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getdomaininfo:
     { 
-        struct domain *d;
         domid_t dom = op->domain;
 
         rcu_read_lock(&domlist_read_lock);
@@ -689,19 +638,15 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     getdomaininfo_out:
         rcu_read_unlock(&domlist_read_lock);
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_getvcpucontext:
     { 
         vcpu_guest_context_u c = { .nat = NULL };
-        struct domain       *d;
         struct vcpu         *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpucontext(d);
         if ( ret )
             goto getvcpucontext_out;
@@ -751,31 +696,25 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     getvcpucontext_out:
         xfree(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getvcpuinfo:
     { 
-        struct domain *d;
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpuinfo(d);
         if ( ret )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.getvcpuinfo.vcpu]) == NULL )
-            goto getvcpuinfo_out;
+            break;
 
         vcpu_runstate_get(v, &runstate);
 
@@ -786,25 +725,16 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         op->u.getvcpuinfo.cpu      = v->processor;
         ret = 0;
         copyback = 1;
-
-    getvcpuinfo_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_max_mem:
     {
-        struct domain *d;
         unsigned long new_max;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainmaxmem(d);
         if ( ret )
-            goto max_mem_out;
+            break;
 
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
@@ -818,77 +748,43 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         d->max_pages = new_max;
         ret = 0;
         spin_unlock(&d->page_alloc_lock);
-
-    max_mem_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainhandle(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_setdebugging:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( d == current->domain ) /* no domain_pause() */
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_setdebugging(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_irq_permission:
     {
-        struct domain *d;
         unsigned int pirq = op->u.irq_permission.pirq;
         int allow = op->u.irq_permission.allow_access;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
         else if ( xsm_irq_permission(d, pirq, allow) )
@@ -897,14 +793,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
             ret = irq_permit_access(d, pirq);
         else
             ret = irq_deny_access(d, pirq);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_iomem_permission:
     {
-        struct domain *d;
         unsigned long mfn = op->u.iomem_permission.first_mfn;
         unsigned long nr_mfns = op->u.iomem_permission.nr_mfns;
         int allow = op->u.iomem_permission.allow_access;
@@ -913,125 +806,78 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
         else
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settimeoffset:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
+        ret = xsm_domain_settime(d);
+        if ( ret )
             break;
 
-        ret = xsm_domain_settime(d);
-        if ( ret )
-        {
-            rcu_unlock_domain(d);
-            break;
-        }
-
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_set_target:
     {
-        struct domain *d, *e;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
+        struct domain *e;
 
         ret = -ESRCH;
         e = get_domain_by_id(op->u.set_target.target);
         if ( e == NULL )
-            goto set_target_out;
+            break;
 
         ret = -EINVAL;
         if ( (d == e) || (d->target != NULL) )
         {
             put_domain(e);
-            goto set_target_out;
+            break;
         }
 
         ret = xsm_set_target(d, e);
         if ( ret ) {
             put_domain(e);
-            goto set_target_out;            
+            break;
         }
 
         /* Hold reference on @e until we destroy @d. */
         d->target = e;
 
         ret = 0;
-
-    set_target_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_subscribe:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->suspend_evtchn = op->u.subscribe.port;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->suspend_evtchn = op->u.subscribe.port;
     }
     break;
 
     case XEN_DOMCTL_disable_migrate:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->disable_migrate = op->u.disable_migrate.disable;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->disable_migrate = op->u.disable_migrate.disable;
     }
     break;
 
     case XEN_DOMCTL_set_virq_handler:
     {
-        struct domain *d;
         uint32_t virq = op->u.set_virq_handler.virq;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_set_virq_handler(d, virq);
-            if ( !ret )
-                ret = set_global_virq_handler(d, virq);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_set_virq_handler(d, virq);
+        if ( !ret )
+            ret = set_global_virq_handler(d, virq);
     }
     break;
 
@@ -1042,6 +888,10 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     domctl_lock_release();
 
+ domctl_out_unlock_domonly:
+    if ( d )
+        rcu_unlock_domain(d);
+
     if ( copyback && __copy_to_guest(u_domctl, op, 1) )
         ret = -EFAULT;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:55:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:55:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMvZ-0003uk-Qy; Wed, 19 Dec 2012 16:55:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvY-0003tp-CX
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:28 +0000
Received: from [85.158.143.35:51079] by server-1.bemta-4.messagelabs.com id
	19/F2-28401-F71F1D05; Wed, 19 Dec 2012 16:55:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1355936121!5289334!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23622 invoked from network); 19 Dec 2012 16:55:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvR-0007lA-0u
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvQ-0004im-Qm
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:20 +0000
Message-Id: <E1TlMvQ-0004im-Qm@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: lock target domain in do_domctl
	common code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1355854573 0
# Node ID 5226a0c95760479311f86f4d7be764d9cf926cbf
# Parent  9333aa732be79962738eba5368b9af3695d8e8b1
xen: lock target domain in do_domctl common code

Because almost all domctls need to lock the target domain, do this by
default instead of repeating it in each domctl. This is not currently
extended to the arch-specific domctls, but RCU locks are safe to take
recursively so this only causes duplicate but correct locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9333aa732be7 -r 5226a0c95760 xen/common/domctl.c
--- a/xen/common/domctl.c	Tue Dec 18 18:14:45 2012 +0000
+++ b/xen/common/domctl.c	Tue Dec 18 18:16:13 2012 +0000
@@ -244,6 +244,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
     long ret = 0;
     bool_t copyback = 0;
     struct xen_domctl curop, *op = &curop;
+    struct domain *d;
 
     if ( copy_from_guest(op, u_domctl, 1) )
         return -EFAULT;
@@ -253,19 +254,29 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     switch ( op->cmd )
     {
+    case XEN_DOMCTL_createdomain:
+    case XEN_DOMCTL_getdomaininfo:
+    case XEN_DOMCTL_test_assign_device:
+        d = NULL;
+        break;
+    default:
+        d = rcu_lock_domain_by_id(op->domain);
+        if ( d == NULL )
+            return -ESRCH;
+    }
+
+    switch ( op->cmd )
+    {
     case XEN_DOMCTL_ioport_mapping:
     case XEN_DOMCTL_memory_mapping:
     case XEN_DOMCTL_bind_pt_irq:
     case XEN_DOMCTL_unbind_pt_irq: {
-        struct domain *d;
-        bool_t is_priv = IS_PRIV(current->domain);
-        if ( !is_priv && ((d = rcu_lock_domain_by_id(op->domain)) != NULL) )
+        bool_t is_priv = IS_PRIV_FOR(current->domain, d);
+        if ( !is_priv )
         {
-            is_priv = IS_PRIV_FOR(current->domain, d);
-            rcu_unlock_domain(d);
+            ret = -EPERM;
+            goto domctl_out_unlock_domonly;
         }
-        if ( !is_priv )
-            return -EPERM;
         break;
     }
 #ifdef XSM_ENABLE
@@ -279,15 +290,18 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
     }
 
     if ( !domctl_lock_acquire() )
+    {
+        if ( d )
+            rcu_unlock_domain(d);
         return hypercall_create_continuation(
             __HYPERVISOR_domctl, "h", u_domctl);
+    }
 
     switch ( op->cmd )
     {
 
     case XEN_DOMCTL_setvcpucontext:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
         vcpu_guest_context_u c = { .nat = NULL };
         unsigned int vcpu = op->u.vcpucontext.vcpu;
         struct vcpu *v;
@@ -341,77 +355,48 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     svc_out:
         free_vcpu_guest_context(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
+        ret = xsm_pausedomain(d);
+        if ( ret )
+            break;
+
+        ret = -EINVAL;
+        if ( d != current->domain )
         {
-            ret = xsm_pausedomain(d);
-            if ( ret )
-                goto pausedomain_out;
-
-            ret = -EINVAL;
-            if ( d != current->domain )
-            {
-                domain_pause_by_systemcontroller(d);
-                ret = 0;
-            }
-        pausedomain_out:
-            rcu_unlock_domain(d);
+            domain_pause_by_systemcontroller(d);
+            ret = 0;
         }
     }
     break;
 
     case XEN_DOMCTL_unpausedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
+        ret = xsm_unpausedomain(d);
+        if ( ret )
             break;
 
-        ret = xsm_unpausedomain(d);
-        if ( ret )
-        {
-            rcu_unlock_domain(d);
-            break;
-        }
-
         domain_unpause_by_systemcontroller(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_resumedomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-
-        ret = -ESRCH;
-        if ( d == NULL )
+        ret = xsm_resumedomain(d);
+        if ( ret )
             break;
 
-        ret = xsm_resumedomain(d);
-        if ( ret )
-        {
-            rcu_unlock_domain(d);
-            break;
-        }
-
         domain_resume(d);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_createdomain:
     {
-        struct domain *d;
         domid_t        dom;
         static domid_t rover = 0;
         unsigned int domcr_flags;
@@ -461,6 +446,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         if ( IS_ERR(d) )
         {
             ret = PTR_ERR(d);
+            d = NULL;
             break;
         }
 
@@ -471,39 +457,28 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
         op->domain = d->domain_id;
         copyback = 1;
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_max_vcpus:
     {
-        struct domain *d;
         unsigned int i, max = op->u.max_vcpus.max, cpu;
         cpumask_t *online;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (d == current->domain) || /* no domain_pause() */
              (max > MAX_VIRT_CPUS) ||
              (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_max_vcpus(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         /* Until Xenoprof can dynamically grow its vcpu-s array... */
         if ( d->xenoprof )
         {
-            rcu_unlock_domain(d);
             ret = -EAGAIN;
             break;
         }
@@ -578,44 +553,31 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     maxvcpu_out_novcpulock:
         domain_unpause(d);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_destroydomain:
     {
-        struct domain *d = rcu_lock_domain_by_id(op->domain);
-        ret = -ESRCH;
-        if ( d != NULL )
-        {
-            ret = xsm_destroydomain(d) ? : domain_kill(d);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_destroydomain(d) ? : domain_kill(d);
     }
     break;
 
     case XEN_DOMCTL_setvcpuaffinity:
     case XEN_DOMCTL_getvcpuaffinity:
     {
-        domid_t dom = op->domain;
-        struct domain *d = rcu_lock_domain_by_id(dom);
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuaffinity(op->cmd, d);
         if ( ret )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
-            goto vcpuaffinity_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.vcpuaffinity.vcpu]) == NULL )
-            goto vcpuaffinity_out;
+            break;
 
         if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
         {
@@ -634,35 +596,22 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
             ret = cpumask_to_xenctl_cpumap(
                 &op->u.vcpuaffinity.cpumap, v->cpu_affinity);
         }
-
-    vcpuaffinity_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_scheduler_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_scheduler(d);
         if ( ret )
-            goto scheduler_op_out;
+            break;
 
         ret = sched_adjust(d, &op->u.scheduler_op);
         copyback = 1;
-
-    scheduler_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getdomaininfo:
     { 
-        struct domain *d;
         domid_t dom = op->domain;
 
         rcu_read_lock(&domlist_read_lock);
@@ -689,19 +638,15 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     getdomaininfo_out:
         rcu_read_unlock(&domlist_read_lock);
+        d = NULL;
     }
     break;
 
     case XEN_DOMCTL_getvcpucontext:
     { 
         vcpu_guest_context_u c = { .nat = NULL };
-        struct domain       *d;
         struct vcpu         *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpucontext(d);
         if ( ret )
             goto getvcpucontext_out;
@@ -751,31 +696,25 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     getvcpucontext_out:
         xfree(c.nat);
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getvcpuinfo:
     { 
-        struct domain *d;
         struct vcpu   *v;
         struct vcpu_runstate_info runstate;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
-
         ret = xsm_getvcpuinfo(d);
         if ( ret )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -EINVAL;
         if ( op->u.getvcpuinfo.vcpu >= d->max_vcpus )
-            goto getvcpuinfo_out;
+            break;
 
         ret = -ESRCH;
         if ( (v = d->vcpu[op->u.getvcpuinfo.vcpu]) == NULL )
-            goto getvcpuinfo_out;
+            break;
 
         vcpu_runstate_get(v, &runstate);
 
@@ -786,25 +725,16 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         op->u.getvcpuinfo.cpu      = v->processor;
         ret = 0;
         copyback = 1;
-
-    getvcpuinfo_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_max_mem:
     {
-        struct domain *d;
         unsigned long new_max;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainmaxmem(d);
         if ( ret )
-            goto max_mem_out;
+            break;
 
         ret = -EINVAL;
         new_max = op->u.max_mem.max_memkb >> (PAGE_SHIFT-10);
@@ -818,77 +748,43 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         d->max_pages = new_max;
         ret = 0;
         spin_unlock(&d->page_alloc_lock);
-
-    max_mem_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_setdomainhandle:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_setdomainhandle(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         memcpy(d->handle, op->u.setdomainhandle.handle,
                sizeof(xen_domain_handle_t));
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_setdebugging:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( d == current->domain ) /* no domain_pause() */
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         ret = xsm_setdebugging(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domain_pause(d);
         d->debugger_attached = !!op->u.setdebugging.enable;
         domain_unpause(d); /* causes guest to latch new status */
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_irq_permission:
     {
-        struct domain *d;
         unsigned int pirq = op->u.irq_permission.pirq;
         int allow = op->u.irq_permission.allow_access;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
         else if ( xsm_irq_permission(d, pirq, allow) )
@@ -897,14 +793,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
             ret = irq_permit_access(d, pirq);
         else
             ret = irq_deny_access(d, pirq);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_iomem_permission:
     {
-        struct domain *d;
         unsigned long mfn = op->u.iomem_permission.first_mfn;
         unsigned long nr_mfns = op->u.iomem_permission.nr_mfns;
         int allow = op->u.iomem_permission.allow_access;
@@ -913,125 +806,78 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
         if ( (mfn + nr_mfns - 1) < mfn ) /* wrap? */
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
-
         if ( xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, allow) )
             ret = -EPERM;
         else if ( allow )
             ret = iomem_permit_access(d, mfn, mfn + nr_mfns - 1);
         else
             ret = iomem_deny_access(d, mfn, mfn + nr_mfns - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settimeoffset:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
+        ret = xsm_domain_settime(d);
+        if ( ret )
             break;
 
-        ret = xsm_domain_settime(d);
-        if ( ret )
-        {
-            rcu_unlock_domain(d);
-            break;
-        }
-
         domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds);
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_set_target:
     {
-        struct domain *d, *e;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d == NULL )
-            break;
+        struct domain *e;
 
         ret = -ESRCH;
         e = get_domain_by_id(op->u.set_target.target);
         if ( e == NULL )
-            goto set_target_out;
+            break;
 
         ret = -EINVAL;
         if ( (d == e) || (d->target != NULL) )
         {
             put_domain(e);
-            goto set_target_out;
+            break;
         }
 
         ret = xsm_set_target(d, e);
         if ( ret ) {
             put_domain(e);
-            goto set_target_out;            
+            break;
         }
 
         /* Hold reference on @e until we destroy @d. */
         d->target = e;
 
         ret = 0;
-
-    set_target_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_subscribe:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->suspend_evtchn = op->u.subscribe.port;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->suspend_evtchn = op->u.subscribe.port;
     }
     break;
 
     case XEN_DOMCTL_disable_migrate:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) != NULL )
-        {
-            ret = xsm_domctl(d, op->cmd);
-            if ( !ret )
-                d->disable_migrate = op->u.disable_migrate.disable;
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_domctl(d, op->cmd);
+        if ( !ret )
+            d->disable_migrate = op->u.disable_migrate.disable;
     }
     break;
 
     case XEN_DOMCTL_set_virq_handler:
     {
-        struct domain *d;
         uint32_t virq = op->u.set_virq_handler.virq;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_set_virq_handler(d, virq);
-            if ( !ret )
-                ret = set_global_virq_handler(d, virq);
-            rcu_unlock_domain(d);
-        }
+        ret = xsm_set_virq_handler(d, virq);
+        if ( !ret )
+            ret = set_global_virq_handler(d, virq);
     }
     break;
 
@@ -1042,6 +888,10 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
 
     domctl_lock_release();
 
+ domctl_out_unlock_domonly:
+    if ( d )
+        rcu_unlock_domain(d);
+
     if ( copyback && __copy_to_guest(u_domctl, op, 1) )
         ret = -EFAULT;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:55:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMvZ-0003uf-NV; Wed, 19 Dec 2012 16:55:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvX-0003tU-F8
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:27 +0000
Received: from [85.158.139.83:32191] by server-5.bemta-5.messagelabs.com id
	E4/A3-22648-E71F1D05; Wed, 19 Dec 2012 16:55:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1355936121!23333765!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15746 invoked from network); 19 Dec 2012 16:55:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvR-0007lD-LU
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvR-0004j1-Ju
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:21 +0000
Message-Id: <E1TlMvR-0004j1-Ju@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arch/*: add struct domain
	parameter to arch_do_domctl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1355854612 0
# Node ID b04de677de31f26ba4b8f2f382ca4dfffcff9a79
# Parent  5226a0c95760479311f86f4d7be764d9cf926cbf
xen/arch/*: add struct domain parameter to arch_do_domctl

Since the arch-independent do_domctl function now RCU locks the domain
specified by op->domain, pass the struct domain to the arch-specific
domctl function and remove the duplicate per-subfunction locking.

This also removes two get_domain/put_domain call pairs (in
XEN_DOMCTL_assign_device and XEN_DOMCTL_deassign_device), replacing
them with RCU locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 5226a0c95760 -r b04de677de31 xen/arch/arm/domctl.c
--- a/xen/arch/arm/domctl.c	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/arch/arm/domctl.c	Tue Dec 18 18:16:52 2012 +0000
@@ -10,7 +10,7 @@
 #include <xen/errno.h>
 #include <public/domctl.h>
 
-long arch_do_domctl(struct xen_domctl *domctl,
+long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
                     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     return -ENOSYS;
diff -r 5226a0c95760 -r b04de677de31 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/arch/x86/domctl.c	Tue Dec 18 18:16:52 2012 +0000
@@ -47,7 +47,7 @@ static int gdbsx_guest_mem_io(
 }
 
 long arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
@@ -58,23 +58,15 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_shadow_op:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = paging_domctl(d,
-                                &domctl->u.shadow_op,
-                                guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copyback = 1;
-        } 
+        ret = paging_domctl(d,
+                            &domctl->u.shadow_op,
+                            guest_handle_cast(u_domctl, void));
+        copyback = 1;
     }
     break;
 
     case XEN_DOMCTL_ioport_permission:
     {
-        struct domain *d;
         unsigned int fp = domctl->u.ioport_permission.first_port;
         unsigned int np = domctl->u.ioport_permission.nr_ports;
         int allow = domctl->u.ioport_permission.allow_access;
@@ -83,10 +75,6 @@ long arch_do_domctl(
         if ( (fp + np) > 65536 )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         if ( np == 0 )
             ret = 0;
         else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
@@ -95,8 +83,6 @@ long arch_do_domctl(
             ret = ioports_permit_access(d, fp, fp + np - 1);
         else
             ret = ioports_deny_access(d, fp, fp + np - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -104,23 +90,16 @@ long arch_do_domctl(
     {
         struct page_info *page;
         unsigned long mfn = domctl->u.getpageframeinfo.gmfn;
-        domid_t dom = domctl->domain;
-        struct domain *d;
 
         ret = -EINVAL;
-
-        if ( unlikely(!mfn_valid(mfn)) ||
-             unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
+        if ( unlikely(!mfn_valid(mfn)) )
             break;
 
         page = mfn_to_page(mfn);
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( likely(get_page(page, d)) )
         {
@@ -150,7 +129,6 @@ long arch_do_domctl(
             put_page(page);
         }
 
-        rcu_unlock_domain(d);
         copyback = 1;
     }
     break;
@@ -160,27 +138,17 @@ long arch_do_domctl(
         {
             unsigned int n, j;
             unsigned int num = domctl->u.getpageframeinfo3.num;
-            domid_t dom = domctl->domain;
-            struct domain *d;
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = -ESRCH;
-            if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-                break;
-
             ret = xsm_getpageframeinfo(d);
             if ( ret )
-            {
-                rcu_unlock_domain(d);
                 break;
-            }
 
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
                 ret = -E2BIG;
-                rcu_unlock_domain(d);
                 break;
             }
 
@@ -188,7 +156,6 @@ long arch_do_domctl(
             if ( !page )
             {
                 ret = -ENOMEM;
-                rcu_unlock_domain(d);
                 break;
             }
             arr = page_to_virt(page);
@@ -263,7 +230,6 @@ long arch_do_domctl(
 
             free_domheap_page(virt_to_page(arr));
 
-            rcu_unlock_domain(d);
             break;
         }
         /* fall thru */
@@ -271,25 +237,15 @@ long arch_do_domctl(
     {
         int n,j;
         int num = domctl->u.getpageframeinfo2.num;
-        domid_t dom = domctl->domain;
-        struct domain *d;
         uint32_t *arr32;
-        ret = -ESRCH;
-
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-            break;
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -297,7 +253,6 @@ long arch_do_domctl(
         if ( !arr32 )
         {
             ret = -ENOMEM;
-            rcu_unlock_domain(d);
             break;
         }
  
@@ -369,78 +324,58 @@ long arch_do_domctl(
         }
 
         free_xenheap_page(arr32);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getmemlist:
     {
         int i;
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long max_pfns = domctl->u.getmemlist.max_pfns;
         uint64_t mfn;
         struct page_info *page;
 
-        ret = -EINVAL;
-        if ( d != NULL )
+        ret = xsm_getmemlist(d);
+        if ( ret )
+            break;
+
+        if ( unlikely(d->is_dying) ) {
+            ret = -EINVAL;
+            break;
+        }
+
+        spin_lock(&d->page_alloc_lock);
+
+        ret = i = 0;
+        page_list_for_each(page, &d->page_list)
         {
-            ret = xsm_getmemlist(d);
-            if ( ret )
+            if ( i >= max_pfns )
+                break;
+            mfn = page_to_mfn(page);
+            if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
+                                      i, &mfn, 1) )
             {
-                rcu_unlock_domain(d);
+                ret = -EFAULT;
                 break;
             }
+			++i;
+		}
 
-            spin_lock(&d->page_alloc_lock);
+        spin_unlock(&d->page_alloc_lock);
 
-            if ( unlikely(d->is_dying) ) {
-                spin_unlock(&d->page_alloc_lock);
-                goto getmemlist_out;
-            }
-
-            ret = i = 0;
-            page_list_for_each(page, &d->page_list)
-            {
-                if ( i >= max_pfns )
-                    break;
-                mfn = page_to_mfn(page);
-                if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
-                                          i, &mfn, 1) )
-                {
-                    ret = -EFAULT;
-                    break;
-                }
-                ++i;
-            }
-            
-            spin_unlock(&d->page_alloc_lock);
-
-            domctl->u.getmemlist.num_pfns = i;
-            copyback = 1;
-        getmemlist_out:
-            rcu_unlock_domain(d);
-        }
+        domctl->u.getmemlist.num_pfns = i;
+        copyback = 1;
     }
     break;
 
     case XEN_DOMCTL_hypercall_init:
     {
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long gmfn = domctl->u.hypercall_init.gmfn;
         struct page_info *page;
         void *hypercall_page;
 
-        ret = -ESRCH;
-        if ( unlikely(d == NULL) )
-            break;
-
         ret = xsm_hypercall_init(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
@@ -449,7 +384,6 @@ long arch_do_domctl(
         {
             if ( page )
                 put_page(page);
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -460,19 +394,12 @@ long arch_do_domctl(
         unmap_domain_page(hypercall_page);
 
         put_page_and_type(page);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_sethvmcontext:
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -497,19 +424,12 @@ long arch_do_domctl(
     sethvmcontext_out:
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gethvmcontext:
     { 
         struct hvm_domain_context c = { 0 };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -548,7 +468,6 @@ long arch_do_domctl(
             ret = -EFAULT;
 
     gethvmcontext_out:
-        rcu_unlock_domain(d);
         copyback = 1;
 
         if ( c.data != NULL )
@@ -558,46 +477,28 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
-            goto gethvmcontext_partial_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
-            goto gethvmcontext_partial_out;
+            break;
 
         domain_pause(d);
         ret = hvm_save_one(d, domctl->u.hvmcontext_partial.type,
                            domctl->u.hvmcontext_partial.instance,
                            domctl->u.hvmcontext_partial.buffer);
         domain_unpause(d);
-
-    gethvmcontext_partial_out:
-        rcu_unlock_domain(d);
     }
     break;
 
 
     case XEN_DOMCTL_set_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         switch ( domctl->u.address_size.size )
         {
@@ -611,30 +512,18 @@ long arch_do_domctl(
             ret = (domctl->u.address_size.size == BITS_PER_LONG) ? 0 : -EINVAL;
             break;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
-        rcu_unlock_domain(d);
         ret = 0;
         copyback = 1;
     }
@@ -642,46 +531,28 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-            goto set_machine_address_size_out;
+            break;
 
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
-            goto set_machine_address_size_out;
+            break;
 
         d->arch.physaddr_bitsize = domctl->u.address_size.size;
 
         ret = 0;
-    set_machine_address_size_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
-        rcu_unlock_domain(d);
         ret = 0;
         copyback = 1;
     }
@@ -689,25 +560,20 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_sendtrigger:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_sendtrigger(d);
         if ( ret )
-            goto sendtrigger_out;
+            break;
 
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
-            goto sendtrigger_out;
+            break;
 
         ret = -ESRCH;
         if ( domctl->u.sendtrigger.vcpu >= d->max_vcpus ||
              (v = d->vcpu[domctl->u.sendtrigger.vcpu]) == NULL )
-            goto sendtrigger_out;
+            break;
 
         switch ( domctl->u.sendtrigger.trigger )
         {
@@ -744,34 +610,27 @@ long arch_do_domctl(
         default:
             ret = -ENOSYS;
         }
-
-    sendtrigger_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_bind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto bind_out;
+            break;
 
         ret = xsm_bind_pt_irq(d, bind);
         if ( ret )
-            goto bind_out;
+            break;
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto bind_out;
+            break;
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -783,26 +642,19 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_create_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    bind_out:
-        rcu_unlock_domain(d);
     }
     break;    
 
     case XEN_DOMCTL_unbind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto unbind_out;
+            break;
 
         if ( iommu_enabled )
         {
@@ -813,15 +665,11 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_destroy_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    unbind_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_memory_mapping:
     {
-        struct domain *d;
         unsigned long gfn = domctl->u.memory_mapping.first_gfn;
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
@@ -839,16 +687,10 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
+        ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add);
+        if ( ret )
             break;
 
-        ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
-            break;
-        }
-
         if ( add )
         {
             printk(XENLOG_G_INFO
@@ -894,15 +736,12 @@ long arch_do_domctl(
                        ret, add ? "removing" : "denying", d->domain_id,
                        mfn, mfn + nr_mfns - 1);
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_ioport_mapping:
     {
 #define MAX_IOPORTS    0x10000
-        struct domain *d;
         struct hvm_iommu *hd;
         unsigned int fgp = domctl->u.ioport_mapping.first_gport;
         unsigned int fmp = domctl->u.ioport_mapping.first_mport;
@@ -926,16 +765,10 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
+        ret = xsm_ioport_permission(d, fmp, fmp + np - 1, add);
+        if ( ret )
             break;
 
-        ret = xsm_ioport_permission(d, fmp, fmp + np - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
-            break;
-        }
-
         hd = domain_hvm_iommu(d);
         if ( add )
         {
@@ -990,30 +823,19 @@ long arch_do_domctl(
                        "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
                        ret, d->domain_id, fmp, fmp + np - 1);
         }
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_pin_mem_cacheattr(d);
         if ( ret )
-            goto pin_out;
+            break;
 
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
             domctl->u.pin_mem_cacheattr.type);
-
-    pin_out:
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -1021,19 +843,13 @@ long arch_do_domctl(
     case XEN_DOMCTL_get_ext_vcpucontext:
     {
         struct xen_domctl_ext_vcpucontext *evc;
-        struct domain *d;
         struct vcpu *v;
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_ext_vcpucontext(d, domctl->cmd);
         if ( ret )
-            goto ext_vcpucontext_out;
+            break;
 
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
@@ -1124,7 +940,6 @@ long arch_do_domctl(
         ret = 0;
 
     ext_vcpucontext_out:
-        rcu_unlock_domain(d);
         if ( domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext )
             copyback = 1;
     }
@@ -1132,16 +947,10 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_cpuid:
     {
-        struct domain *d;
         xen_domctl_cpuid_t *ctl = &domctl->u.cpuid;
         cpuid_input_t *cpuid = NULL; 
         int i;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         for ( i = 0; i < MAX_CPUID_INPUT; i++ )
         {
             cpuid = &d->arch.cpuids[i];
@@ -1164,21 +973,13 @@ long arch_do_domctl(
             memcpy(cpuid, ctl, sizeof(cpuid_input_t));
             ret = 0;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gettscinfo:
     {
-        struct domain *d;
         xen_guest_tsc_info_t info;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_get_info(d, &info.tsc_mode,
                         &info.elapsed_nsec,
@@ -1189,20 +990,11 @@ long arch_do_domctl(
         else
             ret = 0;
         domain_unpause(d);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settscinfo:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_set_info(d, domctl->u.tsc_info.info.tsc_mode,
                      domctl->u.tsc_info.info.elapsed_nsec,
@@ -1210,66 +1002,40 @@ long arch_do_domctl(
                      domctl->u.tsc_info.info.incarnation);
         domain_unpause(d);
 
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_suppress_spurious_page_faults:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            d->arch.suppress_spurious_page_faults = 1;
-            rcu_unlock_domain(d);
-            ret = 0;
-        }
+        d->arch.suppress_spurious_page_faults = 1;
+        ret = 0;
     }
     break;
 
     case XEN_DOMCTL_debug_op:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (domctl->u.debug_op.vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[domctl->u.debug_op.vcpu]) == NULL) )
-            goto debug_op_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d))
-            goto debug_op_out;
+            break;
 
         ret = hvm_debug_op(v, domctl->u.debug_op.op);
-
-    debug_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_guestmemio:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_guest_memio.remain =
             domctl->u.gdbsx_guest_memio.len;
 
         ret = gdbsx_guest_mem_io(domctl->domain, &domctl->u.gdbsx_guest_memio);
-
-        rcu_unlock_domain(d);
         if ( !ret )
            copyback = 1;
     }
@@ -1277,71 +1043,42 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_gdbsx_pausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         vcpu_pause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_unpausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         if ( !atomic_read(&v->pause_count) )
             printk("WARN: Unpausing vcpu:%d which is not paused\n", v->vcpu_id);
         vcpu_unpause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_domstatus:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_domstatus.vcpu_id = -1;
         domctl->u.gdbsx_domstatus.paused = d->is_paused_by_controller;
         if ( domctl->u.gdbsx_domstatus.paused )
@@ -1358,7 +1095,6 @@ long arch_do_domctl(
                 }
             }
         }
-        rcu_unlock_domain(d);
         ret = 0;
         copyback = 1;
     }
@@ -1368,7 +1104,6 @@ long arch_do_domctl(
     case XEN_DOMCTL_getvcpuextstate:
     {
         struct xen_domctl_vcpuextstate *evc;
-        struct domain *d;
         struct vcpu *v;
         uint32_t offset = 0;
         uint64_t _xfeature_mask = 0;
@@ -1379,12 +1114,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = -ESRCH;
-
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuextstate(d, domctl->cmd);
         if ( ret )
             goto vcpuextstate_out;
@@ -1483,7 +1212,6 @@ long arch_do_domctl(
         ret = 0;
 
     vcpuextstate_out:
-        rcu_unlock_domain(d);
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
             copyback = 1;
     }
@@ -1491,52 +1219,35 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_event_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_event(d);
-            if ( !ret )
-                ret = mem_event_domctl(d, &domctl->u.mem_event_op,
-                                       guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copyback = 1;
-        } 
+        ret = xsm_mem_event(d);
+        if ( !ret )
+            ret = mem_event_domctl(d, &domctl->u.mem_event_op,
+                                   guest_handle_cast(u_domctl, void));
+        copyback = 1;
     }
     break;
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_sharing(d);
-            if ( !ret )
-                ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_sharing(d);
+        if ( !ret )
+            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
 #if P2M_AUDIT
     case XEN_DOMCTL_audit_p2m:
     {
-        struct domain *d;
-
-        ret = rcu_lock_remote_target_domain_by_id(domctl->domain, &d);
-        if ( ret != 0 )
+        if ( d == current->domain )
+        {
+            ret = -EPERM;
             break;
+        }
 
         audit_p2m(d,
                   &domctl->u.audit_p2m.orphans,
                   &domctl->u.audit_p2m.m2p_bad,
                   &domctl->u.audit_p2m.p2m_bad);
-        rcu_unlock_domain(d);
         copyback = 1;
     }
     break;
@@ -1544,52 +1255,36 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_access_required:
     {
-        struct domain *d;
         struct p2m_domain* p2m;
         
         ret = -EPERM;
-        if ( current->domain->domain_id == domctl->domain )
+        if ( current->domain == d )
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_event(d);
-            if ( !ret ) {
-                p2m = p2m_get_hostp2m(d);
-                p2m->access_required = domctl->u.access_required.access_required;
-            }
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_event(d);
+        if ( !ret ) {
+            p2m = p2m_get_hostp2m(d);
+            p2m->access_required = domctl->u.access_required.access_required;
+        }
     }
     break;
 
     case XEN_DOMCTL_set_broken_page_p2m:
     {
-        struct domain *d;
+        p2m_type_t pt;
+        unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+        mfn_t mfn = get_gfn_query(d, pfn, &pt);
 
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            p2m_type_t pt;
-            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
-            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+        if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                     (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+            ret = -EINVAL;
 
-            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
-                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
-                ret = -EINVAL;
-
-            put_gfn(d, pfn);
-            rcu_unlock_domain(d);
-        }
-        else
-            ret = -ESRCH;
+        put_gfn(d, pfn);
     }
     break;
 
     default:
-        ret = iommu_do_domctl(domctl, u_domctl);
+        ret = iommu_do_domctl(domctl, d, u_domctl);
         break;
     }
 
diff -r 5226a0c95760 -r b04de677de31 xen/common/domctl.c
--- a/xen/common/domctl.c	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/common/domctl.c	Tue Dec 18 18:16:52 2012 +0000
@@ -882,7 +882,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
     break;
 
     default:
-        ret = arch_do_domctl(op, u_domctl);
+        ret = arch_do_domctl(op, d, u_domctl);
         break;
     }
 
diff -r 5226a0c95760 -r b04de677de31 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/drivers/passthrough/iommu.c	Tue Dec 18 18:16:52 2012 +0000
@@ -542,10 +542,9 @@ void iommu_crash_shutdown(void)
 }
 
 int iommu_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
-    struct domain *d;
     u16 seg;
     u8 bus, devfn;
     int ret = 0;
@@ -564,10 +563,6 @@ int iommu_do_domctl(
         if ( ret )
             break;
 
-        ret = -EINVAL;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.get_device_group.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.get_device_group.machine_sbdf & 0xff;
@@ -588,7 +583,6 @@ int iommu_do_domctl(
         }
         if ( __copy_field_to_guest(u_domctl, domctl, u.get_device_group) )
             ret = -EFAULT;
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -611,20 +605,15 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_assign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) ||
-             unlikely(d->is_dying) )
+        if ( unlikely(d->is_dying) )
         {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_assign_device: get_domain_by_id() failed\n");
             ret = -EINVAL;
-            if ( d )
-                goto assign_device_out;
             break;
         }
 
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto assign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -638,22 +627,12 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    assign_device_out:
-        put_domain(d);
         break;
 
     case XEN_DOMCTL_deassign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) )
-        {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_deassign_device: get_domain_by_id() failed\n");
-            ret = -EINVAL;
-            break;
-        }
-
         ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto deassign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -668,8 +647,6 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    deassign_device_out:
-        put_domain(d);
         break;
 
     default:
diff -r 5226a0c95760 -r b04de677de31 xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/include/xen/hypercall.h	Tue Dec 18 18:16:52 2012 +0000
@@ -37,7 +37,7 @@ do_domctl(
 
 extern long
 arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 extern long
diff -r 5226a0c95760 -r b04de677de31 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/include/xen/iommu.h	Tue Dec 18 18:16:52 2012 +0000
@@ -132,7 +132,8 @@ void iommu_crash_shutdown(void);
 void iommu_set_dom0_mapping(struct domain *d);
 void iommu_share_p2m_table(struct domain *d);
 
-int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
+int iommu_do_domctl(struct xen_domctl *, struct domain *d,
+                    XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:55:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMvZ-0003uf-NV; Wed, 19 Dec 2012 16:55:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvX-0003tU-F8
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:27 +0000
Received: from [85.158.139.83:32191] by server-5.bemta-5.messagelabs.com id
	E4/A3-22648-E71F1D05; Wed, 19 Dec 2012 16:55:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1355936121!23333765!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15746 invoked from network); 19 Dec 2012 16:55:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvR-0007lD-LU
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvR-0004j1-Ju
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:21 +0000
Message-Id: <E1TlMvR-0004j1-Ju@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arch/*: add struct domain
	parameter to arch_do_domctl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Daniel De Graaf <dgdegra@tycho.nsa.gov>
# Date 1355854612 0
# Node ID b04de677de31f26ba4b8f2f382ca4dfffcff9a79
# Parent  5226a0c95760479311f86f4d7be764d9cf926cbf
xen/arch/*: add struct domain parameter to arch_do_domctl

Since the arch-independent do_domctl function now RCU locks the domain
specified by op->domain, pass the struct domain to the arch-specific
domctl function and remove the duplicate per-subfunction locking.

This also removes two get_domain/put_domain call pairs (in
XEN_DOMCTL_assign_device and XEN_DOMCTL_deassign_device), replacing
them with RCU locking.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 5226a0c95760 -r b04de677de31 xen/arch/arm/domctl.c
--- a/xen/arch/arm/domctl.c	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/arch/arm/domctl.c	Tue Dec 18 18:16:52 2012 +0000
@@ -10,7 +10,7 @@
 #include <xen/errno.h>
 #include <public/domctl.h>
 
-long arch_do_domctl(struct xen_domctl *domctl,
+long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
                     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     return -ENOSYS;
diff -r 5226a0c95760 -r b04de677de31 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/arch/x86/domctl.c	Tue Dec 18 18:16:52 2012 +0000
@@ -47,7 +47,7 @@ static int gdbsx_guest_mem_io(
 }
 
 long arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
@@ -58,23 +58,15 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_shadow_op:
     {
-        struct domain *d;
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = paging_domctl(d,
-                                &domctl->u.shadow_op,
-                                guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copyback = 1;
-        } 
+        ret = paging_domctl(d,
+                            &domctl->u.shadow_op,
+                            guest_handle_cast(u_domctl, void));
+        copyback = 1;
     }
     break;
 
     case XEN_DOMCTL_ioport_permission:
     {
-        struct domain *d;
         unsigned int fp = domctl->u.ioport_permission.first_port;
         unsigned int np = domctl->u.ioport_permission.nr_ports;
         int allow = domctl->u.ioport_permission.allow_access;
@@ -83,10 +75,6 @@ long arch_do_domctl(
         if ( (fp + np) > 65536 )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
-            break;
-
         if ( np == 0 )
             ret = 0;
         else if ( xsm_ioport_permission(d, fp, fp + np - 1, allow) )
@@ -95,8 +83,6 @@ long arch_do_domctl(
             ret = ioports_permit_access(d, fp, fp + np - 1);
         else
             ret = ioports_deny_access(d, fp, fp + np - 1);
-
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -104,23 +90,16 @@ long arch_do_domctl(
     {
         struct page_info *page;
         unsigned long mfn = domctl->u.getpageframeinfo.gmfn;
-        domid_t dom = domctl->domain;
-        struct domain *d;
 
         ret = -EINVAL;
-
-        if ( unlikely(!mfn_valid(mfn)) ||
-             unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
+        if ( unlikely(!mfn_valid(mfn)) )
             break;
 
         page = mfn_to_page(mfn);
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( likely(get_page(page, d)) )
         {
@@ -150,7 +129,6 @@ long arch_do_domctl(
             put_page(page);
         }
 
-        rcu_unlock_domain(d);
         copyback = 1;
     }
     break;
@@ -160,27 +138,17 @@ long arch_do_domctl(
         {
             unsigned int n, j;
             unsigned int num = domctl->u.getpageframeinfo3.num;
-            domid_t dom = domctl->domain;
-            struct domain *d;
             struct page_info *page;
             xen_pfn_t *arr;
 
-            ret = -ESRCH;
-            if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-                break;
-
             ret = xsm_getpageframeinfo(d);
             if ( ret )
-            {
-                rcu_unlock_domain(d);
                 break;
-            }
 
             if ( unlikely(num > 1024) ||
                  unlikely(num != domctl->u.getpageframeinfo3.num) )
             {
                 ret = -E2BIG;
-                rcu_unlock_domain(d);
                 break;
             }
 
@@ -188,7 +156,6 @@ long arch_do_domctl(
             if ( !page )
             {
                 ret = -ENOMEM;
-                rcu_unlock_domain(d);
                 break;
             }
             arr = page_to_virt(page);
@@ -263,7 +230,6 @@ long arch_do_domctl(
 
             free_domheap_page(virt_to_page(arr));
 
-            rcu_unlock_domain(d);
             break;
         }
         /* fall thru */
@@ -271,25 +237,15 @@ long arch_do_domctl(
     {
         int n,j;
         int num = domctl->u.getpageframeinfo2.num;
-        domid_t dom = domctl->domain;
-        struct domain *d;
         uint32_t *arr32;
-        ret = -ESRCH;
-
-        if ( unlikely((d = rcu_lock_domain_by_id(dom)) == NULL) )
-            break;
 
         ret = xsm_getpageframeinfo(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         if ( unlikely(num > 1024) )
         {
             ret = -E2BIG;
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -297,7 +253,6 @@ long arch_do_domctl(
         if ( !arr32 )
         {
             ret = -ENOMEM;
-            rcu_unlock_domain(d);
             break;
         }
  
@@ -369,78 +324,58 @@ long arch_do_domctl(
         }
 
         free_xenheap_page(arr32);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_getmemlist:
     {
         int i;
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long max_pfns = domctl->u.getmemlist.max_pfns;
         uint64_t mfn;
         struct page_info *page;
 
-        ret = -EINVAL;
-        if ( d != NULL )
+        ret = xsm_getmemlist(d);
+        if ( ret )
+            break;
+
+        if ( unlikely(d->is_dying) ) {
+            ret = -EINVAL;
+            break;
+        }
+
+        spin_lock(&d->page_alloc_lock);
+
+        ret = i = 0;
+        page_list_for_each(page, &d->page_list)
         {
-            ret = xsm_getmemlist(d);
-            if ( ret )
+            if ( i >= max_pfns )
+                break;
+            mfn = page_to_mfn(page);
+            if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
+                                      i, &mfn, 1) )
             {
-                rcu_unlock_domain(d);
+                ret = -EFAULT;
                 break;
             }
+			++i;
+		}
 
-            spin_lock(&d->page_alloc_lock);
+        spin_unlock(&d->page_alloc_lock);
 
-            if ( unlikely(d->is_dying) ) {
-                spin_unlock(&d->page_alloc_lock);
-                goto getmemlist_out;
-            }
-
-            ret = i = 0;
-            page_list_for_each(page, &d->page_list)
-            {
-                if ( i >= max_pfns )
-                    break;
-                mfn = page_to_mfn(page);
-                if ( copy_to_guest_offset(domctl->u.getmemlist.buffer,
-                                          i, &mfn, 1) )
-                {
-                    ret = -EFAULT;
-                    break;
-                }
-                ++i;
-            }
-            
-            spin_unlock(&d->page_alloc_lock);
-
-            domctl->u.getmemlist.num_pfns = i;
-            copyback = 1;
-        getmemlist_out:
-            rcu_unlock_domain(d);
-        }
+        domctl->u.getmemlist.num_pfns = i;
+        copyback = 1;
     }
     break;
 
     case XEN_DOMCTL_hypercall_init:
     {
-        struct domain *d = rcu_lock_domain_by_id(domctl->domain);
         unsigned long gmfn = domctl->u.hypercall_init.gmfn;
         struct page_info *page;
         void *hypercall_page;
 
-        ret = -ESRCH;
-        if ( unlikely(d == NULL) )
-            break;
-
         ret = xsm_hypercall_init(d);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
 
@@ -449,7 +384,6 @@ long arch_do_domctl(
         {
             if ( page )
                 put_page(page);
-            rcu_unlock_domain(d);
             break;
         }
 
@@ -460,19 +394,12 @@ long arch_do_domctl(
         unmap_domain_page(hypercall_page);
 
         put_page_and_type(page);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_sethvmcontext:
     { 
         struct hvm_domain_context c = { .size = domctl->u.hvmcontext.size };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -497,19 +424,12 @@ long arch_do_domctl(
     sethvmcontext_out:
         if ( c.data != NULL )
             xfree(c.data);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gethvmcontext:
     { 
         struct hvm_domain_context c = { 0 };
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
 
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
@@ -548,7 +468,6 @@ long arch_do_domctl(
             ret = -EFAULT;
 
     gethvmcontext_out:
-        rcu_unlock_domain(d);
         copyback = 1;
 
         if ( c.data != NULL )
@@ -558,46 +477,28 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_gethvmcontext_partial:
     { 
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_hvmcontext(d, domctl->cmd);
         if ( ret )
-            goto gethvmcontext_partial_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) ) 
-            goto gethvmcontext_partial_out;
+            break;
 
         domain_pause(d);
         ret = hvm_save_one(d, domctl->u.hvmcontext_partial.type,
                            domctl->u.hvmcontext_partial.instance,
                            domctl->u.hvmcontext_partial.buffer);
         domain_unpause(d);
-
-    gethvmcontext_partial_out:
-        rcu_unlock_domain(d);
     }
     break;
 
 
     case XEN_DOMCTL_set_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         switch ( domctl->u.address_size.size )
         {
@@ -611,30 +512,18 @@ long arch_do_domctl(
             ret = (domctl->u.address_size.size == BITS_PER_LONG) ? 0 : -EINVAL;
             break;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size =
             is_pv_32on64_domain(d) ? 32 : BITS_PER_LONG;
 
-        rcu_unlock_domain(d);
         ret = 0;
         copyback = 1;
     }
@@ -642,46 +531,28 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-            goto set_machine_address_size_out;
+            break;
 
         ret = -EBUSY;
         if ( d->tot_pages > 0 )
-            goto set_machine_address_size_out;
+            break;
 
         d->arch.physaddr_bitsize = domctl->u.address_size.size;
 
         ret = 0;
-    set_machine_address_size_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_get_machine_address_size:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_machine_address_size(d, domctl->cmd);
         if ( ret )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
 
         domctl->u.address_size.size = d->arch.physaddr_bitsize;
 
-        rcu_unlock_domain(d);
         ret = 0;
         copyback = 1;
     }
@@ -689,25 +560,20 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_sendtrigger:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = xsm_sendtrigger(d);
         if ( ret )
-            goto sendtrigger_out;
+            break;
 
         ret = -EINVAL;
         if ( domctl->u.sendtrigger.vcpu >= MAX_VIRT_CPUS )
-            goto sendtrigger_out;
+            break;
 
         ret = -ESRCH;
         if ( domctl->u.sendtrigger.vcpu >= d->max_vcpus ||
              (v = d->vcpu[domctl->u.sendtrigger.vcpu]) == NULL )
-            goto sendtrigger_out;
+            break;
 
         switch ( domctl->u.sendtrigger.trigger )
         {
@@ -744,34 +610,27 @@ long arch_do_domctl(
         default:
             ret = -ENOSYS;
         }
-
-    sendtrigger_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_bind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) )
-            goto bind_out;
+            break;
 
         ret = xsm_bind_pt_irq(d, bind);
         if ( ret )
-            goto bind_out;
+            break;
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto bind_out;
+            break;
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -783,26 +642,19 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_create_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    bind_out:
-        rcu_unlock_domain(d);
     }
     break;    
 
     case XEN_DOMCTL_unbind_pt_irq:
     {
-        struct domain * d;
         xen_domctl_bind_pt_irq_t * bind;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
         if ( !IS_PRIV(current->domain) &&
              !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto unbind_out;
+            break;
 
         if ( iommu_enabled )
         {
@@ -813,15 +665,11 @@ long arch_do_domctl(
         if ( ret < 0 )
             printk(XENLOG_G_ERR "pt_irq_destroy_bind failed (%ld) for dom%d\n",
                    ret, d->domain_id);
-
-    unbind_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_memory_mapping:
     {
-        struct domain *d;
         unsigned long gfn = domctl->u.memory_mapping.first_gfn;
         unsigned long mfn = domctl->u.memory_mapping.first_mfn;
         unsigned long nr_mfns = domctl->u.memory_mapping.nr_mfns;
@@ -839,16 +687,10 @@ long arch_do_domctl(
              !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
+        ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add);
+        if ( ret )
             break;
 
-        ret = xsm_iomem_permission(d, mfn, mfn + nr_mfns - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
-            break;
-        }
-
         if ( add )
         {
             printk(XENLOG_G_INFO
@@ -894,15 +736,12 @@ long arch_do_domctl(
                        ret, add ? "removing" : "denying", d->domain_id,
                        mfn, mfn + nr_mfns - 1);
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_ioport_mapping:
     {
 #define MAX_IOPORTS    0x10000
-        struct domain *d;
         struct hvm_iommu *hd;
         unsigned int fgp = domctl->u.ioport_mapping.first_gport;
         unsigned int fmp = domctl->u.ioport_mapping.first_mport;
@@ -926,16 +765,10 @@ long arch_do_domctl(
              !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
-        ret = -ESRCH;
-        if ( unlikely((d = rcu_lock_domain_by_id(domctl->domain)) == NULL) )
+        ret = xsm_ioport_permission(d, fmp, fmp + np - 1, add);
+        if ( ret )
             break;
 
-        ret = xsm_ioport_permission(d, fmp, fmp + np - 1, add);
-        if ( ret ) {
-            rcu_unlock_domain(d);
-            break;
-        }
-
         hd = domain_hvm_iommu(d);
         if ( add )
         {
@@ -990,30 +823,19 @@ long arch_do_domctl(
                        "ioport_map: error %ld denying dom%d access to [%x,%x]\n",
                        ret, d->domain_id, fmp, fmp + np - 1);
         }
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_pin_mem_cacheattr:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_pin_mem_cacheattr(d);
         if ( ret )
-            goto pin_out;
+            break;
 
         ret = hvm_set_mem_pinned_cacheattr(
             d, domctl->u.pin_mem_cacheattr.start,
             domctl->u.pin_mem_cacheattr.end,
             domctl->u.pin_mem_cacheattr.type);
-
-    pin_out:
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -1021,19 +843,13 @@ long arch_do_domctl(
     case XEN_DOMCTL_get_ext_vcpucontext:
     {
         struct xen_domctl_ext_vcpucontext *evc;
-        struct domain *d;
         struct vcpu *v;
 
         evc = &domctl->u.ext_vcpucontext;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_ext_vcpucontext(d, domctl->cmd);
         if ( ret )
-            goto ext_vcpucontext_out;
+            break;
 
         ret = -ESRCH;
         if ( (evc->vcpu >= d->max_vcpus) ||
@@ -1124,7 +940,6 @@ long arch_do_domctl(
         ret = 0;
 
     ext_vcpucontext_out:
-        rcu_unlock_domain(d);
         if ( domctl->cmd == XEN_DOMCTL_get_ext_vcpucontext )
             copyback = 1;
     }
@@ -1132,16 +947,10 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_cpuid:
     {
-        struct domain *d;
         xen_domctl_cpuid_t *ctl = &domctl->u.cpuid;
         cpuid_input_t *cpuid = NULL; 
         int i;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         for ( i = 0; i < MAX_CPUID_INPUT; i++ )
         {
             cpuid = &d->arch.cpuids[i];
@@ -1164,21 +973,13 @@ long arch_do_domctl(
             memcpy(cpuid, ctl, sizeof(cpuid_input_t));
             ret = 0;
         }
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gettscinfo:
     {
-        struct domain *d;
         xen_guest_tsc_info_t info;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_get_info(d, &info.tsc_mode,
                         &info.elapsed_nsec,
@@ -1189,20 +990,11 @@ long arch_do_domctl(
         else
             ret = 0;
         domain_unpause(d);
-
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_settscinfo:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         domain_pause(d);
         tsc_set_info(d, domctl->u.tsc_info.info.tsc_mode,
                      domctl->u.tsc_info.info.elapsed_nsec,
@@ -1210,66 +1002,40 @@ long arch_do_domctl(
                      domctl->u.tsc_info.info.incarnation);
         domain_unpause(d);
 
-        rcu_unlock_domain(d);
         ret = 0;
     }
     break;
 
     case XEN_DOMCTL_suppress_spurious_page_faults:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            d->arch.suppress_spurious_page_faults = 1;
-            rcu_unlock_domain(d);
-            ret = 0;
-        }
+        d->arch.suppress_spurious_page_faults = 1;
+        ret = 0;
     }
     break;
 
     case XEN_DOMCTL_debug_op:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = -EINVAL;
         if ( (domctl->u.debug_op.vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[domctl->u.debug_op.vcpu]) == NULL) )
-            goto debug_op_out;
+            break;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d))
-            goto debug_op_out;
+            break;
 
         ret = hvm_debug_op(v, domctl->u.debug_op.op);
-
-    debug_op_out:
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_guestmemio:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_guest_memio.remain =
             domctl->u.gdbsx_guest_memio.len;
 
         ret = gdbsx_guest_mem_io(domctl->domain, &domctl->u.gdbsx_guest_memio);
-
-        rcu_unlock_domain(d);
         if ( !ret )
            copyback = 1;
     }
@@ -1277,71 +1043,42 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_gdbsx_pausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         vcpu_pause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_unpausevcpu:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         ret = -EBUSY;
         if ( !d->is_paused_by_controller )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         ret = -EINVAL;
         if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS ||
              (v = d->vcpu[domctl->u.gdbsx_pauseunp_vcpu.vcpu]) == NULL )
-        {
-            rcu_unlock_domain(d);
             break;
-        }
         if ( !atomic_read(&v->pause_count) )
             printk("WARN: Unpausing vcpu:%d which is not paused\n", v->vcpu_id);
         vcpu_unpause(v);
         ret = 0;
-        rcu_unlock_domain(d);
     }
     break;
 
     case XEN_DOMCTL_gdbsx_domstatus:
     {
-        struct domain *d;
         struct vcpu *v;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         domctl->u.gdbsx_domstatus.vcpu_id = -1;
         domctl->u.gdbsx_domstatus.paused = d->is_paused_by_controller;
         if ( domctl->u.gdbsx_domstatus.paused )
@@ -1358,7 +1095,6 @@ long arch_do_domctl(
                 }
             }
         }
-        rcu_unlock_domain(d);
         ret = 0;
         copyback = 1;
     }
@@ -1368,7 +1104,6 @@ long arch_do_domctl(
     case XEN_DOMCTL_getvcpuextstate:
     {
         struct xen_domctl_vcpuextstate *evc;
-        struct domain *d;
         struct vcpu *v;
         uint32_t offset = 0;
         uint64_t _xfeature_mask = 0;
@@ -1379,12 +1114,6 @@ long arch_do_domctl(
 
         evc = &domctl->u.vcpuextstate;
 
-        ret = -ESRCH;
-
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d == NULL )
-            break;
-
         ret = xsm_vcpuextstate(d, domctl->cmd);
         if ( ret )
             goto vcpuextstate_out;
@@ -1483,7 +1212,6 @@ long arch_do_domctl(
         ret = 0;
 
     vcpuextstate_out:
-        rcu_unlock_domain(d);
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
             copyback = 1;
     }
@@ -1491,52 +1219,35 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_mem_event_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_event(d);
-            if ( !ret )
-                ret = mem_event_domctl(d, &domctl->u.mem_event_op,
-                                       guest_handle_cast(u_domctl, void));
-            rcu_unlock_domain(d);
-            copyback = 1;
-        } 
+        ret = xsm_mem_event(d);
+        if ( !ret )
+            ret = mem_event_domctl(d, &domctl->u.mem_event_op,
+                                   guest_handle_cast(u_domctl, void));
+        copyback = 1;
     }
     break;
 
     case XEN_DOMCTL_mem_sharing_op:
     {
-        struct domain *d;
-
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_sharing(d);
-            if ( !ret )
-                ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_sharing(d);
+        if ( !ret )
+            ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
     }
     break;
 
 #if P2M_AUDIT
     case XEN_DOMCTL_audit_p2m:
     {
-        struct domain *d;
-
-        ret = rcu_lock_remote_target_domain_by_id(domctl->domain, &d);
-        if ( ret != 0 )
+        if ( d == current->domain )
+        {
+            ret = -EPERM;
             break;
+        }
 
         audit_p2m(d,
                   &domctl->u.audit_p2m.orphans,
                   &domctl->u.audit_p2m.m2p_bad,
                   &domctl->u.audit_p2m.p2m_bad);
-        rcu_unlock_domain(d);
         copyback = 1;
     }
     break;
@@ -1544,52 +1255,36 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_set_access_required:
     {
-        struct domain *d;
         struct p2m_domain* p2m;
         
         ret = -EPERM;
-        if ( current->domain->domain_id == domctl->domain )
+        if ( current->domain == d )
             break;
 
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            ret = xsm_mem_event(d);
-            if ( !ret ) {
-                p2m = p2m_get_hostp2m(d);
-                p2m->access_required = domctl->u.access_required.access_required;
-            }
-            rcu_unlock_domain(d);
-        } 
+        ret = xsm_mem_event(d);
+        if ( !ret ) {
+            p2m = p2m_get_hostp2m(d);
+            p2m->access_required = domctl->u.access_required.access_required;
+        }
     }
     break;
 
     case XEN_DOMCTL_set_broken_page_p2m:
     {
-        struct domain *d;
+        p2m_type_t pt;
+        unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
+        mfn_t mfn = get_gfn_query(d, pfn, &pt);
 
-        d = rcu_lock_domain_by_id(domctl->domain);
-        if ( d != NULL )
-        {
-            p2m_type_t pt;
-            unsigned long pfn = domctl->u.set_broken_page_p2m.pfn;
-            mfn_t mfn = get_gfn_query(d, pfn, &pt);
+        if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
+                     (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
+            ret = -EINVAL;
 
-            if ( unlikely(!mfn_valid(mfn_x(mfn)) || !p2m_is_ram(pt) ||
-                         (p2m_change_type(d, pfn, pt, p2m_ram_broken) != pt)) )
-                ret = -EINVAL;
-
-            put_gfn(d, pfn);
-            rcu_unlock_domain(d);
-        }
-        else
-            ret = -ESRCH;
+        put_gfn(d, pfn);
     }
     break;
 
     default:
-        ret = iommu_do_domctl(domctl, u_domctl);
+        ret = iommu_do_domctl(domctl, d, u_domctl);
         break;
     }
 
diff -r 5226a0c95760 -r b04de677de31 xen/common/domctl.c
--- a/xen/common/domctl.c	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/common/domctl.c	Tue Dec 18 18:16:52 2012 +0000
@@ -882,7 +882,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
     break;
 
     default:
-        ret = arch_do_domctl(op, u_domctl);
+        ret = arch_do_domctl(op, d, u_domctl);
         break;
     }
 
diff -r 5226a0c95760 -r b04de677de31 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/drivers/passthrough/iommu.c	Tue Dec 18 18:16:52 2012 +0000
@@ -542,10 +542,9 @@ void iommu_crash_shutdown(void)
 }
 
 int iommu_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
-    struct domain *d;
     u16 seg;
     u8 bus, devfn;
     int ret = 0;
@@ -564,10 +563,6 @@ int iommu_do_domctl(
         if ( ret )
             break;
 
-        ret = -EINVAL;
-        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
-            break;
-
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.get_device_group.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.get_device_group.machine_sbdf & 0xff;
@@ -588,7 +583,6 @@ int iommu_do_domctl(
         }
         if ( __copy_field_to_guest(u_domctl, domctl, u.get_device_group) )
             ret = -EFAULT;
-        rcu_unlock_domain(d);
     }
     break;
 
@@ -611,20 +605,15 @@ int iommu_do_domctl(
         break;
 
     case XEN_DOMCTL_assign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) ||
-             unlikely(d->is_dying) )
+        if ( unlikely(d->is_dying) )
         {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_assign_device: get_domain_by_id() failed\n");
             ret = -EINVAL;
-            if ( d )
-                goto assign_device_out;
             break;
         }
 
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto assign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -638,22 +627,12 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    assign_device_out:
-        put_domain(d);
         break;
 
     case XEN_DOMCTL_deassign_device:
-        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) )
-        {
-            printk(XENLOG_G_ERR
-                   "XEN_DOMCTL_deassign_device: get_domain_by_id() failed\n");
-            ret = -EINVAL;
-            break;
-        }
-
         ret = xsm_deassign_device(d, domctl->u.assign_device.machine_sbdf);
         if ( ret )
-            goto deassign_device_out;
+            break;
 
         seg = domctl->u.get_device_group.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
@@ -668,8 +647,6 @@ int iommu_do_domctl(
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    d->domain_id, ret);
 
-    deassign_device_out:
-        put_domain(d);
         break;
 
     default:
diff -r 5226a0c95760 -r b04de677de31 xen/include/xen/hypercall.h
--- a/xen/include/xen/hypercall.h	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/include/xen/hypercall.h	Tue Dec 18 18:16:52 2012 +0000
@@ -37,7 +37,7 @@ do_domctl(
 
 extern long
 arch_do_domctl(
-    struct xen_domctl *domctl,
+    struct xen_domctl *domctl, struct domain *d,
     XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
 
 extern long
diff -r 5226a0c95760 -r b04de677de31 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h	Tue Dec 18 18:16:13 2012 +0000
+++ b/xen/include/xen/iommu.h	Tue Dec 18 18:16:52 2012 +0000
@@ -132,7 +132,8 @@ void iommu_crash_shutdown(void);
 void iommu_set_dom0_mapping(struct domain *d);
 void iommu_share_p2m_table(struct domain *d);
 
-int iommu_do_domctl(struct xen_domctl *, XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
+int iommu_do_domctl(struct xen_domctl *, struct domain *d,
+                    XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
 void iommu_iotlb_flush(struct domain *d, unsigned long gfn, unsigned int page_count);
 void iommu_iotlb_flush_all(struct domain *d);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:56:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:56:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMwP-000402-25; Wed, 19 Dec 2012 16:56:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMwM-0003zv-Q7
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:56:19 +0000
Received: from [85.158.143.35:23459] by server-3.bemta-4.messagelabs.com id
	25/C9-18211-2B1F1D05; Wed, 19 Dec 2012 16:56:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1355936118!16177577!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24577 invoked from network); 19 Dec 2012 16:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvN-0007kW-Tu
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvN-0004ho-Hw
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:17 +0000
Message-Id: <E1TlMvN-0004ho-Hw@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched_credit: improve tickling
	of idle CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1355854257 0
# Node ID 5cc77f70f048d63990ef2827e0383b688ec08cc5
# Parent  127c2c47d440eb7f3248ab5561909e326af7e328
xen: sched_credit: improve tickling of idle CPUs

Right now, when a VCPU wakes-up, we check whether it should preempt
what is running on the PCPU, and whether or not the waking VCPU can
be migrated (by tickling some idlers). However, this can result in
suboptimal or even wrong behaviour, as explained here:

 http://lists.xen.org/archives/html/xen-devel/2012-10/msg01732.html

This change, instead, when deciding which PCPU(s) to tickle, upon
VCPU wake-up, considers both what it is likely to happen on the PCPU
where the wakeup occurs,and whether or not there are idlers where
the woken-up VCPU can run. In fact, if there are, we can avoid
interrupting the running VCPU. Only in case there aren't any of
these PCPUs, preemption and migration are the way to go.

This has been tested (on top of the previous change) by running
the following benchmarks inside 2, 6 and 10 VMs, concurrently, on
a shared host, each with 2 VCPUs and 960 MB of memory (host had 16
ways and 12 GB RAM).

1) All VMs had 'cpus="all"' in their config file.

$ sysbench --test=cpu ... (time, lower is better)
 | VMs | w/o this change         | w/ this change          |
 | 2   | 50.078467 +/- 1.6676162 | 49.673667 +/- 0.0094321 |
 | 6   | 63.259472 +/- 0.1137586 | 61.680011 +/- 1.0208723 |
 | 10  | 91.246797 +/- 0.1154008 | 90.396720 +/- 1.5900423 |
$ sysbench --test=memory ... (throughput, higher is better)
 | VMs | w/o this change         | w/ this change          |
 | 2   | 485.56333 +/- 6.0527356 | 487.83167 +/- 0.7602850 |
 | 6   | 401.36278 +/- 1.9745916 | 409.96778 +/- 3.6761092 |
 | 10  | 294.43933 +/- 0.8064945 | 302.49033 +/- 0.2343978 |
$ specjbb2005 ... (throughput, higher is better)
 | VMs | w/o this change         | w/ this change          |
 | 2   | 43150.63 +/- 1359.5616  | 43275.427 +/- 606.28185 |
 | 6   | 29274.29 +/- 1024.4042  | 29716.189 +/- 1290.1878 |
 | 10  | 19061.28 +/- 512.88561  | 19192.599 +/- 605.66058 |

2) All VMs had their VCPUs statically pinned to the host's PCPUs.

$ sysbench --test=cpu ... (time, lower is better)
 | VMs | w/o this change         | w/ this change          |
 | 2   | 47.8211   +/- 0.0215504 | 47.826900 +/- 0.0077872 |
 | 6   | 62.689122 +/- 0.0877173 | 62.764539 +/- 0.3882493 |
 | 10  | 90.321097 +/- 1.4803867 | 89.974570 +/- 1.1437566 |
$ sysbench --test=memory ... (throughput, higher is better)
 | VMs | w/o this change         | w/ this change          |
 | 2   | 550.97667 +/- 2.3512355 | 550.87000 +/- 0.8140792 |
 | 6   | 443.15000 +/- 5.7471797 | 454.01056 +/- 8.4373466 |
 | 10  | 313.89233 +/- 1.3237493 | 321.81167 +/- 0.3528418 |
$ specjbb2005 ... (throughput, higher is better)
 | 2   | 49591.057 +/- 952.93384 | 49594.195 +/- 799.57976 |
 | 6   | 33538.247 +/- 1089.2115 | 33671.758 +/- 1077.6806 |
 | 10  | 21927.870 +/- 831.88742 | 21891.131 +/- 563.37929 |

Numbers show how the change has either no or very limited impact
(specjbb2005 case) or, when it does have some impact, that is a
real improvement in performances (sysbench-memory case).

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 127c2c47d440 -r 5cc77f70f048 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Dec 18 18:10:18 2012 +0000
+++ b/xen/common/sched_credit.c	Tue Dec 18 18:10:57 2012 +0000
@@ -134,6 +134,7 @@ struct csched_vcpu {
         uint32_t state_idle;
         uint32_t migrate_q;
         uint32_t migrate_r;
+        uint32_t kicked_away;
     } stats;
 #endif
 };
@@ -251,54 +252,67 @@ __runq_tickle(unsigned int cpu, struct c
 {
     struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
-    cpumask_t mask;
+    cpumask_t mask, idle_mask;
+    int idlers_empty;
 
     ASSERT(cur);
     cpumask_clear(&mask);
 
-    /* If strictly higher priority than current VCPU, signal the CPU */
-    if ( new->pri > cur->pri )
+    idlers_empty = cpumask_empty(prv->idlers);
+
+    /*
+     * If the pcpu is idle, or there are no idlers and the new
+     * vcpu is a higher priority than the old vcpu, run it here.
+     *
+     * If there are idle cpus, first try to find one suitable to run
+     * new, so we can avoid preempting cur.  If we cannot find a
+     * suitable idler on which to run new, run it here, but try to
+     * find a suitable idler on which to run cur instead.
+     */
+    if ( cur->pri == CSCHED_PRI_IDLE
+         || (idlers_empty && new->pri > cur->pri) )
     {
-        if ( cur->pri == CSCHED_PRI_IDLE )
-            SCHED_STAT_CRANK(tickle_local_idler);
-        else if ( cur->pri == CSCHED_PRI_TS_OVER )
-            SCHED_STAT_CRANK(tickle_local_over);
-        else if ( cur->pri == CSCHED_PRI_TS_UNDER )
-            SCHED_STAT_CRANK(tickle_local_under);
-        else
-            SCHED_STAT_CRANK(tickle_local_other);
-
+        if ( cur->pri != CSCHED_PRI_IDLE )
+            SCHED_STAT_CRANK(tickle_idlers_none);
         cpumask_set_cpu(cpu, &mask);
     }
+    else if ( !idlers_empty )
+    {
+        /* Check whether or not there are idlers that can run new */
+        cpumask_and(&idle_mask, prv->idlers, new->vcpu->cpu_affinity);
 
-    /*
-     * If this CPU has at least two runnable VCPUs, we tickle any idlers to
-     * let them know there is runnable work in the system...
-     */
-    if ( cur->pri > CSCHED_PRI_IDLE )
-    {
-        if ( cpumask_empty(prv->idlers) )
+        /*
+         * If there are no suitable idlers for new, and it's higher
+         * priority than cur, ask the scheduler to migrate cur away.
+         * We have to act like this (instead of just waking some of
+         * the idlers suitable for cur) because cur is running.
+         *
+         * If there are suitable idlers for new, no matter priorities,
+         * leave cur alone (as it is running and is, likely, cache-hot)
+         * and wake some of them (which is waking up and so is, likely,
+         * cache cold anyway).
+         */
+        if ( cpumask_empty(&idle_mask) && new->pri > cur->pri )
         {
             SCHED_STAT_CRANK(tickle_idlers_none);
+            SCHED_VCPU_STAT_CRANK(cur, kicked_away);
+            SCHED_VCPU_STAT_CRANK(cur, migrate_r);
+            SCHED_STAT_CRANK(migrate_kicked_away);
+            set_bit(_VPF_migrating, &cur->vcpu->pause_flags);
+            cpumask_set_cpu(cpu, &mask);
         }
-        else
+        else if ( !cpumask_empty(&idle_mask) )
         {
-            cpumask_t idle_mask;
-
-            cpumask_and(&idle_mask, prv->idlers, new->vcpu->cpu_affinity);
-            if ( !cpumask_empty(&idle_mask) )
+            /* Which of the idlers suitable for new shall we wake up? */
+            SCHED_STAT_CRANK(tickle_idlers_some);
+            if ( opt_tickle_one_idle )
             {
-                SCHED_STAT_CRANK(tickle_idlers_some);
-                if ( opt_tickle_one_idle )
-                {
-                    this_cpu(last_tickle_cpu) = 
-                        cpumask_cycle(this_cpu(last_tickle_cpu), &idle_mask);
-                    cpumask_set_cpu(this_cpu(last_tickle_cpu), &mask);
-                }
-                else
-                    cpumask_or(&mask, &mask, &idle_mask);
+                this_cpu(last_tickle_cpu) =
+                    cpumask_cycle(this_cpu(last_tickle_cpu), &idle_mask);
+                cpumask_set_cpu(this_cpu(last_tickle_cpu), &mask);
             }
-            cpumask_and(&mask, &mask, new->vcpu->cpu_affinity);
+            else
+                cpumask_or(&mask, &mask, &idle_mask);
         }
     }
 
@@ -1456,13 +1470,14 @@ csched_dump_vcpu(struct csched_vcpu *svc
     {
         printk(" credit=%i [w=%u]", atomic_read(&svc->credit), sdom->weight);
 #ifdef CSCHED_STATS
-        printk(" (%d+%u) {a/i=%u/%u m=%u+%u}",
+        printk(" (%d+%u) {a/i=%u/%u m=%u+%u (k=%u)}",
                 svc->stats.credit_last,
                 svc->stats.credit_incr,
                 svc->stats.state_active,
                 svc->stats.state_idle,
                 svc->stats.migrate_q,
-                svc->stats.migrate_r);
+                svc->stats.migrate_r,
+                svc->stats.kicked_away);
 #endif
     }
 
diff -r 127c2c47d440 -r 5cc77f70f048 xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h	Tue Dec 18 18:10:18 2012 +0000
+++ b/xen/include/xen/perfc_defn.h	Tue Dec 18 18:10:57 2012 +0000
@@ -39,10 +39,6 @@ PERFCOUNTER(vcpu_wake_runnable,     "csc
 PERFCOUNTER(vcpu_wake_not_runnable, "csched: vcpu_wake_not_runnable")
 PERFCOUNTER(vcpu_park,              "csched: vcpu_park")
 PERFCOUNTER(vcpu_unpark,            "csched: vcpu_unpark")
-PERFCOUNTER(tickle_local_idler,     "csched: tickle_local_idler")
-PERFCOUNTER(tickle_local_over,      "csched: tickle_local_over")
-PERFCOUNTER(tickle_local_under,     "csched: tickle_local_under")
-PERFCOUNTER(tickle_local_other,     "csched: tickle_local_other")
 PERFCOUNTER(tickle_idlers_none,     "csched: tickle_idlers_none")
 PERFCOUNTER(tickle_idlers_some,     "csched: tickle_idlers_some")
 PERFCOUNTER(load_balance_idle,      "csched: load_balance_idle")
@@ -52,6 +48,7 @@ PERFCOUNTER(steal_trylock_failed,   "csc
 PERFCOUNTER(steal_peer_idle,        "csched: steal_peer_idle")
 PERFCOUNTER(migrate_queued,         "csched: migrate_queued")
 PERFCOUNTER(migrate_running,        "csched: migrate_running")
+PERFCOUNTER(migrate_kicked_away,    "csched: migrate_kicked_away")
 PERFCOUNTER(vcpu_hot,               "csched: vcpu_hot")
 
 PERFCOUNTER(need_flush_tlb_flush,   "PG_need_flush tlb flushes")

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:56:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:56:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMwP-000402-25; Wed, 19 Dec 2012 16:56:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMwM-0003zv-Q7
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:56:19 +0000
Received: from [85.158.143.35:23459] by server-3.bemta-4.messagelabs.com id
	25/C9-18211-2B1F1D05; Wed, 19 Dec 2012 16:56:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1355936118!16177577!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24577 invoked from network); 19 Dec 2012 16:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvN-0007kW-Tu
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvN-0004ho-Hw
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:17 +0000
Message-Id: <E1TlMvN-0004ho-Hw@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: sched_credit: improve tickling
	of idle CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1355854257 0
# Node ID 5cc77f70f048d63990ef2827e0383b688ec08cc5
# Parent  127c2c47d440eb7f3248ab5561909e326af7e328
xen: sched_credit: improve tickling of idle CPUs

Right now, when a VCPU wakes-up, we check whether it should preempt
what is running on the PCPU, and whether or not the waking VCPU can
be migrated (by tickling some idlers). However, this can result in
suboptimal or even wrong behaviour, as explained here:

 http://lists.xen.org/archives/html/xen-devel/2012-10/msg01732.html

This change, instead, when deciding which PCPU(s) to tickle, upon
VCPU wake-up, considers both what it is likely to happen on the PCPU
where the wakeup occurs,and whether or not there are idlers where
the woken-up VCPU can run. In fact, if there are, we can avoid
interrupting the running VCPU. Only in case there aren't any of
these PCPUs, preemption and migration are the way to go.

This has been tested (on top of the previous change) by running
the following benchmarks inside 2, 6 and 10 VMs, concurrently, on
a shared host, each with 2 VCPUs and 960 MB of memory (host had 16
ways and 12 GB RAM).

1) All VMs had 'cpus="all"' in their config file.

$ sysbench --test=cpu ... (time, lower is better)
 | VMs | w/o this change         | w/ this change          |
 | 2   | 50.078467 +/- 1.6676162 | 49.673667 +/- 0.0094321 |
 | 6   | 63.259472 +/- 0.1137586 | 61.680011 +/- 1.0208723 |
 | 10  | 91.246797 +/- 0.1154008 | 90.396720 +/- 1.5900423 |
$ sysbench --test=memory ... (throughput, higher is better)
 | VMs | w/o this change         | w/ this change          |
 | 2   | 485.56333 +/- 6.0527356 | 487.83167 +/- 0.7602850 |
 | 6   | 401.36278 +/- 1.9745916 | 409.96778 +/- 3.6761092 |
 | 10  | 294.43933 +/- 0.8064945 | 302.49033 +/- 0.2343978 |
$ specjbb2005 ... (throughput, higher is better)
 | VMs | w/o this change         | w/ this change          |
 | 2   | 43150.63 +/- 1359.5616  | 43275.427 +/- 606.28185 |
 | 6   | 29274.29 +/- 1024.4042  | 29716.189 +/- 1290.1878 |
 | 10  | 19061.28 +/- 512.88561  | 19192.599 +/- 605.66058 |

2) All VMs had their VCPUs statically pinned to the host's PCPUs.

$ sysbench --test=cpu ... (time, lower is better)
 | VMs | w/o this change         | w/ this change          |
 | 2   | 47.8211   +/- 0.0215504 | 47.826900 +/- 0.0077872 |
 | 6   | 62.689122 +/- 0.0877173 | 62.764539 +/- 0.3882493 |
 | 10  | 90.321097 +/- 1.4803867 | 89.974570 +/- 1.1437566 |
$ sysbench --test=memory ... (throughput, higher is better)
 | VMs | w/o this change         | w/ this change          |
 | 2   | 550.97667 +/- 2.3512355 | 550.87000 +/- 0.8140792 |
 | 6   | 443.15000 +/- 5.7471797 | 454.01056 +/- 8.4373466 |
 | 10  | 313.89233 +/- 1.3237493 | 321.81167 +/- 0.3528418 |
$ specjbb2005 ... (throughput, higher is better)
 | 2   | 49591.057 +/- 952.93384 | 49594.195 +/- 799.57976 |
 | 6   | 33538.247 +/- 1089.2115 | 33671.758 +/- 1077.6806 |
 | 10  | 21927.870 +/- 831.88742 | 21891.131 +/- 563.37929 |

Numbers show how the change has either no or very limited impact
(specjbb2005 case) or, when it does have some impact, that is a
real improvement in performances (sysbench-memory case).

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 127c2c47d440 -r 5cc77f70f048 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue Dec 18 18:10:18 2012 +0000
+++ b/xen/common/sched_credit.c	Tue Dec 18 18:10:57 2012 +0000
@@ -134,6 +134,7 @@ struct csched_vcpu {
         uint32_t state_idle;
         uint32_t migrate_q;
         uint32_t migrate_r;
+        uint32_t kicked_away;
     } stats;
 #endif
 };
@@ -251,54 +252,67 @@ __runq_tickle(unsigned int cpu, struct c
 {
     struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
-    cpumask_t mask;
+    cpumask_t mask, idle_mask;
+    int idlers_empty;
 
     ASSERT(cur);
     cpumask_clear(&mask);
 
-    /* If strictly higher priority than current VCPU, signal the CPU */
-    if ( new->pri > cur->pri )
+    idlers_empty = cpumask_empty(prv->idlers);
+
+    /*
+     * If the pcpu is idle, or there are no idlers and the new
+     * vcpu is a higher priority than the old vcpu, run it here.
+     *
+     * If there are idle cpus, first try to find one suitable to run
+     * new, so we can avoid preempting cur.  If we cannot find a
+     * suitable idler on which to run new, run it here, but try to
+     * find a suitable idler on which to run cur instead.
+     */
+    if ( cur->pri == CSCHED_PRI_IDLE
+         || (idlers_empty && new->pri > cur->pri) )
     {
-        if ( cur->pri == CSCHED_PRI_IDLE )
-            SCHED_STAT_CRANK(tickle_local_idler);
-        else if ( cur->pri == CSCHED_PRI_TS_OVER )
-            SCHED_STAT_CRANK(tickle_local_over);
-        else if ( cur->pri == CSCHED_PRI_TS_UNDER )
-            SCHED_STAT_CRANK(tickle_local_under);
-        else
-            SCHED_STAT_CRANK(tickle_local_other);
-
+        if ( cur->pri != CSCHED_PRI_IDLE )
+            SCHED_STAT_CRANK(tickle_idlers_none);
         cpumask_set_cpu(cpu, &mask);
     }
+    else if ( !idlers_empty )
+    {
+        /* Check whether or not there are idlers that can run new */
+        cpumask_and(&idle_mask, prv->idlers, new->vcpu->cpu_affinity);
 
-    /*
-     * If this CPU has at least two runnable VCPUs, we tickle any idlers to
-     * let them know there is runnable work in the system...
-     */
-    if ( cur->pri > CSCHED_PRI_IDLE )
-    {
-        if ( cpumask_empty(prv->idlers) )
+        /*
+         * If there are no suitable idlers for new, and it's higher
+         * priority than cur, ask the scheduler to migrate cur away.
+         * We have to act like this (instead of just waking some of
+         * the idlers suitable for cur) because cur is running.
+         *
+         * If there are suitable idlers for new, no matter priorities,
+         * leave cur alone (as it is running and is, likely, cache-hot)
+         * and wake some of them (which is waking up and so is, likely,
+         * cache cold anyway).
+         */
+        if ( cpumask_empty(&idle_mask) && new->pri > cur->pri )
         {
             SCHED_STAT_CRANK(tickle_idlers_none);
+            SCHED_VCPU_STAT_CRANK(cur, kicked_away);
+            SCHED_VCPU_STAT_CRANK(cur, migrate_r);
+            SCHED_STAT_CRANK(migrate_kicked_away);
+            set_bit(_VPF_migrating, &cur->vcpu->pause_flags);
+            cpumask_set_cpu(cpu, &mask);
         }
-        else
+        else if ( !cpumask_empty(&idle_mask) )
         {
-            cpumask_t idle_mask;
-
-            cpumask_and(&idle_mask, prv->idlers, new->vcpu->cpu_affinity);
-            if ( !cpumask_empty(&idle_mask) )
+            /* Which of the idlers suitable for new shall we wake up? */
+            SCHED_STAT_CRANK(tickle_idlers_some);
+            if ( opt_tickle_one_idle )
             {
-                SCHED_STAT_CRANK(tickle_idlers_some);
-                if ( opt_tickle_one_idle )
-                {
-                    this_cpu(last_tickle_cpu) = 
-                        cpumask_cycle(this_cpu(last_tickle_cpu), &idle_mask);
-                    cpumask_set_cpu(this_cpu(last_tickle_cpu), &mask);
-                }
-                else
-                    cpumask_or(&mask, &mask, &idle_mask);
+                this_cpu(last_tickle_cpu) =
+                    cpumask_cycle(this_cpu(last_tickle_cpu), &idle_mask);
+                cpumask_set_cpu(this_cpu(last_tickle_cpu), &mask);
             }
-            cpumask_and(&mask, &mask, new->vcpu->cpu_affinity);
+            else
+                cpumask_or(&mask, &mask, &idle_mask);
         }
     }
 
@@ -1456,13 +1470,14 @@ csched_dump_vcpu(struct csched_vcpu *svc
     {
         printk(" credit=%i [w=%u]", atomic_read(&svc->credit), sdom->weight);
 #ifdef CSCHED_STATS
-        printk(" (%d+%u) {a/i=%u/%u m=%u+%u}",
+        printk(" (%d+%u) {a/i=%u/%u m=%u+%u (k=%u)}",
                 svc->stats.credit_last,
                 svc->stats.credit_incr,
                 svc->stats.state_active,
                 svc->stats.state_idle,
                 svc->stats.migrate_q,
-                svc->stats.migrate_r);
+                svc->stats.migrate_r,
+                svc->stats.kicked_away);
 #endif
     }
 
diff -r 127c2c47d440 -r 5cc77f70f048 xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h	Tue Dec 18 18:10:18 2012 +0000
+++ b/xen/include/xen/perfc_defn.h	Tue Dec 18 18:10:57 2012 +0000
@@ -39,10 +39,6 @@ PERFCOUNTER(vcpu_wake_runnable,     "csc
 PERFCOUNTER(vcpu_wake_not_runnable, "csched: vcpu_wake_not_runnable")
 PERFCOUNTER(vcpu_park,              "csched: vcpu_park")
 PERFCOUNTER(vcpu_unpark,            "csched: vcpu_unpark")
-PERFCOUNTER(tickle_local_idler,     "csched: tickle_local_idler")
-PERFCOUNTER(tickle_local_over,      "csched: tickle_local_over")
-PERFCOUNTER(tickle_local_under,     "csched: tickle_local_under")
-PERFCOUNTER(tickle_local_other,     "csched: tickle_local_other")
 PERFCOUNTER(tickle_idlers_none,     "csched: tickle_idlers_none")
 PERFCOUNTER(tickle_idlers_some,     "csched: tickle_idlers_some")
 PERFCOUNTER(load_balance_idle,      "csched: load_balance_idle")
@@ -52,6 +48,7 @@ PERFCOUNTER(steal_trylock_failed,   "csc
 PERFCOUNTER(steal_peer_idle,        "csched: steal_peer_idle")
 PERFCOUNTER(migrate_queued,         "csched: migrate_queued")
 PERFCOUNTER(migrate_running,        "csched: migrate_running")
+PERFCOUNTER(migrate_kicked_away,    "csched: migrate_kicked_away")
 PERFCOUNTER(vcpu_hot,               "csched: vcpu_hot")
 
 PERFCOUNTER(need_flush_tlb_flush,   "PG_need_flush tlb flushes")

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:56:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:56:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMwa-00041N-53; Wed, 19 Dec 2012 16:56:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMwY-000412-2l
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:56:30 +0000
Received: from [85.158.138.51:19831] by server-5.bemta-3.messagelabs.com id
	0F/76-15136-DB1F1D05; Wed, 19 Dec 2012 16:56:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1355936118!10971874!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17697 invoked from network); 19 Dec 2012 16:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvO-0007l1-Kw
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvO-0004i3-DG
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:18 +0000
Message-Id: <E1TlMvO-0004i3-DG@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: tracing: introduce
	per-scheduler trace event IDs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1355854293 0
# Node ID c15b2aa0571faa564cd213f18f79de65166d1615
# Parent  5cc77f70f048d63990ef2827e0383b688ec08cc5
xen: tracing: introduce per-scheduler trace event IDs

So that it becomes possible to create scheduler specific trace
records, within each scheduler, without worrying about the
overlapping, and also without giving up being able to recognise them
univocally. The latter is deemed as useful, since we can have more
than one scheduler running at the same time, thanks to cpupools.

The event ID is 12 bits, and this change uses the upper 3 of them for
the 'scheduler ID'. This means we're limited to 8 schedulers and to
512 scheduler specific tracing events. Both seem reasonable
limitations as of now.

This also converts the existing credit2 tracing (the only scheduler
generating tracing events up to now) to the new system.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 5cc77f70f048 -r c15b2aa0571f xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Tue Dec 18 18:10:57 2012 +0000
+++ b/xen/common/sched_credit2.c	Tue Dec 18 18:11:33 2012 +0000
@@ -29,18 +29,22 @@
 #define d2printk(x...)
 //#define d2printk printk
 
-#define TRC_CSCHED2_TICK        TRC_SCHED_CLASS + 1
-#define TRC_CSCHED2_RUNQ_POS    TRC_SCHED_CLASS + 2
-#define TRC_CSCHED2_CREDIT_BURN TRC_SCHED_CLASS + 3
-#define TRC_CSCHED2_CREDIT_ADD  TRC_SCHED_CLASS + 4
-#define TRC_CSCHED2_TICKLE_CHECK TRC_SCHED_CLASS + 5
-#define TRC_CSCHED2_TICKLE       TRC_SCHED_CLASS + 6
-#define TRC_CSCHED2_CREDIT_RESET TRC_SCHED_CLASS + 7
-#define TRC_CSCHED2_SCHED_TASKLET TRC_SCHED_CLASS + 8
-#define TRC_CSCHED2_UPDATE_LOAD   TRC_SCHED_CLASS + 9
-#define TRC_CSCHED2_RUNQ_ASSIGN   TRC_SCHED_CLASS + 10
-#define TRC_CSCHED2_UPDATE_VCPU_LOAD   TRC_SCHED_CLASS + 11
-#define TRC_CSCHED2_UPDATE_RUNQ_LOAD   TRC_SCHED_CLASS + 12
+/*
+ * Credit2 tracing events ("only" 512 available!). Check
+ * include/public/trace.h for more details.
+ */
+#define TRC_CSCHED2_TICK             TRC_SCHED_CLASS_EVT(CSCHED2, 1)
+#define TRC_CSCHED2_RUNQ_POS         TRC_SCHED_CLASS_EVT(CSCHED2, 2)
+#define TRC_CSCHED2_CREDIT_BURN      TRC_SCHED_CLASS_EVT(CSCHED2, 3)
+#define TRC_CSCHED2_CREDIT_ADD       TRC_SCHED_CLASS_EVT(CSCHED2, 4)
+#define TRC_CSCHED2_TICKLE_CHECK     TRC_SCHED_CLASS_EVT(CSCHED2, 5)
+#define TRC_CSCHED2_TICKLE           TRC_SCHED_CLASS_EVT(CSCHED2, 6)
+#define TRC_CSCHED2_CREDIT_RESET     TRC_SCHED_CLASS_EVT(CSCHED2, 7)
+#define TRC_CSCHED2_SCHED_TASKLET    TRC_SCHED_CLASS_EVT(CSCHED2, 8)
+#define TRC_CSCHED2_UPDATE_LOAD      TRC_SCHED_CLASS_EVT(CSCHED2, 9)
+#define TRC_CSCHED2_RUNQ_ASSIGN      TRC_SCHED_CLASS_EVT(CSCHED2, 10)
+#define TRC_CSCHED2_UPDATE_VCPU_LOAD TRC_SCHED_CLASS_EVT(CSCHED2, 11)
+#define TRC_CSCHED2_UPDATE_RUNQ_LOAD TRC_SCHED_CLASS_EVT(CSCHED2, 12)
 
 /*
  * WARNING: This is still in an experimental phase.  Status and work can be found at the
diff -r 5cc77f70f048 -r c15b2aa0571f xen/include/public/trace.h
--- a/xen/include/public/trace.h	Tue Dec 18 18:10:57 2012 +0000
+++ b/xen/include/public/trace.h	Tue Dec 18 18:11:33 2012 +0000
@@ -57,6 +57,32 @@
 #define TRC_SCHED_CLASS     0x00022000   /* Scheduler-specific    */
 #define TRC_SCHED_VERBOSE   0x00028000   /* More inclusive scheduling */
 
+/*
+ * The highest 3 bits of the last 12 bits of TRC_SCHED_CLASS above are
+ * reserved for encoding what scheduler produced the information. The
+ * actual event is encoded in the last 9 bits.
+ *
+ * This means we have 8 scheduling IDs available (which means at most 8
+ * schedulers generating events) and, in each scheduler, up to 512
+ * different events.
+ */
+#define TRC_SCHED_ID_BITS 3
+#define TRC_SCHED_ID_SHIFT (TRC_SUBCLS_SHIFT - TRC_SCHED_ID_BITS)
+#define TRC_SCHED_ID_MASK (((1UL<<TRC_SCHED_ID_BITS) - 1) << TRC_SCHED_ID_SHIFT)
+#define TRC_SCHED_EVT_MASK (~(TRC_SCHED_ID_MASK))
+
+/* Per-scheduler IDs, to identify scheduler specific events */
+#define TRC_SCHED_CSCHED   0
+#define TRC_SCHED_CSCHED2  1
+#define TRC_SCHED_SEDF     2
+#define TRC_SCHED_ARINC653 3
+
+/* Per-scheduler tracing */
+#define TRC_SCHED_CLASS_EVT(_c, _e) \
+  ( ( TRC_SCHED_CLASS | \
+      ((TRC_SCHED_##_c << TRC_SCHED_ID_SHIFT) & TRC_SCHED_ID_MASK) ) + \
+    (_e & TRC_SCHED_EVT_MASK) )
+
 /* Trace classes for Hardware */
 #define TRC_HW_PM           0x00801000   /* Power management traces */
 #define TRC_HW_IRQ          0x00802000   /* Traces relating to the handling of IRQs */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Dec 19 16:56:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 19 Dec 2012 16:56:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlMwa-00041N-53; Wed, 19 Dec 2012 16:56:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMwY-000412-2l
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:56:30 +0000
Received: from [85.158.138.51:19831] by server-5.bemta-3.messagelabs.com id
	0F/76-15136-DB1F1D05; Wed, 19 Dec 2012 16:56:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1355936118!10971874!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17697 invoked from network); 19 Dec 2012 16:55:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Dec 2012 16:55:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvO-0007l1-Kw
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlMvO-0004i3-DG
	for xen-changelog@lists.xensource.com; Wed, 19 Dec 2012 16:55:18 +0000
Message-Id: <E1TlMvO-0004i3-DG@xenbits.xen.org>
Date: Wed, 19 Dec 2012 16:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: tracing: introduce
	per-scheduler trace event IDs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dario Faggioli <dario.faggioli@citrix.com>
# Date 1355854293 0
# Node ID c15b2aa0571faa564cd213f18f79de65166d1615
# Parent  5cc77f70f048d63990ef2827e0383b688ec08cc5
xen: tracing: introduce per-scheduler trace event IDs

So that it becomes possible to create scheduler specific trace
records, within each scheduler, without worrying about the
overlapping, and also without giving up being able to recognise them
univocally. The latter is deemed as useful, since we can have more
than one scheduler running at the same time, thanks to cpupools.

The event ID is 12 bits, and this change uses the upper 3 of them for
the 'scheduler ID'. This means we're limited to 8 schedulers and to
512 scheduler specific tracing events. Both seem reasonable
limitations as of now.

This also converts the existing credit2 tracing (the only scheduler
generating tracing events up to now) to the new system.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 5cc77f70f048 -r c15b2aa0571f xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c	Tue Dec 18 18:10:57 2012 +0000
+++ b/xen/common/sched_credit2.c	Tue Dec 18 18:11:33 2012 +0000
@@ -29,18 +29,22 @@
 #define d2printk(x...)
 //#define d2printk printk
 
-#define TRC_CSCHED2_TICK        TRC_SCHED_CLASS + 1
-#define TRC_CSCHED2_RUNQ_POS    TRC_SCHED_CLASS + 2
-#define TRC_CSCHED2_CREDIT_BURN TRC_SCHED_CLASS + 3
-#define TRC_CSCHED2_CREDIT_ADD  TRC_SCHED_CLASS + 4
-#define TRC_CSCHED2_TICKLE_CHECK TRC_SCHED_CLASS + 5
-#define TRC_CSCHED2_TICKLE       TRC_SCHED_CLASS + 6
-#define TRC_CSCHED2_CREDIT_RESET TRC_SCHED_CLASS + 7
-#define TRC_CSCHED2_SCHED_TASKLET TRC_SCHED_CLASS + 8
-#define TRC_CSCHED2_UPDATE_LOAD   TRC_SCHED_CLASS + 9
-#define TRC_CSCHED2_RUNQ_ASSIGN   TRC_SCHED_CLASS + 10
-#define TRC_CSCHED2_UPDATE_VCPU_LOAD   TRC_SCHED_CLASS + 11
-#define TRC_CSCHED2_UPDATE_RUNQ_LOAD   TRC_SCHED_CLASS + 12
+/*
+ * Credit2 tracing events ("only" 512 available!). Check
+ * include/public/trace.h for more details.
+ */
+#define TRC_CSCHED2_TICK             TRC_SCHED_CLASS_EVT(CSCHED2, 1)
+#define TRC_CSCHED2_RUNQ_POS         TRC_SCHED_CLASS_EVT(CSCHED2, 2)
+#define TRC_CSCHED2_CREDIT_BURN      TRC_SCHED_CLASS_EVT(CSCHED2, 3)
+#define TRC_CSCHED2_CREDIT_ADD       TRC_SCHED_CLASS_EVT(CSCHED2, 4)
+#define TRC_CSCHED2_TICKLE_CHECK     TRC_SCHED_CLASS_EVT(CSCHED2, 5)
+#define TRC_CSCHED2_TICKLE           TRC_SCHED_CLASS_EVT(CSCHED2, 6)
+#define TRC_CSCHED2_CREDIT_RESET     TRC_SCHED_CLASS_EVT(CSCHED2, 7)
+#define TRC_CSCHED2_SCHED_TASKLET    TRC_SCHED_CLASS_EVT(CSCHED2, 8)
+#define TRC_CSCHED2_UPDATE_LOAD      TRC_SCHED_CLASS_EVT(CSCHED2, 9)
+#define TRC_CSCHED2_RUNQ_ASSIGN      TRC_SCHED_CLASS_EVT(CSCHED2, 10)
+#define TRC_CSCHED2_UPDATE_VCPU_LOAD TRC_SCHED_CLASS_EVT(CSCHED2, 11)
+#define TRC_CSCHED2_UPDATE_RUNQ_LOAD TRC_SCHED_CLASS_EVT(CSCHED2, 12)
 
 /*
  * WARNING: This is still in an experimental phase.  Status and work can be found at the
diff -r 5cc77f70f048 -r c15b2aa0571f xen/include/public/trace.h
--- a/xen/include/public/trace.h	Tue Dec 18 18:10:57 2012 +0000
+++ b/xen/include/public/trace.h	Tue Dec 18 18:11:33 2012 +0000
@@ -57,6 +57,32 @@
 #define TRC_SCHED_CLASS     0x00022000   /* Scheduler-specific    */
 #define TRC_SCHED_VERBOSE   0x00028000   /* More inclusive scheduling */
 
+/*
+ * The highest 3 bits of the last 12 bits of TRC_SCHED_CLASS above are
+ * reserved for encoding what scheduler produced the information. The
+ * actual event is encoded in the last 9 bits.
+ *
+ * This means we have 8 scheduling IDs available (which means at most 8
+ * schedulers generating events) and, in each scheduler, up to 512
+ * different events.
+ */
+#define TRC_SCHED_ID_BITS 3
+#define TRC_SCHED_ID_SHIFT (TRC_SUBCLS_SHIFT - TRC_SCHED_ID_BITS)
+#define TRC_SCHED_ID_MASK (((1UL<<TRC_SCHED_ID_BITS) - 1) << TRC_SCHED_ID_SHIFT)
+#define TRC_SCHED_EVT_MASK (~(TRC_SCHED_ID_MASK))
+
+/* Per-scheduler IDs, to identify scheduler specific events */
+#define TRC_SCHED_CSCHED   0
+#define TRC_SCHED_CSCHED2  1
+#define TRC_SCHED_SEDF     2
+#define TRC_SCHED_ARINC653 3
+
+/* Per-scheduler tracing */
+#define TRC_SCHED_CLASS_EVT(_c, _e) \
+  ( ( TRC_SCHED_CLASS | \
+      ((TRC_SCHED_##_c << TRC_SCHED_ID_SHIFT) & TRC_SCHED_ID_MASK) ) + \
+    (_e & TRC_SCHED_EVT_MASK) )
+
 /* Trace classes for Hardware */
 #define TRC_HW_PM           0x00801000   /* Power management traces */
 #define TRC_HW_IRQ          0x00802000   /* Traces relating to the handling of IRQs */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXon-0005wz-Is; Thu, 20 Dec 2012 04:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXom-0005wm-3X
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:12 +0000
Received: from [85.158.139.211:24290] by server-7.bemta-5.messagelabs.com id
	39/92-08009-70592D05; Thu, 20 Dec 2012 04:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1355977989!21296113!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25704 invoked from network); 20 Dec 2012 04:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoj-0005cp-8t
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoi-0005LQ-Ng
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:08 +0000
Message-Id: <E1TlXoi-0005LQ-Ng@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] update Xen version to 4.2.2-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355917906 -3600
# Node ID df2a3515788de458742ed205b073fc5a2c7a9cef
# Parent  11b4bc743b1f31a19a67cc4dbbb1678b875e2b86
update Xen version to 4.2.2-pre
---


diff -r 11b4bc743b1f -r df2a3515788d xen/Makefile
--- a/xen/Makefile	Mon Dec 17 14:59:11 2012 +0000
+++ b/xen/Makefile	Wed Dec 19 12:51:46 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXon-0005wz-Is; Thu, 20 Dec 2012 04:33:13 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXom-0005wm-3X
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:12 +0000
Received: from [85.158.139.211:24290] by server-7.bemta-5.messagelabs.com id
	39/92-08009-70592D05; Thu, 20 Dec 2012 04:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-206.messagelabs.com!1355977989!21296113!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25704 invoked from network); 20 Dec 2012 04:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoj-0005cp-8t
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoi-0005LQ-Ng
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:08 +0000
Message-Id: <E1TlXoi-0005LQ-Ng@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] update Xen version to 4.2.2-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355917906 -3600
# Node ID df2a3515788de458742ed205b073fc5a2c7a9cef
# Parent  11b4bc743b1f31a19a67cc4dbbb1678b875e2b86
update Xen version to 4.2.2-pre
---


diff -r 11b4bc743b1f -r df2a3515788d xen/Makefile
--- a/xen/Makefile	Mon Dec 17 14:59:11 2012 +0000
+++ b/xen/Makefile	Wed Dec 19 12:51:46 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXoo-0005xK-Lp; Thu, 20 Dec 2012 04:33:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXon-0005ws-3i
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:13 +0000
Received: from [85.158.139.83:6822] by server-8.bemta-5.messagelabs.com id
	74/DA-15003-80592D05; Thu, 20 Dec 2012 04:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1355977990!24349671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6970 invoked from network); 20 Dec 2012 04:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXok-0005cy-Bv
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoj-0005Lw-Vq
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:09 +0000
Message-Id: <E1TlXoj-0005Lw-Vq@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nested vmx: fix rflags status in
	virtual vmexit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Xiantao Zhang <xiantao.zhang@intel.com>
# Date 1355918077 -3600
# Node ID 0fb41420450f583e522a4bf22d3259c5fbd28943
# Parent  b533c473029ff99f0f130da758134acaec4f97d4
nested vmx: fix rflags status in virtual vmexit

As stated in SDM, all bits (except for those 1-reserved) in rflags
would be set to 0 in VM exit. Therefore we need to follow this logic
in virtual_vmexit.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26252:312f0713dfc9
xen-unstable date: Thu Dec  6 16:54:26 UTC 2012
---


diff -r b533c473029f -r 0fb41420450f xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:53:13 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:54:37 2012 +0100
@@ -990,7 +990,8 @@ static void virtual_vmexit(struct cpu_us
 
     regs->eip = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RIP);
     regs->esp = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RSP);
-    regs->eflags = __vmread(GUEST_RFLAGS);
+    /* VM exit clears all bits except bit 1 */
+    regs->eflags = 0x2;
 
     /* updating host cr0 to sync TS bit */
     __vmwrite(HOST_CR0, v->arch.hvm_vmx.host_cr0);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXoo-0005xK-Lp; Thu, 20 Dec 2012 04:33:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXon-0005ws-3i
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:13 +0000
Received: from [85.158.139.83:6822] by server-8.bemta-5.messagelabs.com id
	74/DA-15003-80592D05; Thu, 20 Dec 2012 04:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1355977990!24349671!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6970 invoked from network); 20 Dec 2012 04:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXok-0005cy-Bv
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoj-0005Lw-Vq
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:09 +0000
Message-Id: <E1TlXoj-0005Lw-Vq@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:09 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nested vmx: fix rflags status in
	virtual vmexit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Xiantao Zhang <xiantao.zhang@intel.com>
# Date 1355918077 -3600
# Node ID 0fb41420450f583e522a4bf22d3259c5fbd28943
# Parent  b533c473029ff99f0f130da758134acaec4f97d4
nested vmx: fix rflags status in virtual vmexit

As stated in SDM, all bits (except for those 1-reserved) in rflags
would be set to 0 in VM exit. Therefore we need to follow this logic
in virtual_vmexit.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26252:312f0713dfc9
xen-unstable date: Thu Dec  6 16:54:26 UTC 2012
---


diff -r b533c473029f -r 0fb41420450f xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:53:13 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:54:37 2012 +0100
@@ -990,7 +990,8 @@ static void virtual_vmexit(struct cpu_us
 
     regs->eip = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RIP);
     regs->esp = __get_vvmcs(nvcpu->nv_vvmcx, HOST_RSP);
-    regs->eflags = __vmread(GUEST_RFLAGS);
+    /* VM exit clears all bits except bit 1 */
+    regs->eflags = 0x2;
 
     /* updating host cr0 to sync TS bit */
     __vmwrite(HOST_CR0, v->arch.hvm_vmx.host_cr0);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXop-0005xd-Tc; Thu, 20 Dec 2012 04:33:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoo-0005wt-Ee
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:14 +0000
Received: from [85.158.143.35:40398] by server-2.bemta-4.messagelabs.com id
	9F/E6-30861-A0592D05; Thu, 20 Dec 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1355977992!16328433!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1001 invoked from network); 20 Dec 2012 04:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXom-0005dA-8e
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXom-0005Mu-6d
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:12 +0000
Message-Id: <E1TlXom-0005Mu-6d@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nested vmx: fix interrupt
	delivery to L2 guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Xiantao Zhang <xiantao.zhang@intel.com>
# Date 1355918287 -3600
# Node ID 5acb5967d718c9ff5a15ce7462b58036c8d3afc8
# Parent  907dcffd028495578a4b4ef4a3694b1c98920521
nested vmx: fix interrupt delivery to L2 guest

While delivering interrupt into L2 guest, L0 hypervisor need to check
whether L1 hypervisor wants to own the interrupt, if not, directly
inject the interrupt into L2 guest.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26258:90831c29bfde
xen-unstable date: Thu Dec  6 16:58:59 UTC 2012
---


diff -r 907dcffd0284 -r 5acb5967d718 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Wed Dec 19 12:57:18 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/intr.c	Wed Dec 19 12:58:07 2012 +0100
@@ -163,7 +163,7 @@ enum hvm_intblk nvmx_intr_blocked(struct
 
 static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
 {
-    u32 exit_ctrl;
+    u32 ctrl;
 
     if ( nvmx_intr_blocked(v) != hvm_intblk_none )
     {
@@ -176,11 +176,14 @@ static int nvmx_intr_intercept(struct vc
         if ( intack.source == hvm_intsrc_pic ||
                  intack.source == hvm_intsrc_lapic )
         {
+            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+            if ( !(ctrl & PIN_BASED_EXT_INTR_MASK) )
+                return 0;
+
             vmx_inject_extint(intack.vector);
 
-            exit_ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx,
-                            VM_EXIT_CONTROLS);
-            if ( exit_ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
+            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, VM_EXIT_CONTROLS);
+            if ( ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
             {
                 /* for now, duplicate the ack path in vmx_intr_assist */
                 hvm_vcpu_ack_pending_irq(v, intack);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXop-0005xd-Tc; Thu, 20 Dec 2012 04:33:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoo-0005wt-Ee
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:14 +0000
Received: from [85.158.143.35:40398] by server-2.bemta-4.messagelabs.com id
	9F/E6-30861-A0592D05; Thu, 20 Dec 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1355977992!16328433!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1001 invoked from network); 20 Dec 2012 04:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXom-0005dA-8e
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXom-0005Mu-6d
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:12 +0000
Message-Id: <E1TlXom-0005Mu-6d@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nested vmx: fix interrupt
	delivery to L2 guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Xiantao Zhang <xiantao.zhang@intel.com>
# Date 1355918287 -3600
# Node ID 5acb5967d718c9ff5a15ce7462b58036c8d3afc8
# Parent  907dcffd028495578a4b4ef4a3694b1c98920521
nested vmx: fix interrupt delivery to L2 guest

While delivering interrupt into L2 guest, L0 hypervisor need to check
whether L1 hypervisor wants to own the interrupt, if not, directly
inject the interrupt into L2 guest.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26258:90831c29bfde
xen-unstable date: Thu Dec  6 16:58:59 UTC 2012
---


diff -r 907dcffd0284 -r 5acb5967d718 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c	Wed Dec 19 12:57:18 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/intr.c	Wed Dec 19 12:58:07 2012 +0100
@@ -163,7 +163,7 @@ enum hvm_intblk nvmx_intr_blocked(struct
 
 static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
 {
-    u32 exit_ctrl;
+    u32 ctrl;
 
     if ( nvmx_intr_blocked(v) != hvm_intblk_none )
     {
@@ -176,11 +176,14 @@ static int nvmx_intr_intercept(struct vc
         if ( intack.source == hvm_intsrc_pic ||
                  intack.source == hvm_intsrc_lapic )
         {
+            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+            if ( !(ctrl & PIN_BASED_EXT_INTR_MASK) )
+                return 0;
+
             vmx_inject_extint(intack.vector);
 
-            exit_ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx,
-                            VM_EXIT_CONTROLS);
-            if ( exit_ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
+            ctrl = __get_vvmcs(vcpu_nestedhvm(v).nv_vvmcx, VM_EXIT_CONTROLS);
+            if ( ctrl & VM_EXIT_ACK_INTR_ON_EXIT )
             {
                 /* for now, duplicate the ack path in vmx_intr_assist */
                 hvm_vcpu_ack_pending_irq(v, intack);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXoo-0005xP-OC; Thu, 20 Dec 2012 04:33:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXon-0005wt-Da
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:13 +0000
Received: from [85.158.143.99:45768] by server-2.bemta-4.messagelabs.com id
	FD/E6-30861-80592D05; Thu, 20 Dec 2012 04:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1355977991!29230959!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17071 invoked from network); 20 Dec 2012 04:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXok-0005d1-Mf
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXok-0005MB-Hl
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:10 +0000
Message-Id: <E1TlXok-0005MB-Hl@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nested vmx: fix handling of RDTSC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1355918145 -3600
# Node ID b11d8dcf1da5abe11c6aa7ad62aa508a4e667349
# Parent  0fb41420450f583e522a4bf22d3259c5fbd28943
nested vmx: fix handling of RDTSC

If L0 is to handle the TSC access, then we need to update guest EIP by
calling update_guest_eip().

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26253:a09150b57ace
xen-unstable date: Thu Dec  6 16:56:21 UTC 2012
---


diff -r 0fb41420450f -r b11d8dcf1da5 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Dec 19 12:54:37 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Dec 19 12:55:45 2012 +0100
@@ -1595,7 +1595,7 @@ static int get_instruction_length(void)
     return len;
 }
 
-static void update_guest_eip(void)
+void update_guest_eip(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     unsigned long x;
diff -r 0fb41420450f -r b11d8dcf1da5 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:54:37 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:55:45 2012 +0100
@@ -1558,6 +1558,7 @@ int nvmx_n2_vmexit_handler(struct cpu_us
             tsc += __get_vvmcs(nvcpu->nv_vvmcx, TSC_OFFSET);
             regs->eax = (uint32_t)tsc;
             regs->edx = (uint32_t)(tsc >> 32);
+            update_guest_eip();
 
             return 1;
         }
diff -r 0fb41420450f -r b11d8dcf1da5 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Wed Dec 19 12:54:37 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Wed Dec 19 12:55:45 2012 +0100
@@ -394,6 +394,8 @@ void ept_p2m_init(struct p2m_domain *p2m
 void ept_walk_table(struct domain *d, unsigned long gfn);
 void setup_ept_dump(void);
 
+void update_guest_eip(void);
+
 /* EPT violation qualifications definitions */
 #define _EPT_READ_VIOLATION         0
 #define EPT_READ_VIOLATION          (1UL<<_EPT_READ_VIOLATION)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXoo-0005xP-OC; Thu, 20 Dec 2012 04:33:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXon-0005wt-Da
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:13 +0000
Received: from [85.158.143.99:45768] by server-2.bemta-4.messagelabs.com id
	FD/E6-30861-80592D05; Thu, 20 Dec 2012 04:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1355977991!29230959!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17071 invoked from network); 20 Dec 2012 04:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXok-0005d1-Mf
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXok-0005MB-Hl
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:10 +0000
Message-Id: <E1TlXok-0005MB-Hl@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nested vmx: fix handling of RDTSC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1355918145 -3600
# Node ID b11d8dcf1da5abe11c6aa7ad62aa508a4e667349
# Parent  0fb41420450f583e522a4bf22d3259c5fbd28943
nested vmx: fix handling of RDTSC

If L0 is to handle the TSC access, then we need to update guest EIP by
calling update_guest_eip().

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26253:a09150b57ace
xen-unstable date: Thu Dec  6 16:56:21 UTC 2012
---


diff -r 0fb41420450f -r b11d8dcf1da5 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Dec 19 12:54:37 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Dec 19 12:55:45 2012 +0100
@@ -1595,7 +1595,7 @@ static int get_instruction_length(void)
     return len;
 }
 
-static void update_guest_eip(void)
+void update_guest_eip(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     unsigned long x;
diff -r 0fb41420450f -r b11d8dcf1da5 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:54:37 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:55:45 2012 +0100
@@ -1558,6 +1558,7 @@ int nvmx_n2_vmexit_handler(struct cpu_us
             tsc += __get_vvmcs(nvcpu->nv_vvmcx, TSC_OFFSET);
             regs->eax = (uint32_t)tsc;
             regs->edx = (uint32_t)(tsc >> 32);
+            update_guest_eip();
 
             return 1;
         }
diff -r 0fb41420450f -r b11d8dcf1da5 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Wed Dec 19 12:54:37 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Wed Dec 19 12:55:45 2012 +0100
@@ -394,6 +394,8 @@ void ept_p2m_init(struct p2m_domain *p2m
 void ept_walk_table(struct domain *d, unsigned long gfn);
 void setup_ept_dump(void);
 
+void update_guest_eip(void);
+
 /* EPT violation qualifications definitions */
 #define _EPT_READ_VIOLATION         0
 #define EPT_READ_VIOLATION          (1UL<<_EPT_READ_VIOLATION)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXop-0005xY-Qu; Thu, 20 Dec 2012 04:33:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoo-0005wt-2L
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:14 +0000
Received: from [85.158.143.35:40393] by server-2.bemta-4.messagelabs.com id
	0F/E6-30861-90592D05; Thu, 20 Dec 2012 04:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1355977992!10243420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24564 invoked from network); 20 Dec 2012 04:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXol-0005d7-QO
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXol-0005Mf-Kz
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:11 +0000
Message-Id: <E1TlXol-0005Mf-Kz@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nested vmx: enable IA32E mode
	while do VM entry
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1355918238 -3600
# Node ID 907dcffd028495578a4b4ef4a3694b1c98920521
# Parent  44ec641fcbd5931270b22ef88e401c3621df8cb9
nested vmx: enable IA32E mode while do VM entry

Some VMMs may check the platform capability to judge whether long
mode guest is supported. Therefore we need to expose this bit to
guest VMM.

Xen on Xen works fine in current solution because Xen doesn't
check this capability but directly set it in VMCS if guest
supports long mode.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26255:1ed1507fa040
xen-unstable date: Thu Dec  6 16:57:26 UTC 2012
---


diff -r 44ec641fcbd5 -r 907dcffd0284 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:56:35 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:57:18 2012 +0100
@@ -1351,7 +1351,7 @@ int nvmx_msr_read_intercept(unsigned int
     case MSR_IA32_VMX_ENTRY_CTLS:
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
         data = 0x11ff;
-        data = (data << 32) | data;
+        data = ((data | VM_ENTRY_IA32E_MODE) << 32) | data;
         break;
 
     case IA32_FEATURE_CONTROL_MSR:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXop-0005xY-Qu; Thu, 20 Dec 2012 04:33:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoo-0005wt-2L
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:14 +0000
Received: from [85.158.143.35:40393] by server-2.bemta-4.messagelabs.com id
	0F/E6-30861-90592D05; Thu, 20 Dec 2012 04:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1355977992!10243420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24564 invoked from network); 20 Dec 2012 04:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXol-0005d7-QO
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXol-0005Mf-Kz
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:11 +0000
Message-Id: <E1TlXol-0005Mf-Kz@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:11 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nested vmx: enable IA32E mode
	while do VM entry
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1355918238 -3600
# Node ID 907dcffd028495578a4b4ef4a3694b1c98920521
# Parent  44ec641fcbd5931270b22ef88e401c3621df8cb9
nested vmx: enable IA32E mode while do VM entry

Some VMMs may check the platform capability to judge whether long
mode guest is supported. Therefore we need to expose this bit to
guest VMM.

Xen on Xen works fine in current solution because Xen doesn't
check this capability but directly set it in VMCS if guest
supports long mode.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26255:1ed1507fa040
xen-unstable date: Thu Dec  6 16:57:26 UTC 2012
---


diff -r 44ec641fcbd5 -r 907dcffd0284 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:56:35 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:57:18 2012 +0100
@@ -1351,7 +1351,7 @@ int nvmx_msr_read_intercept(unsigned int
     case MSR_IA32_VMX_ENTRY_CTLS:
         /* bit 0-8, and 12 must be 1 (refer G5 of SDM) */
         data = 0x11ff;
-        data = (data << 32) | data;
+        data = ((data | VM_ENTRY_IA32E_MODE) << 32) | data;
         break;
 
     case IA32_FEATURE_CONTROL_MSR:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXot-0005zI-03; Thu, 20 Dec 2012 04:33:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoq-0005xo-Tt
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:17 +0000
Received: from [85.158.143.35:40443] by server-3.bemta-4.messagelabs.com id
	D9/3B-18211-C0592D05; Thu, 20 Dec 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1355977990!12688730!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17534 invoked from network); 20 Dec 2012 04:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoj-0005cv-Ra
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoj-0005Lh-Bv
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:09 +0000
Message-Id: <E1TlXoj-0005Lh-Bv@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] IOMMU/ATS: fix maximum queue
	depth calculation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355917993 -3600
# Node ID b533c473029ff99f0f130da758134acaec4f97d4
# Parent  df2a3515788de458742ed205b073fc5a2c7a9cef
IOMMU/ATS: fix maximum queue depth calculation

The capabilities register field is a 5-bit value, and the 5 bits all
being zero actually means 32 entries.

Under the assumption that amd_iommu_flush_iotlb() really just tried
to correct for the miscalculation above when adding 32 to the value,
that adjustment is also being removed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset: 26235:670b07e8d738
xen-unstable date: Wed Dec  5 08:52:14 UTC 2012
---


diff -r df2a3515788d -r b533c473029f xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Wed Dec 19 12:51:46 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Wed Dec 19 12:53:13 2012 +0100
@@ -321,7 +321,7 @@ void amd_iommu_flush_iotlb(struct pci_de
 
     req_id = get_dma_requestor_id(iommu->seg, bdf);
     queueid = req_id;
-    maxpend = (ats_pdev->ats_queue_depth + 32) & 0xff;
+    maxpend = ats_pdev->ats_queue_depth & 0xff;
 
     /* send INVALIDATE_IOTLB_PAGES command */
     spin_lock_irqsave(&iommu->lock, flags);
diff -r df2a3515788d -r b533c473029f xen/drivers/passthrough/ats.h
--- a/xen/drivers/passthrough/ats.h	Wed Dec 19 12:51:46 2012 +0100
+++ b/xen/drivers/passthrough/ats.h	Wed Dec 19 12:53:13 2012 +0100
@@ -30,7 +30,7 @@ struct pci_ats_dev {
 
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
-#define ATS_QUEUE_DEPTH_MASK     0xF
+#define ATS_QUEUE_DEPTH_MASK     0x1f
 #define ATS_ENABLE               (1<<15)
 
 extern struct list_head ats_devices;
diff -r df2a3515788d -r b533c473029f xen/drivers/passthrough/x86/ats.c
--- a/xen/drivers/passthrough/x86/ats.c	Wed Dec 19 12:51:46 2012 +0100
+++ b/xen/drivers/passthrough/x86/ats.c	Wed Dec 19 12:53:13 2012 +0100
@@ -93,7 +93,8 @@ int enable_ats_device(int seg, int bus, 
         pdev->devfn = devfn;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
-        pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK;
+        pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
+                                ATS_QUEUE_DEPTH_MASK + 1;
         list_add(&pdev->list, &ats_devices);
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXot-0005zI-03; Thu, 20 Dec 2012 04:33:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoq-0005xo-Tt
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:17 +0000
Received: from [85.158.143.35:40443] by server-3.bemta-4.messagelabs.com id
	D9/3B-18211-C0592D05; Thu, 20 Dec 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1355977990!12688730!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17534 invoked from network); 20 Dec 2012 04:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:33:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoj-0005cv-Ra
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXoj-0005Lh-Bv
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:09 +0000
Message-Id: <E1TlXoj-0005Lh-Bv@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:08 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] IOMMU/ATS: fix maximum queue
	depth calculation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355917993 -3600
# Node ID b533c473029ff99f0f130da758134acaec4f97d4
# Parent  df2a3515788de458742ed205b073fc5a2c7a9cef
IOMMU/ATS: fix maximum queue depth calculation

The capabilities register field is a 5-bit value, and the 5 bits all
being zero actually means 32 entries.

Under the assumption that amd_iommu_flush_iotlb() really just tried
to correct for the miscalculation above when adding 32 to the value,
that adjustment is also being removed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset: 26235:670b07e8d738
xen-unstable date: Wed Dec  5 08:52:14 UTC 2012
---


diff -r df2a3515788d -r b533c473029f xen/drivers/passthrough/amd/iommu_cmd.c
--- a/xen/drivers/passthrough/amd/iommu_cmd.c	Wed Dec 19 12:51:46 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c	Wed Dec 19 12:53:13 2012 +0100
@@ -321,7 +321,7 @@ void amd_iommu_flush_iotlb(struct pci_de
 
     req_id = get_dma_requestor_id(iommu->seg, bdf);
     queueid = req_id;
-    maxpend = (ats_pdev->ats_queue_depth + 32) & 0xff;
+    maxpend = ats_pdev->ats_queue_depth & 0xff;
 
     /* send INVALIDATE_IOTLB_PAGES command */
     spin_lock_irqsave(&iommu->lock, flags);
diff -r df2a3515788d -r b533c473029f xen/drivers/passthrough/ats.h
--- a/xen/drivers/passthrough/ats.h	Wed Dec 19 12:51:46 2012 +0100
+++ b/xen/drivers/passthrough/ats.h	Wed Dec 19 12:53:13 2012 +0100
@@ -30,7 +30,7 @@ struct pci_ats_dev {
 
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
-#define ATS_QUEUE_DEPTH_MASK     0xF
+#define ATS_QUEUE_DEPTH_MASK     0x1f
 #define ATS_ENABLE               (1<<15)
 
 extern struct list_head ats_devices;
diff -r df2a3515788d -r b533c473029f xen/drivers/passthrough/x86/ats.c
--- a/xen/drivers/passthrough/x86/ats.c	Wed Dec 19 12:51:46 2012 +0100
+++ b/xen/drivers/passthrough/x86/ats.c	Wed Dec 19 12:53:13 2012 +0100
@@ -93,7 +93,8 @@ int enable_ats_device(int seg, int bus, 
         pdev->devfn = devfn;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
-        pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK;
+        pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
+                                ATS_QUEUE_DEPTH_MASK + 1;
         list_add(&pdev->list, &ats_devices);
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:35:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:35:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXqk-0006AE-7u; Thu, 20 Dec 2012 04:35:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXqj-0006A8-Oy
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:35:13 +0000
Received: from [193.109.254.147:46834] by server-13.bemta-14.messagelabs.com
	id E6/7B-01725-18592D05; Thu, 20 Dec 2012 04:35:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1355978109!11093303!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23867 invoked from network); 20 Dec 2012 04:35:10 -0000
Received: from unknown (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:35:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXol-0005d4-84
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXol-0005MQ-3o
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:11 +0000
Message-Id: <E1TlXol-0005MQ-3o@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nested vmx: fix DR access VM exit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1355918195 -3600
# Node ID 44ec641fcbd5931270b22ef88e401c3621df8cb9
# Parent  b11d8dcf1da5abe11c6aa7ad62aa508a4e667349
nested vmx: fix DR access VM exit

For DR register, we use lazy restore mechanism when access
it. Therefore when receiving such VM exit, L0 should be responsible to
switch to the right DR values, then inject to L1 hypervisor.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26254:e6eb1e52da7c
xen-unstable date: Thu Dec  6 16:56:49 UTC 2012
---


diff -r b11d8dcf1da5 -r 44ec641fcbd5 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:55:45 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:56:35 2012 +0100
@@ -1585,7 +1585,8 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         break;
     case EXIT_REASON_DR_ACCESS:
         ctrl = __n2_exec_control(v);
-        if ( ctrl & CPU_BASED_MOV_DR_EXITING )
+        if ( (ctrl & CPU_BASED_MOV_DR_EXITING) &&
+            v->arch.hvm_vcpu.flag_dr_dirty )
             nvcpu->nv_vmexit_pending = 1;
         break;
     case EXIT_REASON_INVLPG:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 04:35:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 04:35:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlXqk-0006AE-7u; Thu, 20 Dec 2012 04:35:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXqj-0006A8-Oy
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:35:13 +0000
Received: from [193.109.254.147:46834] by server-13.bemta-14.messagelabs.com
	id E6/7B-01725-18592D05; Thu, 20 Dec 2012 04:35:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1355978109!11093303!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23867 invoked from network); 20 Dec 2012 04:35:10 -0000
Received: from unknown (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 04:35:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXol-0005d4-84
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlXol-0005MQ-3o
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 04:33:11 +0000
Message-Id: <E1TlXol-0005MQ-3o@xenbits.xen.org>
Date: Thu, 20 Dec 2012 04:33:10 +0000
From: Xen patchbot-4.2-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.2-testing] nested vmx: fix DR access VM exit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@intel.com>
# Date 1355918195 -3600
# Node ID 44ec641fcbd5931270b22ef88e401c3621df8cb9
# Parent  b11d8dcf1da5abe11c6aa7ad62aa508a4e667349
nested vmx: fix DR access VM exit

For DR register, we use lazy restore mechanism when access
it. Therefore when receiving such VM exit, L0 should be responsible to
switch to the right DR values, then inject to L1 hypervisor.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 26254:e6eb1e52da7c
xen-unstable date: Thu Dec  6 16:56:49 UTC 2012
---


diff -r b11d8dcf1da5 -r 44ec641fcbd5 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:55:45 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vvmx.c	Wed Dec 19 12:56:35 2012 +0100
@@ -1585,7 +1585,8 @@ int nvmx_n2_vmexit_handler(struct cpu_us
         break;
     case EXIT_REASON_DR_ACCESS:
         ctrl = __n2_exec_control(v);
-        if ( ctrl & CPU_BASED_MOV_DR_EXITING )
+        if ( (ctrl & CPU_BASED_MOV_DR_EXITING) &&
+            v->arch.hvm_vcpu.flag_dr_dirty )
             nvcpu->nv_vmexit_pending = 1;
         break;
     case EXIT_REASON_INVLPG:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 11:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 11:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TleNG-0006Lc-Rf; Thu, 20 Dec 2012 11:33:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNF-0006LR-Jq
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:13 +0000
Received: from [193.109.254.147:57022] by server-15.bemta-14.messagelabs.com
	id 94/F4-05116-877F2D05; Thu, 20 Dec 2012 11:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1356003189!3598278!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20167 invoked from network); 20 Dec 2012 11:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 11:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNB-0002GT-Pn
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNB-0007WT-Ia
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:09 +0000
Message-Id: <E1TleNB-0007WT-Ia@xenbits.xen.org>
Date: Thu, 20 Dec 2012 11:33:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] XZ decompressor: Fix decoding of
	empty LZMA2 streams
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Lasse Collin <lasse.collin@tukaani.org>
# Date 1355916493 -3600
# Node ID ee0ad4dab0a5323898b478000fc7358cce631db5
# Parent  d72d30447ae8a1f66b6869f30e1e32ff57c8c4f6
XZ decompressor: Fix decoding of empty LZMA2 streams

From: Lasse Collin <lasse.collin@tukaani.org>

The old code considered valid empty LZMA2 streams to be corrupt.
Note that a typical empty .xz file has no LZMA2 data at all,
and thus most .xz files having no uncompressed data are handled
correctly even without this fix.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 23869:db1ea4b127cd
xen-unstable date: Thu Sep 22 17:33:48 UTC 2011
---


diff -r d72d30447ae8 -r ee0ad4dab0a5 xen/common/xz/dec_lzma2.c
--- a/xen/common/xz/dec_lzma2.c	Wed Dec 19 12:25:27 2012 +0100
+++ b/xen/common/xz/dec_lzma2.c	Wed Dec 19 12:28:13 2012 +0100
@@ -969,6 +969,9 @@ XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_
 			 */
 			tmp = b->in[b->in_pos++];
 
+			if (tmp == 0x00)
+				return XZ_STREAM_END;
+
 			if (tmp >= 0xE0 || tmp == 0x01) {
 				s->lzma2.need_props = true;
 				s->lzma2.need_dict_reset = false;
@@ -1001,9 +1004,6 @@ XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_
 						lzma_reset(s);
 				}
 			} else {
-				if (tmp == 0x00)
-					return XZ_STREAM_END;
-
 				if (tmp > 0x02)
 					return XZ_DATA_ERROR;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 11:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 11:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TleNG-0006Lc-Rf; Thu, 20 Dec 2012 11:33:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNF-0006LR-Jq
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:13 +0000
Received: from [193.109.254.147:57022] by server-15.bemta-14.messagelabs.com
	id 94/F4-05116-877F2D05; Thu, 20 Dec 2012 11:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1356003189!3598278!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20167 invoked from network); 20 Dec 2012 11:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 11:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNB-0002GT-Pn
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNB-0007WT-Ia
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:09 +0000
Message-Id: <E1TleNB-0007WT-Ia@xenbits.xen.org>
Date: Thu, 20 Dec 2012 11:33:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] XZ decompressor: Fix decoding of
	empty LZMA2 streams
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Lasse Collin <lasse.collin@tukaani.org>
# Date 1355916493 -3600
# Node ID ee0ad4dab0a5323898b478000fc7358cce631db5
# Parent  d72d30447ae8a1f66b6869f30e1e32ff57c8c4f6
XZ decompressor: Fix decoding of empty LZMA2 streams

From: Lasse Collin <lasse.collin@tukaani.org>

The old code considered valid empty LZMA2 streams to be corrupt.
Note that a typical empty .xz file has no LZMA2 data at all,
and thus most .xz files having no uncompressed data are handled
correctly even without this fix.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 23869:db1ea4b127cd
xen-unstable date: Thu Sep 22 17:33:48 UTC 2011
---


diff -r d72d30447ae8 -r ee0ad4dab0a5 xen/common/xz/dec_lzma2.c
--- a/xen/common/xz/dec_lzma2.c	Wed Dec 19 12:25:27 2012 +0100
+++ b/xen/common/xz/dec_lzma2.c	Wed Dec 19 12:28:13 2012 +0100
@@ -969,6 +969,9 @@ XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_
 			 */
 			tmp = b->in[b->in_pos++];
 
+			if (tmp == 0x00)
+				return XZ_STREAM_END;
+
 			if (tmp >= 0xE0 || tmp == 0x01) {
 				s->lzma2.need_props = true;
 				s->lzma2.need_dict_reset = false;
@@ -1001,9 +1004,6 @@ XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_
 						lzma_reset(s);
 				}
 			} else {
-				if (tmp == 0x00)
-					return XZ_STREAM_END;
-
 				if (tmp > 0x02)
 					return XZ_DATA_ERROR;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 11:33:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 11:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TleNa-0006NF-VN; Thu, 20 Dec 2012 11:33:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNZ-0006My-EJ
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:33 +0000
Received: from [193.109.254.147:62358] by server-12.bemta-14.messagelabs.com
	id 1D/74-06523-C87F2D05; Thu, 20 Dec 2012 11:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1356003190!6114518!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31017 invoked from network); 20 Dec 2012 11:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 11:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNC-0002GX-9c
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNC-0007Wi-2k
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:10 +0000
Message-Id: <E1TleNC-0007Wi-2k@xenbits.xen.org>
Date: Thu, 20 Dec 2012 11:33:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] XZ: Fix incorrect XZ_BUF_ERROR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Lasse Collin <lasse.collin@tukaani.org>
# Date 1355916565 -3600
# Node ID 2ae6267371d8d72f21b444720bb2d48d176cf7a5
# Parent  ee0ad4dab0a5323898b478000fc7358cce631db5
XZ: Fix incorrect XZ_BUF_ERROR

From: Lasse Collin <lasse.collin@tukaani.org>

xz_dec_run() could incorrectly return XZ_BUF_ERROR if all of the
following was true:

 - The caller knows how many bytes of output to expect and only
   provides
   that much output space.

 - When the last output bytes are decoded, the caller-provided input
   buffer ends right before the LZMA2 end of payload marker.  So LZMA2
   won't provide more output anymore, but it won't know it yet and
   thus
   won't return XZ_STREAM_END yet.

 - A BCJ filter is in use and it hasn't left any unfiltered bytes in
   the
   temp buffer.  This can happen with any BCJ filter, but in practice
   it's more likely with filters other than the x86 BCJ.

This fixes <https://bugzilla.redhat.com/show_bug.cgi?id=3D735408>
where Squashfs thinks that a valid file system is corrupt.

This also fixes a similar bug in single-call mode where the
uncompressed size of a block using BCJ + LZMA2 was 0 bytes and caller
provided no output space.  Many empty .xz files don't contain any
blocks and thus don't trigger this bug.

This also tweaks a closely related detail: xz_dec_bcj_run() could call
xz_dec_lzma2_run() to decode into temp buffer when it was known to be
useless.  This was harmless although it wasted a minuscule number of
CPU cycles.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 23870:5c97b02f48fc
xen-unstable date: Thu Sep 22 17:34:27 UTC 2011
---


diff -r ee0ad4dab0a5 -r 2ae6267371d8 xen/common/xz/dec_bcj.c
--- a/xen/common/xz/dec_bcj.c	Wed Dec 19 12:28:13 2012 +0100
+++ b/xen/common/xz/dec_bcj.c	Wed Dec 19 12:29:25 2012 +0100
@@ -442,8 +442,12 @@ XZ_EXTERN enum xz_ret INIT xz_dec_bcj_ru
 	 * next filter in the chain. Apply the BCJ filter on the new data
 	 * in the output buffer. If everything cannot be filtered, copy it
 	 * to temp and rewind the output buffer position accordingly.
+	 *
+	 * This needs to be always run when temp.size == 0 to handle a special
+	 * case where the output buffer is full and the next filter has no
+	 * more output coming but hasn't returned XZ_STREAM_END yet.
 	 */
-	if (s->temp.size < b->out_size - b->out_pos) {
+	if (s->temp.size < b->out_size - b->out_pos || s->temp.size == 0) {
 		out_start = b->out_pos;
 		memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size);
 		b->out_pos += s->temp.size;
@@ -466,16 +470,25 @@ XZ_EXTERN enum xz_ret INIT xz_dec_bcj_ru
 		s->temp.size = b->out_pos - out_start;
 		b->out_pos -= s->temp.size;
 		memcpy(s->temp.buf, b->out + b->out_pos, s->temp.size);
+
+		/*
+		 * If there wasn't enough input to the next filter to fill
+		 * the output buffer with unfiltered data, there's no point
+		 * to try decoding more data to temp.
+		 */
+		if (b->out_pos + s->temp.size < b->out_size)
+			return XZ_OK;
 	}
 
 	/*
-	 * If we have unfiltered data in temp, try to fill by decoding more
-	 * data from the next filter. Apply the BCJ filter on temp. Then we
-	 * hopefully can fill the actual output buffer by copying filtered
-	 * data from temp. A mix of filtered and unfiltered data may be left
-	 * in temp; it will be taken care on the next call to this function.
+	 * We have unfiltered data in temp. If the output buffer isn't full
+	 * yet, try to fill the temp buffer by decoding more data from the
+	 * next filter. Apply the BCJ filter on temp. Then we hopefully can
+	 * fill the actual output buffer by copying filtered data from temp.
+	 * A mix of filtered and unfiltered data may be left in temp; it will
+	 * be taken care on the next call to this function.
 	 */
-	if (s->temp.size > 0) {
+	if (b->out_pos < b->out_size) {
 		/* Make b->out{,_pos,_size} temporarily point to s->temp. */
 		s->out = b->out;
 		s->out_pos = b->out_pos;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 11:33:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 11:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TleNa-0006NF-VN; Thu, 20 Dec 2012 11:33:34 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNZ-0006My-EJ
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:33 +0000
Received: from [193.109.254.147:62358] by server-12.bemta-14.messagelabs.com
	id 1D/74-06523-C87F2D05; Thu, 20 Dec 2012 11:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1356003190!6114518!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31017 invoked from network); 20 Dec 2012 11:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 11:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNC-0002GX-9c
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNC-0007Wi-2k
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:10 +0000
Message-Id: <E1TleNC-0007Wi-2k@xenbits.xen.org>
Date: Thu, 20 Dec 2012 11:33:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] XZ: Fix incorrect XZ_BUF_ERROR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Lasse Collin <lasse.collin@tukaani.org>
# Date 1355916565 -3600
# Node ID 2ae6267371d8d72f21b444720bb2d48d176cf7a5
# Parent  ee0ad4dab0a5323898b478000fc7358cce631db5
XZ: Fix incorrect XZ_BUF_ERROR

From: Lasse Collin <lasse.collin@tukaani.org>

xz_dec_run() could incorrectly return XZ_BUF_ERROR if all of the
following was true:

 - The caller knows how many bytes of output to expect and only
   provides
   that much output space.

 - When the last output bytes are decoded, the caller-provided input
   buffer ends right before the LZMA2 end of payload marker.  So LZMA2
   won't provide more output anymore, but it won't know it yet and
   thus
   won't return XZ_STREAM_END yet.

 - A BCJ filter is in use and it hasn't left any unfiltered bytes in
   the
   temp buffer.  This can happen with any BCJ filter, but in practice
   it's more likely with filters other than the x86 BCJ.

This fixes <https://bugzilla.redhat.com/show_bug.cgi?id=3D735408>
where Squashfs thinks that a valid file system is corrupt.

This also fixes a similar bug in single-call mode where the
uncompressed size of a block using BCJ + LZMA2 was 0 bytes and caller
provided no output space.  Many empty .xz files don't contain any
blocks and thus don't trigger this bug.

This also tweaks a closely related detail: xz_dec_bcj_run() could call
xz_dec_lzma2_run() to decode into temp buffer when it was known to be
useless.  This was harmless although it wasted a minuscule number of
CPU cycles.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 23870:5c97b02f48fc
xen-unstable date: Thu Sep 22 17:34:27 UTC 2011
---


diff -r ee0ad4dab0a5 -r 2ae6267371d8 xen/common/xz/dec_bcj.c
--- a/xen/common/xz/dec_bcj.c	Wed Dec 19 12:28:13 2012 +0100
+++ b/xen/common/xz/dec_bcj.c	Wed Dec 19 12:29:25 2012 +0100
@@ -442,8 +442,12 @@ XZ_EXTERN enum xz_ret INIT xz_dec_bcj_ru
 	 * next filter in the chain. Apply the BCJ filter on the new data
 	 * in the output buffer. If everything cannot be filtered, copy it
 	 * to temp and rewind the output buffer position accordingly.
+	 *
+	 * This needs to be always run when temp.size == 0 to handle a special
+	 * case where the output buffer is full and the next filter has no
+	 * more output coming but hasn't returned XZ_STREAM_END yet.
 	 */
-	if (s->temp.size < b->out_size - b->out_pos) {
+	if (s->temp.size < b->out_size - b->out_pos || s->temp.size == 0) {
 		out_start = b->out_pos;
 		memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size);
 		b->out_pos += s->temp.size;
@@ -466,16 +470,25 @@ XZ_EXTERN enum xz_ret INIT xz_dec_bcj_ru
 		s->temp.size = b->out_pos - out_start;
 		b->out_pos -= s->temp.size;
 		memcpy(s->temp.buf, b->out + b->out_pos, s->temp.size);
+
+		/*
+		 * If there wasn't enough input to the next filter to fill
+		 * the output buffer with unfiltered data, there's no point
+		 * to try decoding more data to temp.
+		 */
+		if (b->out_pos + s->temp.size < b->out_size)
+			return XZ_OK;
 	}
 
 	/*
-	 * If we have unfiltered data in temp, try to fill by decoding more
-	 * data from the next filter. Apply the BCJ filter on temp. Then we
-	 * hopefully can fill the actual output buffer by copying filtered
-	 * data from temp. A mix of filtered and unfiltered data may be left
-	 * in temp; it will be taken care on the next call to this function.
+	 * We have unfiltered data in temp. If the output buffer isn't full
+	 * yet, try to fill the temp buffer by decoding more data from the
+	 * next filter. Apply the BCJ filter on temp. Then we hopefully can
+	 * fill the actual output buffer by copying filtered data from temp.
+	 * A mix of filtered and unfiltered data may be left in temp; it will
+	 * be taken care on the next call to this function.
 	 */
-	if (s->temp.size > 0) {
+	if (b->out_pos < b->out_size) {
 		/* Make b->out{,_pos,_size} temporarily point to s->temp. */
 		s->out = b->out;
 		s->out_pos = b->out_pos;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 11:33:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 11:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TleNc-0006NX-4z; Thu, 20 Dec 2012 11:33:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNa-0006My-Qk
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:34 +0000
Received: from [193.109.254.147:44988] by server-12.bemta-14.messagelabs.com
	id 46/84-06523-E87F2D05; Thu, 20 Dec 2012 11:33:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1356003189!6114512!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31015 invoked from network); 20 Dec 2012 11:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 11:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNA-0002GO-Nc
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNA-0007Vx-Ea
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:08 +0000
Message-Id: <E1TleNA-0007Vx-Ea@xenbits.xen.org>
Date: Thu, 20 Dec 2012 11:33:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] update Xen version to 4.1.5-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355916177 -3600
# Node ID 7892ab82191bab0ef767f7b248099a3af70f4ed8
# Parent  b13c5ee3c10970fe691aa585e5c8bbd44a3e4cc0
update Xen version to 4.1.5-pre
---


diff -r b13c5ee3c109 -r 7892ab82191b xen/Makefile
--- a/xen/Makefile	Tue Dec 18 12:53:15 2012 +0000
+++ b/xen/Makefile	Wed Dec 19 12:22:57 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .4$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .5-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 11:33:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 11:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TleNc-0006NX-4z; Thu, 20 Dec 2012 11:33:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNa-0006My-Qk
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:34 +0000
Received: from [193.109.254.147:44988] by server-12.bemta-14.messagelabs.com
	id 46/84-06523-E87F2D05; Thu, 20 Dec 2012 11:33:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1356003189!6114512!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31015 invoked from network); 20 Dec 2012 11:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 11:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNA-0002GO-Nc
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNA-0007Vx-Ea
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:08 +0000
Message-Id: <E1TleNA-0007Vx-Ea@xenbits.xen.org>
Date: Thu, 20 Dec 2012 11:33:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] update Xen version to 4.1.5-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich
# Date 1355916177 -3600
# Node ID 7892ab82191bab0ef767f7b248099a3af70f4ed8
# Parent  b13c5ee3c10970fe691aa585e5c8bbd44a3e4cc0
update Xen version to 4.1.5-pre
---


diff -r b13c5ee3c109 -r 7892ab82191b xen/Makefile
--- a/xen/Makefile	Tue Dec 18 12:53:15 2012 +0000
+++ b/xen/Makefile	Wed Dec 19 12:22:57 2012 +0100
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .4$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .5-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 11:34:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 11:34:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TleOG-0006Sc-9J; Thu, 20 Dec 2012 11:34:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleOE-0006SL-Hp
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:34:15 +0000
Received: from [85.158.139.211:47382] by server-2.bemta-5.messagelabs.com id
	A0/D8-16162-5B7F2D05; Thu, 20 Dec 2012 11:34:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-206.messagelabs.com!1356003189!19494561!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_23,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13975 invoked from network); 20 Dec 2012 11:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 11:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNB-0002GR-Bq
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNB-0007WE-1K
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:09 +0000
Message-Id: <E1TleNB-0007WE-1K@xenbits.xen.org>
Date: Thu, 20 Dec 2012 11:33:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Add Dom0 xz kernel decompression
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@novell.com>
# Date 1355916327 -3600
# Node ID d72d30447ae8a1f66b6869f30e1e32ff57c8c4f6
# Parent  7892ab82191bab0ef767f7b248099a3af70f4ed8
Add Dom0 xz kernel decompression

Largely taken from Linux 2.6.38 and made build/work for Xen.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 23001:9eb9948904cd
xen-unstable date: Wed Mar  9 16:18:58 UTC 2011
---


diff -r 7892ab82191b -r d72d30447ae8 xen/common/Makefile
--- a/xen/common/Makefile	Wed Dec 19 12:22:57 2012 +0100
+++ b/xen/common/Makefile	Wed Dec 19 12:25:27 2012 +0100
@@ -43,7 +43,7 @@ obj-y += radix-tree.o
 obj-y += rbtree.o
 obj-y += lzo.o
 
-obj-$(CONFIG_X86) += decompress.o bunzip2.o unlzma.o unlzo.o
+obj-$(CONFIG_X86) += decompress.o bunzip2.o unxz.o unlzma.o unlzo.o
 
 obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
diff -r 7892ab82191b -r d72d30447ae8 xen/common/decompress.c
--- a/xen/common/decompress.c	Wed Dec 19 12:22:57 2012 +0100
+++ b/xen/common/decompress.c	Wed Dec 19 12:25:27 2012 +0100
@@ -20,6 +20,9 @@ int __init decompress(void *inbuf, unsig
     if ( len >= 3 && !memcmp(inbuf, "\x42\x5a\x68", 3) )
         return bunzip2(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
+    if ( len >= 6 && !memcmp(inbuf, "\3757zXZ", 6) )
+        return unxz(inbuf, len, NULL, NULL, outbuf, NULL, error);
+
     if ( len >= 2 && !memcmp(inbuf, "\135\000", 2) )
         return unlzma(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
diff -r 7892ab82191b -r d72d30447ae8 xen/common/decompress.h
--- a/xen/common/decompress.h	Wed Dec 19 12:22:57 2012 +0100
+++ b/xen/common/decompress.h	Wed Dec 19 12:25:27 2012 +0100
@@ -8,6 +8,7 @@
 
 #define STATIC
 #define INIT __init
+#define INITDATA __initdata
 
 static void(*__initdata error)(const char *);
 #define set_error_fn(x) error = x;
diff -r 7892ab82191b -r d72d30447ae8 xen/common/unxz.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/unxz.c	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,306 @@
+/*
+ * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd
+ *
+ * Author: Lasse Collin <lasse.collin@tukaani.org>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+/*
+ * Important notes about in-place decompression
+ *
+ * At least on x86, the kernel is decompressed in place: the compressed data
+ * is placed to the end of the output buffer, and the decompressor overwrites
+ * most of the compressed data. There must be enough safety margin to
+ * guarantee that the write position is always behind the read position.
+ *
+ * The safety margin for XZ with LZMA2 or BCJ+LZMA2 is calculated below.
+ * Note that the margin with XZ is bigger than with Deflate (gzip)!
+ *
+ * The worst case for in-place decompression is that the beginning of
+ * the file is compressed extremely well, and the rest of the file is
+ * uncompressible. Thus, we must look for worst-case expansion when the
+ * compressor is encoding uncompressible data.
+ *
+ * The structure of the .xz file in case of a compresed kernel is as follows.
+ * Sizes (as bytes) of the fields are in parenthesis.
+ *
+ *    Stream Header (12)
+ *    Block Header:
+ *      Block Header (8-12)
+ *      Compressed Data (N)
+ *      Block Padding (0-3)
+ *      CRC32 (4)
+ *    Index (8-20)
+ *    Stream Footer (12)
+ *
+ * Normally there is exactly one Block, but let's assume that there are
+ * 2-4 Blocks just in case. Because Stream Header and also Block Header
+ * of the first Block don't make the decompressor produce any uncompressed
+ * data, we can ignore them from our calculations. Block Headers of possible
+ * additional Blocks have to be taken into account still. With these
+ * assumptions, it is safe to assume that the total header overhead is
+ * less than 128 bytes.
+ *
+ * Compressed Data contains LZMA2 or BCJ+LZMA2 encoded data. Since BCJ
+ * doesn't change the size of the data, it is enough to calculate the
+ * safety margin for LZMA2.
+ *
+ * LZMA2 stores the data in chunks. Each chunk has a header whose size is
+ * a maximum of 6 bytes, but to get round 2^n numbers, let's assume that
+ * the maximum chunk header size is 8 bytes. After the chunk header, there
+ * may be up to 64 KiB of actual payload in the chunk. Often the payload is
+ * quite a bit smaller though; to be safe, let's assume that an average
+ * chunk has only 32 KiB of payload.
+ *
+ * The maximum uncompressed size of the payload is 2 MiB. The minimum
+ * uncompressed size of the payload is in practice never less than the
+ * payload size itself. The LZMA2 format would allow uncompressed size
+ * to be less than the payload size, but no sane compressor creates such
+ * files. LZMA2 supports storing uncompressible data in uncompressed form,
+ * so there's never a need to create payloads whose uncompressed size is
+ * smaller than the compressed size.
+ *
+ * The assumption, that the uncompressed size of the payload is never
+ * smaller than the payload itself, is valid only when talking about
+ * the payload as a whole. It is possible that the payload has parts where
+ * the decompressor consumes more input than it produces output. Calculating
+ * the worst case for this would be tricky. Instead of trying to do that,
+ * let's simply make sure that the decompressor never overwrites any bytes
+ * of the payload which it is currently reading.
+ *
+ * Now we have enough information to calculate the safety margin. We need
+ *   - 128 bytes for the .xz file format headers;
+ *   - 8 bytes per every 32 KiB of uncompressed size (one LZMA2 chunk header
+ *     per chunk, each chunk having average payload size of 32 KiB); and
+ *   - 64 KiB (biggest possible LZMA2 chunk payload size) to make sure that
+ *     the decompressor never overwrites anything from the LZMA2 chunk
+ *     payload it is currently reading.
+ *
+ * We get the following formula:
+ *
+ *    safety_margin = 128 + uncompressed_size * 8 / 32768 + 65536
+ *                  = 128 + (uncompressed_size >> 12) + 65536
+ *
+ * For comparision, according to arch/x86/boot/compressed/misc.c, the
+ * equivalent formula for Deflate is this:
+ *
+ *    safety_margin = 18 + (uncompressed_size >> 12) + 32768
+ *
+ * Thus, when updating Deflate-only in-place kernel decompressor to
+ * support XZ, the fixed overhead has to be increased from 18+32768 bytes
+ * to 128+65536 bytes.
+ */
+
+#include "decompress.h"
+
+#define XZ_EXTERN STATIC
+
+/*
+ * For boot time use, we enable only the BCJ filter of the current
+ * architecture or none if no BCJ filter is available for the architecture.
+ */
+#ifdef CONFIG_X86
+#	define XZ_DEC_X86
+#endif
+#ifdef CONFIG_PPC
+#	define XZ_DEC_POWERPC
+#endif
+#ifdef CONFIG_ARM
+#	define XZ_DEC_ARM
+#endif
+#ifdef CONFIG_IA64
+#	define XZ_DEC_IA64
+#endif
+#ifdef CONFIG_SPARC
+#	define XZ_DEC_SPARC
+#endif
+
+/*
+ * This will get the basic headers so that memeq() and others
+ * can be defined.
+ */
+#include "xz/private.h"
+
+/*
+ * memeq and memzero are not used much and any remotely sane implementation
+ * is fast enough. memcpy/memmove speed matters in multi-call mode, but
+ * the kernel image is decompressed in single-call mode, in which only
+ * memcpy speed can matter and only if there is a lot of uncompressible data
+ * (LZMA2 stores uncompressible chunks in uncompressed form). Thus, the
+ * functions below should just be kept small; it's probably not worth
+ * optimizing for speed.
+ */
+
+#ifndef memeq
+#define memeq(p1, p2, sz) (memcmp(p1, p2, sz) == 0)
+#endif
+
+#ifndef memzero
+#define memzero(p, sz) memset(p, 0, sz)
+#endif
+
+#include "xz/crc32.c"
+#include "xz/dec_stream.c"
+#include "xz/dec_lzma2.c"
+#include "xz/dec_bcj.c"
+
+/* Size of the input and output buffers in multi-call mode */
+#define XZ_IOBUF_SIZE 4096
+
+/*
+ * This function implements the API defined in <linux/decompress/generic.h>.
+ *
+ * This wrapper will automatically choose single-call or multi-call mode
+ * of the native XZ decoder API. The single-call mode can be used only when
+ * both input and output buffers are available as a single chunk, i.e. when
+ * fill() and flush() won't be used.
+ */
+STATIC int INIT unxz(unsigned char *in, unsigned int in_size,
+		     int (*fill)(void *dest, unsigned int size),
+		     int (*flush)(void *src, unsigned int size),
+		     unsigned char *out, unsigned int *in_used,
+		     void (*error_fn)(const char *x))
+{
+	struct xz_buf b;
+	struct xz_dec *s;
+	enum xz_ret ret;
+	bool_t must_free_in = false;
+
+	set_error_fn(error_fn);
+
+	xz_crc32_init();
+
+	if (in_used != NULL)
+		*in_used = 0;
+
+	if (fill == NULL && flush == NULL)
+		s = xz_dec_init(XZ_SINGLE, 0);
+	else
+		s = xz_dec_init(XZ_DYNALLOC, (uint32_t)-1);
+
+	if (s == NULL)
+		goto error_alloc_state;
+
+	if (flush == NULL) {
+		b.out = out;
+		b.out_size = (size_t)-1;
+	} else {
+		b.out_size = XZ_IOBUF_SIZE;
+		b.out = malloc(XZ_IOBUF_SIZE);
+		if (b.out == NULL)
+			goto error_alloc_out;
+	}
+
+	if (in == NULL) {
+		must_free_in = true;
+		in = malloc(XZ_IOBUF_SIZE);
+		if (in == NULL)
+			goto error_alloc_in;
+	}
+
+	b.in = in;
+	b.in_pos = 0;
+	b.in_size = in_size;
+	b.out_pos = 0;
+
+	if (fill == NULL && flush == NULL) {
+		ret = xz_dec_run(s, &b);
+	} else {
+		do {
+			if (b.in_pos == b.in_size && fill != NULL) {
+				if (in_used != NULL)
+					*in_used += b.in_pos;
+
+				b.in_pos = 0;
+
+				in_size = fill(in, XZ_IOBUF_SIZE);
+				if ((int)in_size < 0) {
+					/*
+					 * This isn't an optimal error code
+					 * but it probably isn't worth making
+					 * a new one either.
+					 */
+					ret = XZ_BUF_ERROR;
+					break;
+				}
+
+				b.in_size = in_size;
+			}
+
+			ret = xz_dec_run(s, &b);
+
+			if (flush != NULL && (b.out_pos == b.out_size
+					|| (ret != XZ_OK && b.out_pos > 0))) {
+				/*
+				 * Setting ret here may hide an error
+				 * returned by xz_dec_run(), but probably
+				 * it's not too bad.
+				 */
+				if (flush(b.out, b.out_pos) != (int)b.out_pos)
+					ret = XZ_BUF_ERROR;
+
+				b.out_pos = 0;
+			}
+		} while (ret == XZ_OK);
+
+		if (must_free_in)
+			free(in);
+
+		if (flush != NULL)
+			free(b.out);
+	}
+
+	if (in_used != NULL)
+		*in_used += b.in_pos;
+
+	xz_dec_end(s);
+
+	switch (ret) {
+	case XZ_STREAM_END:
+		return 0;
+
+	case XZ_MEM_ERROR:
+		/* This can occur only in multi-call mode. */
+		error("XZ decompressor ran out of memory");
+		break;
+
+	case XZ_FORMAT_ERROR:
+		error("Input is not in the XZ format (wrong magic bytes)");
+		break;
+
+	case XZ_OPTIONS_ERROR:
+		error("Input was encoded with settings that are not "
+				"supported by this XZ decoder");
+		break;
+
+	case XZ_DATA_ERROR:
+	case XZ_BUF_ERROR:
+		error("XZ-compressed data is corrupt");
+		break;
+
+	default:
+		error("Bug in the XZ decompressor");
+		break;
+	}
+
+	return -1;
+
+error_alloc_in:
+	if (flush != NULL)
+		free(b.out);
+
+error_alloc_out:
+	xz_dec_end(s);
+
+error_alloc_state:
+	error("XZ decompressor ran out of memory");
+	return -1;
+}
+
+/*
+ * This macro is used by architecture-specific files to decompress
+ * the kernel image.
+ */
+#define decompress unxz
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/crc32.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/crc32.c	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * CRC32 using the polynomial from IEEE-802.3
+ *
+ * Authors: Lasse Collin <lasse.collin@tukaani.org>
+ *          Igor Pavlov <http://7-zip.org/>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+/*
+ * This is not the fastest implementation, but it is pretty compact.
+ * The fastest versions of xz_crc32() on modern CPUs without hardware
+ * accelerated CRC instruction are 3-5 times as fast as this version,
+ * but they are bigger and use more memory for the lookup table.
+ */
+
+#include "private.h"
+
+XZ_EXTERN uint32_t INITDATA xz_crc32_table[256];
+
+XZ_EXTERN void INIT xz_crc32_init(void)
+{
+	const uint32_t poly = 0xEDB88320;
+
+	uint32_t i;
+	uint32_t j;
+	uint32_t r;
+
+	for (i = 0; i < 256; ++i) {
+		r = i;
+		for (j = 0; j < 8; ++j)
+			r = (r >> 1) ^ (poly & ~((r & 1) - 1));
+
+		xz_crc32_table[i] = r;
+	}
+
+	return;
+}
+
+XZ_EXTERN uint32_t INIT xz_crc32(const uint8_t *buf, size_t size, uint32_t crc)
+{
+	crc = ~crc;
+
+	while (size != 0) {
+		crc = xz_crc32_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8);
+		--size;
+	}
+
+	return ~crc;
+}
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/dec_bcj.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/dec_bcj.c	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,562 @@
+/*
+ * Branch/Call/Jump (BCJ) filter decoders
+ *
+ * Authors: Lasse Collin <lasse.collin@tukaani.org>
+ *          Igor Pavlov <http://7-zip.org/>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#include "private.h"
+
+/*
+ * The rest of the file is inside this ifdef. It makes things a little more
+ * convenient when building without support for any BCJ filters.
+ */
+#ifdef XZ_DEC_BCJ
+
+struct xz_dec_bcj {
+	/* Type of the BCJ filter being used */
+	enum {
+		BCJ_X86 = 4,        /* x86 or x86-64 */
+		BCJ_POWERPC = 5,    /* Big endian only */
+		BCJ_IA64 = 6,       /* Big or little endian */
+		BCJ_ARM = 7,        /* Little endian only */
+		BCJ_ARMTHUMB = 8,   /* Little endian only */
+		BCJ_SPARC = 9       /* Big or little endian */
+	} type;
+
+	/*
+	 * Return value of the next filter in the chain. We need to preserve
+	 * this information across calls, because we must not call the next
+	 * filter anymore once it has returned XZ_STREAM_END.
+	 */
+	enum xz_ret ret;
+
+	/* True if we are operating in single-call mode. */
+	bool_t single_call;
+
+	/*
+	 * Absolute position relative to the beginning of the uncompressed
+	 * data (in a single .xz Block). We care only about the lowest 32
+	 * bits so this doesn't need to be uint64_t even with big files.
+	 */
+	uint32_t pos;
+
+	/* x86 filter state */
+	uint32_t x86_prev_mask;
+
+	/* Temporary space to hold the variables from struct xz_buf */
+	uint8_t *out;
+	size_t out_pos;
+	size_t out_size;
+
+	struct {
+		/* Amount of already filtered data in the beginning of buf */
+		size_t filtered;
+
+		/* Total amount of data currently stored in buf  */
+		size_t size;
+
+		/*
+		 * Buffer to hold a mix of filtered and unfiltered data. This
+		 * needs to be big enough to hold Alignment + 2 * Look-ahead:
+		 *
+		 * Type         Alignment   Look-ahead
+		 * x86              1           4
+		 * PowerPC          4           0
+		 * IA-64           16           0
+		 * ARM              4           0
+		 * ARM-Thumb        2           2
+		 * SPARC            4           0
+		 */
+		uint8_t buf[16];
+	} temp;
+};
+
+#ifdef XZ_DEC_X86
+/*
+ * This is used to test the most significant byte of a memory address
+ * in an x86 instruction.
+ */
+static inline int INIT bcj_x86_test_msbyte(uint8_t b)
+{
+	return b == 0x00 || b == 0xFF;
+}
+
+static size_t INIT bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	static /*const*/ bool_t INITDATA mask_to_allowed_status[8]
+		= { true, true, true, false, true, false, false, false };
+
+	static /*const*/ uint8_t INITDATA mask_to_bit_num[8]
+		= { 0, 1, 2, 2, 3, 3, 3, 3 };
+
+	size_t i;
+	size_t prev_pos = (size_t)-1;
+	uint32_t prev_mask = s->x86_prev_mask;
+	uint32_t src;
+	uint32_t dest;
+	uint32_t j;
+	uint8_t b;
+
+	if (size <= 4)
+		return 0;
+
+	size -= 4;
+	for (i = 0; i < size; ++i) {
+		if ((buf[i] & 0xFE) != 0xE8)
+			continue;
+
+		prev_pos = i - prev_pos;
+		if (prev_pos > 3) {
+			prev_mask = 0;
+		} else {
+			prev_mask = (prev_mask << (prev_pos - 1)) & 7;
+			if (prev_mask != 0) {
+				b = buf[i + 4 - mask_to_bit_num[prev_mask]];
+				if (!mask_to_allowed_status[prev_mask]
+						|| bcj_x86_test_msbyte(b)) {
+					prev_pos = i;
+					prev_mask = (prev_mask << 1) | 1;
+					continue;
+				}
+			}
+		}
+
+		prev_pos = i;
+
+		if (bcj_x86_test_msbyte(buf[i + 4])) {
+			src = get_unaligned_le32(buf + i + 1);
+			while (true) {
+				dest = src - (s->pos + (uint32_t)i + 5);
+				if (prev_mask == 0)
+					break;
+
+				j = mask_to_bit_num[prev_mask] * 8;
+				b = (uint8_t)(dest >> (24 - j));
+				if (!bcj_x86_test_msbyte(b))
+					break;
+
+				src = dest ^ (((uint32_t)1 << (32 - j)) - 1);
+			}
+
+			dest &= 0x01FFFFFF;
+			dest |= (uint32_t)0 - (dest & 0x01000000);
+			put_unaligned_le32(dest, buf + i + 1);
+			i += 4;
+		} else {
+			prev_mask = (prev_mask << 1) | 1;
+		}
+	}
+
+	prev_pos = i - prev_pos;
+	s->x86_prev_mask = prev_pos > 3 ? 0 : prev_mask << (prev_pos - 1);
+	return i;
+}
+#endif
+
+#ifdef XZ_DEC_POWERPC
+static size_t INIT bcj_powerpc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	size_t i;
+	uint32_t instr;
+
+	for (i = 0; i + 4 <= size; i += 4) {
+		instr = get_unaligned_be32(buf + i);
+		if ((instr & 0xFC000003) == 0x48000001) {
+			instr &= 0x03FFFFFC;
+			instr -= s->pos + (uint32_t)i;
+			instr &= 0x03FFFFFC;
+			instr |= 0x48000001;
+			put_unaligned_be32(instr, buf + i);
+		}
+	}
+
+	return i;
+}
+#endif
+
+#ifdef XZ_DEC_IA64
+static size_t INIT bcj_ia64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	static const uint8_t branch_table[32] = {
+		0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0,
+		4, 4, 6, 6, 0, 0, 7, 7,
+		4, 4, 0, 0, 4, 4, 0, 0
+	};
+
+	/*
+	 * The local variables take a little bit stack space, but it's less
+	 * than what LZMA2 decoder takes, so it doesn't make sense to reduce
+	 * stack usage here without doing that for the LZMA2 decoder too.
+	 */
+
+	/* Loop counters */
+	size_t i;
+	size_t j;
+
+	/* Instruction slot (0, 1, or 2) in the 128-bit instruction word */
+	uint32_t slot;
+
+	/* Bitwise offset of the instruction indicated by slot */
+	uint32_t bit_pos;
+
+	/* bit_pos split into byte and bit parts */
+	uint32_t byte_pos;
+	uint32_t bit_res;
+
+	/* Address part of an instruction */
+	uint32_t addr;
+
+	/* Mask used to detect which instructions to convert */
+	uint32_t mask;
+
+	/* 41-bit instruction stored somewhere in the lowest 48 bits */
+	uint64_t instr;
+
+	/* Instruction normalized with bit_res for easier manipulation */
+	uint64_t norm;
+
+	for (i = 0; i + 16 <= size; i += 16) {
+		mask = branch_table[buf[i] & 0x1F];
+		for (slot = 0, bit_pos = 5; slot < 3; ++slot, bit_pos += 41) {
+			if (((mask >> slot) & 1) == 0)
+				continue;
+
+			byte_pos = bit_pos >> 3;
+			bit_res = bit_pos & 7;
+			instr = 0;
+			for (j = 0; j < 6; ++j)
+				instr |= (uint64_t)(buf[i + j + byte_pos])
+						<< (8 * j);
+
+			norm = instr >> bit_res;
+
+			if (((norm >> 37) & 0x0F) == 0x05
+					&& ((norm >> 9) & 0x07) == 0) {
+				addr = (norm >> 13) & 0x0FFFFF;
+				addr |= ((uint32_t)(norm >> 36) & 1) << 20;
+				addr <<= 4;
+				addr -= s->pos + (uint32_t)i;
+				addr >>= 4;
+
+				norm &= ~((uint64_t)0x8FFFFF << 13);
+				norm |= (uint64_t)(addr & 0x0FFFFF) << 13;
+				norm |= (uint64_t)(addr & 0x100000)
+						<< (36 - 20);
+
+				instr &= (1 << bit_res) - 1;
+				instr |= norm << bit_res;
+
+				for (j = 0; j < 6; j++)
+					buf[i + j + byte_pos]
+						= (uint8_t)(instr >> (8 * j));
+			}
+		}
+	}
+
+	return i;
+}
+#endif
+
+#ifdef XZ_DEC_ARM
+static size_t INIT bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	size_t i;
+	uint32_t addr;
+
+	for (i = 0; i + 4 <= size; i += 4) {
+		if (buf[i + 3] == 0xEB) {
+			addr = (uint32_t)buf[i] | ((uint32_t)buf[i + 1] << 8)
+					| ((uint32_t)buf[i + 2] << 16);
+			addr <<= 2;
+			addr -= s->pos + (uint32_t)i + 8;
+			addr >>= 2;
+			buf[i] = (uint8_t)addr;
+			buf[i + 1] = (uint8_t)(addr >> 8);
+			buf[i + 2] = (uint8_t)(addr >> 16);
+		}
+	}
+
+	return i;
+}
+#endif
+
+#ifdef XZ_DEC_ARMTHUMB
+static size_t INIT bcj_armthumb(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	size_t i;
+	uint32_t addr;
+
+	for (i = 0; i + 4 <= size; i += 2) {
+		if ((buf[i + 1] & 0xF8) == 0xF0
+				&& (buf[i + 3] & 0xF8) == 0xF8) {
+			addr = (((uint32_t)buf[i + 1] & 0x07) << 19)
+					| ((uint32_t)buf[i] << 11)
+					| (((uint32_t)buf[i + 3] & 0x07) << 8)
+					| (uint32_t)buf[i + 2];
+			addr <<= 1;
+			addr -= s->pos + (uint32_t)i + 4;
+			addr >>= 1;
+			buf[i + 1] = (uint8_t)(0xF0 | ((addr >> 19) & 0x07));
+			buf[i] = (uint8_t)(addr >> 11);
+			buf[i + 3] = (uint8_t)(0xF8 | ((addr >> 8) & 0x07));
+			buf[i + 2] = (uint8_t)addr;
+			i += 2;
+		}
+	}
+
+	return i;
+}
+#endif
+
+#ifdef XZ_DEC_SPARC
+static size_t INIT bcj_sparc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	size_t i;
+	uint32_t instr;
+
+	for (i = 0; i + 4 <= size; i += 4) {
+		instr = get_unaligned_be32(buf + i);
+		if ((instr >> 22) == 0x100 || (instr >> 22) == 0x1FF) {
+			instr <<= 2;
+			instr -= s->pos + (uint32_t)i;
+			instr >>= 2;
+			instr = ((uint32_t)0x40000000 - (instr & 0x400000))
+					| 0x40000000 | (instr & 0x3FFFFF);
+			put_unaligned_be32(instr, buf + i);
+		}
+	}
+
+	return i;
+}
+#endif
+
+/*
+ * Apply the selected BCJ filter. Update *pos and s->pos to match the amount
+ * of data that got filtered.
+ *
+ * NOTE: This is implemented as a switch statement to avoid using function
+ * pointers, which could be problematic in the kernel boot code, which must
+ * avoid pointers to static data (at least on x86).
+ */
+static void INIT bcj_apply(struct xz_dec_bcj *s,
+			   uint8_t *buf, size_t *pos, size_t size)
+{
+	size_t filtered;
+
+	buf += *pos;
+	size -= *pos;
+
+	switch (s->type) {
+#ifdef XZ_DEC_X86
+	case BCJ_X86:
+		filtered = bcj_x86(s, buf, size);
+		break;
+#endif
+#ifdef XZ_DEC_POWERPC
+	case BCJ_POWERPC:
+		filtered = bcj_powerpc(s, buf, size);
+		break;
+#endif
+#ifdef XZ_DEC_IA64
+	case BCJ_IA64:
+		filtered = bcj_ia64(s, buf, size);
+		break;
+#endif
+#ifdef XZ_DEC_ARM
+	case BCJ_ARM:
+		filtered = bcj_arm(s, buf, size);
+		break;
+#endif
+#ifdef XZ_DEC_ARMTHUMB
+	case BCJ_ARMTHUMB:
+		filtered = bcj_armthumb(s, buf, size);
+		break;
+#endif
+#ifdef XZ_DEC_SPARC
+	case BCJ_SPARC:
+		filtered = bcj_sparc(s, buf, size);
+		break;
+#endif
+	default:
+		/* Never reached but silence compiler warnings. */
+		filtered = 0;
+		break;
+	}
+
+	*pos += filtered;
+	s->pos += filtered;
+}
+
+/*
+ * Flush pending filtered data from temp to the output buffer.
+ * Move the remaining mixture of possibly filtered and unfiltered
+ * data to the beginning of temp.
+ */
+static void INIT bcj_flush(struct xz_dec_bcj *s, struct xz_buf *b)
+{
+	size_t copy_size;
+
+	copy_size = min_t(size_t, s->temp.filtered, b->out_size - b->out_pos);
+	memcpy(b->out + b->out_pos, s->temp.buf, copy_size);
+	b->out_pos += copy_size;
+
+	s->temp.filtered -= copy_size;
+	s->temp.size -= copy_size;
+	memmove(s->temp.buf, s->temp.buf + copy_size, s->temp.size);
+}
+
+/*
+ * The BCJ filter functions are primitive in sense that they process the
+ * data in chunks of 1-16 bytes. To hide this issue, this function does
+ * some buffering.
+ */
+XZ_EXTERN enum xz_ret INIT xz_dec_bcj_run(struct xz_dec_bcj *s,
+					  struct xz_dec_lzma2 *lzma2,
+					  struct xz_buf *b)
+{
+	size_t out_start;
+
+	/*
+	 * Flush pending already filtered data to the output buffer. Return
+	 * immediatelly if we couldn't flush everything, or if the next
+	 * filter in the chain had already returned XZ_STREAM_END.
+	 */
+	if (s->temp.filtered > 0) {
+		bcj_flush(s, b);
+		if (s->temp.filtered > 0)
+			return XZ_OK;
+
+		if (s->ret == XZ_STREAM_END)
+			return XZ_STREAM_END;
+	}
+
+	/*
+	 * If we have more output space than what is currently pending in
+	 * temp, copy the unfiltered data from temp to the output buffer
+	 * and try to fill the output buffer by decoding more data from the
+	 * next filter in the chain. Apply the BCJ filter on the new data
+	 * in the output buffer. If everything cannot be filtered, copy it
+	 * to temp and rewind the output buffer position accordingly.
+	 */
+	if (s->temp.size < b->out_size - b->out_pos) {
+		out_start = b->out_pos;
+		memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size);
+		b->out_pos += s->temp.size;
+
+		s->ret = xz_dec_lzma2_run(lzma2, b);
+		if (s->ret != XZ_STREAM_END
+				&& (s->ret != XZ_OK || s->single_call))
+			return s->ret;
+
+		bcj_apply(s, b->out, &out_start, b->out_pos);
+
+		/*
+		 * As an exception, if the next filter returned XZ_STREAM_END,
+		 * we can do that too, since the last few bytes that remain
+		 * unfiltered are meant to remain unfiltered.
+		 */
+		if (s->ret == XZ_STREAM_END)
+			return XZ_STREAM_END;
+
+		s->temp.size = b->out_pos - out_start;
+		b->out_pos -= s->temp.size;
+		memcpy(s->temp.buf, b->out + b->out_pos, s->temp.size);
+	}
+
+	/*
+	 * If we have unfiltered data in temp, try to fill by decoding more
+	 * data from the next filter. Apply the BCJ filter on temp. Then we
+	 * hopefully can fill the actual output buffer by copying filtered
+	 * data from temp. A mix of filtered and unfiltered data may be left
+	 * in temp; it will be taken care on the next call to this function.
+	 */
+	if (s->temp.size > 0) {
+		/* Make b->out{,_pos,_size} temporarily point to s->temp. */
+		s->out = b->out;
+		s->out_pos = b->out_pos;
+		s->out_size = b->out_size;
+		b->out = s->temp.buf;
+		b->out_pos = s->temp.size;
+		b->out_size = sizeof(s->temp.buf);
+
+		s->ret = xz_dec_lzma2_run(lzma2, b);
+
+		s->temp.size = b->out_pos;
+		b->out = s->out;
+		b->out_pos = s->out_pos;
+		b->out_size = s->out_size;
+
+		if (s->ret != XZ_OK && s->ret != XZ_STREAM_END)
+			return s->ret;
+
+		bcj_apply(s, s->temp.buf, &s->temp.filtered, s->temp.size);
+
+		/*
+		 * If the next filter returned XZ_STREAM_END, we mark that
+		 * everything is filtered, since the last unfiltered bytes
+		 * of the stream are meant to be left as is.
+		 */
+		if (s->ret == XZ_STREAM_END)
+			s->temp.filtered = s->temp.size;
+
+		bcj_flush(s, b);
+		if (s->temp.filtered > 0)
+			return XZ_OK;
+	}
+
+	return s->ret;
+}
+
+XZ_EXTERN struct xz_dec_bcj *INIT xz_dec_bcj_create(bool_t single_call)
+{
+	struct xz_dec_bcj *s = malloc(sizeof(*s));
+	if (s != NULL)
+		s->single_call = single_call;
+
+	return s;
+}
+
+XZ_EXTERN enum xz_ret INIT xz_dec_bcj_reset(struct xz_dec_bcj *s, uint8_t id)
+{
+	switch (id) {
+#ifdef XZ_DEC_X86
+	case BCJ_X86:
+#endif
+#ifdef XZ_DEC_POWERPC
+	case BCJ_POWERPC:
+#endif
+#ifdef XZ_DEC_IA64
+	case BCJ_IA64:
+#endif
+#ifdef XZ_DEC_ARM
+	case BCJ_ARM:
+#endif
+#ifdef XZ_DEC_ARMTHUMB
+	case BCJ_ARMTHUMB:
+#endif
+#ifdef XZ_DEC_SPARC
+	case BCJ_SPARC:
+#endif
+		break;
+
+	default:
+		/* Unsupported Filter ID */
+		return XZ_OPTIONS_ERROR;
+	}
+
+	s->type = id;
+	s->ret = XZ_OK;
+	s->pos = 0;
+	s->x86_prev_mask = 0;
+	s->temp.filtered = 0;
+	s->temp.size = 0;
+
+	return XZ_OK;
+}
+
+#endif
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/dec_lzma2.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/dec_lzma2.c	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,1171 @@
+/*
+ * LZMA2 decoder
+ *
+ * Authors: Lasse Collin <lasse.collin@tukaani.org>
+ *          Igor Pavlov <http://7-zip.org/>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#include "private.h"
+#include "lzma2.h"
+
+/*
+ * Range decoder initialization eats the first five bytes of each LZMA chunk.
+ */
+#define RC_INIT_BYTES 5
+
+/*
+ * Minimum number of usable input buffer to safely decode one LZMA symbol.
+ * The worst case is that we decode 22 bits using probabilities and 26
+ * direct bits. This may decode at maximum of 20 bytes of input. However,
+ * lzma_main() does an extra normalization before returning, thus we
+ * need to put 21 here.
+ */
+#define LZMA_IN_REQUIRED 21
+
+/*
+ * Dictionary (history buffer)
+ *
+ * These are always true:
+ *    start <= pos <= full <= end
+ *    pos <= limit <= end
+ *
+ * In multi-call mode, also these are true:
+ *    end == size
+ *    size <= size_max
+ *    allocated <= size
+ *
+ * Most of these variables are size_t to support single-call mode,
+ * in which the dictionary variables address the actual output
+ * buffer directly.
+ */
+struct dictionary {
+	/* Beginning of the history buffer */
+	uint8_t *buf;
+
+	/* Old position in buf (before decoding more data) */
+	size_t start;
+
+	/* Position in buf */
+	size_t pos;
+
+	/*
+	 * How full dictionary is. This is used to detect corrupt input that
+	 * would read beyond the beginning of the uncompressed stream.
+	 */
+	size_t full;
+
+	/* Write limit; we don't write to buf[limit] or later bytes. */
+	size_t limit;
+
+	/*
+	 * End of the dictionary buffer. In multi-call mode, this is
+	 * the same as the dictionary size. In single-call mode, this
+	 * indicates the size of the output buffer.
+	 */
+	size_t end;
+
+	/*
+	 * Size of the dictionary as specified in Block Header. This is used
+	 * together with "full" to detect corrupt input that would make us
+	 * read beyond the beginning of the uncompressed stream.
+	 */
+	uint32_t size;
+
+	/*
+	 * Maximum allowed dictionary size in multi-call mode.
+	 * This is ignored in single-call mode.
+	 */
+	uint32_t size_max;
+
+	/*
+	 * Amount of memory currently allocated for the dictionary.
+	 * This is used only with XZ_DYNALLOC. (With XZ_PREALLOC,
+	 * size_max is always the same as the allocated size.)
+	 */
+	uint32_t allocated;
+
+	/* Operation mode */
+	enum xz_mode mode;
+};
+
+/* Range decoder */
+struct rc_dec {
+	uint32_t range;
+	uint32_t code;
+
+	/*
+	 * Number of initializing bytes remaining to be read
+	 * by rc_read_init().
+	 */
+	uint32_t init_bytes_left;
+
+	/*
+	 * Buffer from which we read our input. It can be either
+	 * temp.buf or the caller-provided input buffer.
+	 */
+	const uint8_t *in;
+	size_t in_pos;
+	size_t in_limit;
+};
+
+/* Probabilities for a length decoder. */
+struct lzma_len_dec {
+	/* Probability of match length being at least 10 */
+	uint16_t choice;
+
+	/* Probability of match length being at least 18 */
+	uint16_t choice2;
+
+	/* Probabilities for match lengths 2-9 */
+	uint16_t low[POS_STATES_MAX][LEN_LOW_SYMBOLS];
+
+	/* Probabilities for match lengths 10-17 */
+	uint16_t mid[POS_STATES_MAX][LEN_MID_SYMBOLS];
+
+	/* Probabilities for match lengths 18-273 */
+	uint16_t high[LEN_HIGH_SYMBOLS];
+};
+
+struct lzma_dec {
+	/* Distances of latest four matches */
+	uint32_t rep0;
+	uint32_t rep1;
+	uint32_t rep2;
+	uint32_t rep3;
+
+	/* Types of the most recently seen LZMA symbols */
+	enum lzma_state state;
+
+	/*
+	 * Length of a match. This is updated so that dict_repeat can
+	 * be called again to finish repeating the whole match.
+	 */
+	uint32_t len;
+
+	/*
+	 * LZMA properties or related bit masks (number of literal
+	 * context bits, a mask dervied from the number of literal
+	 * position bits, and a mask dervied from the number
+	 * position bits)
+	 */
+	uint32_t lc;
+	uint32_t literal_pos_mask; /* (1 << lp) - 1 */
+	uint32_t pos_mask;         /* (1 << pb) - 1 */
+
+	/* If 1, it's a match. Otherwise it's a single 8-bit literal. */
+	uint16_t is_match[STATES][POS_STATES_MAX];
+
+	/* If 1, it's a repeated match. The distance is one of rep0 .. rep3. */
+	uint16_t is_rep[STATES];
+
+	/*
+	 * If 0, distance of a repeated match is rep0.
+	 * Otherwise check is_rep1.
+	 */
+	uint16_t is_rep0[STATES];
+
+	/*
+	 * If 0, distance of a repeated match is rep1.
+	 * Otherwise check is_rep2.
+	 */
+	uint16_t is_rep1[STATES];
+
+	/* If 0, distance of a repeated match is rep2. Otherwise it is rep3. */
+	uint16_t is_rep2[STATES];
+
+	/*
+	 * If 1, the repeated match has length of one byte. Otherwise
+	 * the length is decoded from rep_len_decoder.
+	 */
+	uint16_t is_rep0_long[STATES][POS_STATES_MAX];
+
+	/*
+	 * Probability tree for the highest two bits of the match
+	 * distance. There is a separate probability tree for match
+	 * lengths of 2 (i.e. MATCH_LEN_MIN), 3, 4, and [5, 273].
+	 */
+	uint16_t dist_slot[DIST_STATES][DIST_SLOTS];
+
+	/*
+	 * Probility trees for additional bits for match distance
+	 * when the distance is in the range [4, 127].
+	 */
+	uint16_t dist_special[FULL_DISTANCES - DIST_MODEL_END];
+
+	/*
+	 * Probability tree for the lowest four bits of a match
+	 * distance that is equal to or greater than 128.
+	 */
+	uint16_t dist_align[ALIGN_SIZE];
+
+	/* Length of a normal match */
+	struct lzma_len_dec match_len_dec;
+
+	/* Length of a repeated match */
+	struct lzma_len_dec rep_len_dec;
+
+	/* Probabilities of literals */
+	uint16_t literal[LITERAL_CODERS_MAX][LITERAL_CODER_SIZE];
+};
+
+struct lzma2_dec {
+	/* Position in xz_dec_lzma2_run(). */
+	enum lzma2_seq {
+		SEQ_CONTROL,
+		SEQ_UNCOMPRESSED_1,
+		SEQ_UNCOMPRESSED_2,
+		SEQ_COMPRESSED_0,
+		SEQ_COMPRESSED_1,
+		SEQ_PROPERTIES,
+		SEQ_LZMA_PREPARE,
+		SEQ_LZMA_RUN,
+		SEQ_COPY
+	} sequence;
+
+	/* Next position after decoding the compressed size of the chunk. */
+	enum lzma2_seq next_sequence;
+
+	/* Uncompressed size of LZMA chunk (2 MiB at maximum) */
+	uint32_t uncompressed;
+
+	/*
+	 * Compressed size of LZMA chunk or compressed/uncompressed
+	 * size of uncompressed chunk (64 KiB at maximum)
+	 */
+	uint32_t compressed;
+
+	/*
+	 * True if dictionary reset is needed. This is false before
+	 * the first chunk (LZMA or uncompressed).
+	 */
+	bool_t need_dict_reset;
+
+	/*
+	 * True if new LZMA properties are needed. This is false
+	 * before the first LZMA chunk.
+	 */
+	bool_t need_props;
+};
+
+struct xz_dec_lzma2 {
+	/*
+	 * The order below is important on x86 to reduce code size and
+	 * it shouldn't hurt on other platforms. Everything up to and
+	 * including lzma.pos_mask are in the first 128 bytes on x86-32,
+	 * which allows using smaller instructions to access those
+	 * variables. On x86-64, fewer variables fit into the first 128
+	 * bytes, but this is still the best order without sacrificing
+	 * the readability by splitting the structures.
+	 */
+	struct rc_dec rc;
+	struct dictionary dict;
+	struct lzma2_dec lzma2;
+	struct lzma_dec lzma;
+
+	/*
+	 * Temporary buffer which holds small number of input bytes between
+	 * decoder calls. See lzma2_lzma() for details.
+	 */
+	struct {
+		uint32_t size;
+		uint8_t buf[3 * LZMA_IN_REQUIRED];
+	} temp;
+};
+
+/**************
+ * Dictionary *
+ **************/
+
+/*
+ * Reset the dictionary state. When in single-call mode, set up the beginning
+ * of the dictionary to point to the actual output buffer.
+ */
+static void INIT dict_reset(struct dictionary *dict, struct xz_buf *b)
+{
+	if (DEC_IS_SINGLE(dict->mode)) {
+		dict->buf = b->out + b->out_pos;
+		dict->end = b->out_size - b->out_pos;
+	}
+
+	dict->start = 0;
+	dict->pos = 0;
+	dict->limit = 0;
+	dict->full = 0;
+}
+
+/* Set dictionary write limit */
+static void INIT dict_limit(struct dictionary *dict, size_t out_max)
+{
+	if (dict->end - dict->pos <= out_max)
+		dict->limit = dict->end;
+	else
+		dict->limit = dict->pos + out_max;
+}
+
+/* Return true if at least one byte can be written into the dictionary. */
+static inline bool_t INIT dict_has_space(const struct dictionary *dict)
+{
+	return dict->pos < dict->limit;
+}
+
+/*
+ * Get a byte from the dictionary at the given distance. The distance is
+ * assumed to valid, or as a special case, zero when the dictionary is
+ * still empty. This special case is needed for single-call decoding to
+ * avoid writing a '\0' to the end of the destination buffer.
+ */
+static inline uint32_t INIT dict_get(const struct dictionary *dict, uint32_t dist)
+{
+	size_t offset = dict->pos - dist - 1;
+
+	if (dist >= dict->pos)
+		offset += dict->end;
+
+	return dict->full > 0 ? dict->buf[offset] : 0;
+}
+
+/*
+ * Put one byte into the dictionary. It is assumed that there is space for it.
+ */
+static inline void INIT dict_put(struct dictionary *dict, uint8_t byte)
+{
+	dict->buf[dict->pos++] = byte;
+
+	if (dict->full < dict->pos)
+		dict->full = dict->pos;
+}
+
+/*
+ * Repeat given number of bytes from the given distance. If the distance is
+ * invalid, false is returned. On success, true is returned and *len is
+ * updated to indicate how many bytes were left to be repeated.
+ */
+static bool_t INIT dict_repeat(struct dictionary *dict, uint32_t *len, uint32_t dist)
+{
+	size_t back;
+	uint32_t left;
+
+	if (dist >= dict->full || dist >= dict->size)
+		return false;
+
+	left = min_t(size_t, dict->limit - dict->pos, *len);
+	*len -= left;
+
+	back = dict->pos - dist - 1;
+	if (dist >= dict->pos)
+		back += dict->end;
+
+	do {
+		dict->buf[dict->pos++] = dict->buf[back++];
+		if (back == dict->end)
+			back = 0;
+	} while (--left > 0);
+
+	if (dict->full < dict->pos)
+		dict->full = dict->pos;
+
+	return true;
+}
+
+/* Copy uncompressed data as is from input to dictionary and output buffers. */
+static void INIT dict_uncompressed(struct dictionary *dict, struct xz_buf *b,
+				   uint32_t *left)
+{
+	size_t copy_size;
+
+	while (*left > 0 && b->in_pos < b->in_size
+			&& b->out_pos < b->out_size) {
+		copy_size = min(b->in_size - b->in_pos,
+				b->out_size - b->out_pos);
+		if (copy_size > dict->end - dict->pos)
+			copy_size = dict->end - dict->pos;
+		if (copy_size > *left)
+			copy_size = *left;
+
+		*left -= copy_size;
+
+		memcpy(dict->buf + dict->pos, b->in + b->in_pos, copy_size);
+		dict->pos += copy_size;
+
+		if (dict->full < dict->pos)
+			dict->full = dict->pos;
+
+		if (DEC_IS_MULTI(dict->mode)) {
+			if (dict->pos == dict->end)
+				dict->pos = 0;
+
+			memcpy(b->out + b->out_pos, b->in + b->in_pos,
+					copy_size);
+		}
+
+		dict->start = dict->pos;
+
+		b->out_pos += copy_size;
+		b->in_pos += copy_size;
+	}
+}
+
+/*
+ * Flush pending data from dictionary to b->out. It is assumed that there is
+ * enough space in b->out. This is guaranteed because caller uses dict_limit()
+ * before decoding data into the dictionary.
+ */
+static uint32_t INIT dict_flush(struct dictionary *dict, struct xz_buf *b)
+{
+	size_t copy_size = dict->pos - dict->start;
+
+	if (DEC_IS_MULTI(dict->mode)) {
+		if (dict->pos == dict->end)
+			dict->pos = 0;
+
+		memcpy(b->out + b->out_pos, dict->buf + dict->start,
+				copy_size);
+	}
+
+	dict->start = dict->pos;
+	b->out_pos += copy_size;
+	return copy_size;
+}
+
+/*****************
+ * Range decoder *
+ *****************/
+
+/* Reset the range decoder. */
+static void INIT rc_reset(struct rc_dec *rc)
+{
+	rc->range = (uint32_t)-1;
+	rc->code = 0;
+	rc->init_bytes_left = RC_INIT_BYTES;
+}
+
+/*
+ * Read the first five initial bytes into rc->code if they haven't been
+ * read already. (Yes, the first byte gets completely ignored.)
+ */
+static bool_t INIT rc_read_init(struct rc_dec *rc, struct xz_buf *b)
+{
+	while (rc->init_bytes_left > 0) {
+		if (b->in_pos == b->in_size)
+			return false;
+
+		rc->code = (rc->code << 8) + b->in[b->in_pos++];
+		--rc->init_bytes_left;
+	}
+
+	return true;
+}
+
+/* Return true if there may not be enough input for the next decoding loop. */
+static inline bool_t INIT rc_limit_exceeded(const struct rc_dec *rc)
+{
+	return rc->in_pos > rc->in_limit;
+}
+
+/*
+ * Return true if it is possible (from point of view of range decoder) that
+ * we have reached the end of the LZMA chunk.
+ */
+static inline bool_t INIT rc_is_finished(const struct rc_dec *rc)
+{
+	return rc->code == 0;
+}
+
+/* Read the next input byte if needed. */
+static always_inline void rc_normalize(struct rc_dec *rc)
+{
+	if (rc->range < RC_TOP_VALUE) {
+		rc->range <<= RC_SHIFT_BITS;
+		rc->code = (rc->code << RC_SHIFT_BITS) + rc->in[rc->in_pos++];
+	}
+}
+
+/*
+ * Decode one bit. In some versions, this function has been splitted in three
+ * functions so that the compiler is supposed to be able to more easily avoid
+ * an extra branch. In this particular version of the LZMA decoder, this
+ * doesn't seem to be a good idea (tested with GCC 3.3.6, 3.4.6, and 4.3.3
+ * on x86). Using a non-splitted version results in nicer looking code too.
+ *
+ * NOTE: This must return an int. Do not make it return a bool or the speed
+ * of the code generated by GCC 3.x decreases 10-15 %. (GCC 4.3 doesn't care,
+ * and it generates 10-20 % faster code than GCC 3.x from this file anyway.)
+ */
+static always_inline int rc_bit(struct rc_dec *rc, uint16_t *prob)
+{
+	uint32_t bound;
+	int bit;
+
+	rc_normalize(rc);
+	bound = (rc->range >> RC_BIT_MODEL_TOTAL_BITS) * *prob;
+	if (rc->code < bound) {
+		rc->range = bound;
+		*prob += (RC_BIT_MODEL_TOTAL - *prob) >> RC_MOVE_BITS;
+		bit = 0;
+	} else {
+		rc->range -= bound;
+		rc->code -= bound;
+		*prob -= *prob >> RC_MOVE_BITS;
+		bit = 1;
+	}
+
+	return bit;
+}
+
+/* Decode a bittree starting from the most significant bit. */
+static always_inline uint32_t rc_bittree(struct rc_dec *rc,
+					 uint16_t *probs, uint32_t limit)
+{
+	uint32_t symbol = 1;
+
+	do {
+		if (rc_bit(rc, &probs[symbol]))
+			symbol = (symbol << 1) + 1;
+		else
+			symbol <<= 1;
+	} while (symbol < limit);
+
+	return symbol;
+}
+
+/* Decode a bittree starting from the least significant bit. */
+static always_inline void rc_bittree_reverse(struct rc_dec *rc,
+					     uint16_t *probs,
+					     uint32_t *dest, uint32_t limit)
+{
+	uint32_t symbol = 1;
+	uint32_t i = 0;
+
+	do {
+		if (rc_bit(rc, &probs[symbol])) {
+			symbol = (symbol << 1) + 1;
+			*dest += 1 << i;
+		} else {
+			symbol <<= 1;
+		}
+	} while (++i < limit);
+}
+
+/* Decode direct bits (fixed fifty-fifty probability) */
+static inline void INIT rc_direct(struct rc_dec *rc, uint32_t *dest, uint32_t limit)
+{
+	uint32_t mask;
+
+	do {
+		rc_normalize(rc);
+		rc->range >>= 1;
+		rc->code -= rc->range;
+		mask = (uint32_t)0 - (rc->code >> 31);
+		rc->code += rc->range & mask;
+		*dest = (*dest << 1) + (mask + 1);
+	} while (--limit > 0);
+}
+
+/********
+ * LZMA *
+ ********/
+
+/* Get pointer to literal coder probability array. */
+static uint16_t *INIT lzma_literal_probs(struct xz_dec_lzma2 *s)
+{
+	uint32_t prev_byte = dict_get(&s->dict, 0);
+	uint32_t low = prev_byte >> (8 - s->lzma.lc);
+	uint32_t high = (s->dict.pos & s->lzma.literal_pos_mask) << s->lzma.lc;
+	return s->lzma.literal[low + high];
+}
+
+/* Decode a literal (one 8-bit byte) */
+static void INIT lzma_literal(struct xz_dec_lzma2 *s)
+{
+	uint16_t *probs;
+	uint32_t symbol;
+	uint32_t match_byte;
+	uint32_t match_bit;
+	uint32_t offset;
+	uint32_t i;
+
+	probs = lzma_literal_probs(s);
+
+	if (lzma_state_is_literal(s->lzma.state)) {
+		symbol = rc_bittree(&s->rc, probs, 0x100);
+	} else {
+		symbol = 1;
+		match_byte = dict_get(&s->dict, s->lzma.rep0) << 1;
+		offset = 0x100;
+
+		do {
+			match_bit = match_byte & offset;
+			match_byte <<= 1;
+			i = offset + match_bit + symbol;
+
+			if (rc_bit(&s->rc, &probs[i])) {
+				symbol = (symbol << 1) + 1;
+				offset &= match_bit;
+			} else {
+				symbol <<= 1;
+				offset &= ~match_bit;
+			}
+		} while (symbol < 0x100);
+	}
+
+	dict_put(&s->dict, (uint8_t)symbol);
+	lzma_state_literal(&s->lzma.state);
+}
+
+/* Decode the length of the match into s->lzma.len. */
+static void INIT lzma_len(struct xz_dec_lzma2 *s, struct lzma_len_dec *l,
+			  uint32_t pos_state)
+{
+	uint16_t *probs;
+	uint32_t limit;
+
+	if (!rc_bit(&s->rc, &l->choice)) {
+		probs = l->low[pos_state];
+		limit = LEN_LOW_SYMBOLS;
+		s->lzma.len = MATCH_LEN_MIN;
+	} else {
+		if (!rc_bit(&s->rc, &l->choice2)) {
+			probs = l->mid[pos_state];
+			limit = LEN_MID_SYMBOLS;
+			s->lzma.len = MATCH_LEN_MIN + LEN_LOW_SYMBOLS;
+		} else {
+			probs = l->high;
+			limit = LEN_HIGH_SYMBOLS;
+			s->lzma.len = MATCH_LEN_MIN + LEN_LOW_SYMBOLS
+					+ LEN_MID_SYMBOLS;
+		}
+	}
+
+	s->lzma.len += rc_bittree(&s->rc, probs, limit) - limit;
+}
+
+/* Decode a match. The distance will be stored in s->lzma.rep0. */
+static void INIT lzma_match(struct xz_dec_lzma2 *s, uint32_t pos_state)
+{
+	uint16_t *probs;
+	uint32_t dist_slot;
+	uint32_t limit;
+
+	lzma_state_match(&s->lzma.state);
+
+	s->lzma.rep3 = s->lzma.rep2;
+	s->lzma.rep2 = s->lzma.rep1;
+	s->lzma.rep1 = s->lzma.rep0;
+
+	lzma_len(s, &s->lzma.match_len_dec, pos_state);
+
+	probs = s->lzma.dist_slot[lzma_get_dist_state(s->lzma.len)];
+	dist_slot = rc_bittree(&s->rc, probs, DIST_SLOTS) - DIST_SLOTS;
+
+	if (dist_slot < DIST_MODEL_START) {
+		s->lzma.rep0 = dist_slot;
+	} else {
+		limit = (dist_slot >> 1) - 1;
+		s->lzma.rep0 = 2 + (dist_slot & 1);
+
+		if (dist_slot < DIST_MODEL_END) {
+			s->lzma.rep0 <<= limit;
+			probs = s->lzma.dist_special + s->lzma.rep0
+					- dist_slot - 1;
+			rc_bittree_reverse(&s->rc, probs,
+					&s->lzma.rep0, limit);
+		} else {
+			rc_direct(&s->rc, &s->lzma.rep0, limit - ALIGN_BITS);
+			s->lzma.rep0 <<= ALIGN_BITS;
+			rc_bittree_reverse(&s->rc, s->lzma.dist_align,
+					&s->lzma.rep0, ALIGN_BITS);
+		}
+	}
+}
+
+/*
+ * Decode a repeated match. The distance is one of the four most recently
+ * seen matches. The distance will be stored in s->lzma.rep0.
+ */
+static void INIT lzma_rep_match(struct xz_dec_lzma2 *s, uint32_t pos_state)
+{
+	uint32_t tmp;
+
+	if (!rc_bit(&s->rc, &s->lzma.is_rep0[s->lzma.state])) {
+		if (!rc_bit(&s->rc, &s->lzma.is_rep0_long[
+				s->lzma.state][pos_state])) {
+			lzma_state_short_rep(&s->lzma.state);
+			s->lzma.len = 1;
+			return;
+		}
+	} else {
+		if (!rc_bit(&s->rc, &s->lzma.is_rep1[s->lzma.state])) {
+			tmp = s->lzma.rep1;
+		} else {
+			if (!rc_bit(&s->rc, &s->lzma.is_rep2[s->lzma.state])) {
+				tmp = s->lzma.rep2;
+			} else {
+				tmp = s->lzma.rep3;
+				s->lzma.rep3 = s->lzma.rep2;
+			}
+
+			s->lzma.rep2 = s->lzma.rep1;
+		}
+
+		s->lzma.rep1 = s->lzma.rep0;
+		s->lzma.rep0 = tmp;
+	}
+
+	lzma_state_long_rep(&s->lzma.state);
+	lzma_len(s, &s->lzma.rep_len_dec, pos_state);
+}
+
+/* LZMA decoder core */
+static bool_t INIT lzma_main(struct xz_dec_lzma2 *s)
+{
+	uint32_t pos_state;
+
+	/*
+	 * If the dictionary was reached during the previous call, try to
+	 * finish the possibly pending repeat in the dictionary.
+	 */
+	if (dict_has_space(&s->dict) && s->lzma.len > 0)
+		dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0);
+
+	/*
+	 * Decode more LZMA symbols. One iteration may consume up to
+	 * LZMA_IN_REQUIRED - 1 bytes.
+	 */
+	while (dict_has_space(&s->dict) && !rc_limit_exceeded(&s->rc)) {
+		pos_state = s->dict.pos & s->lzma.pos_mask;
+
+		if (!rc_bit(&s->rc, &s->lzma.is_match[
+				s->lzma.state][pos_state])) {
+			lzma_literal(s);
+		} else {
+			if (rc_bit(&s->rc, &s->lzma.is_rep[s->lzma.state]))
+				lzma_rep_match(s, pos_state);
+			else
+				lzma_match(s, pos_state);
+
+			if (!dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0))
+				return false;
+		}
+	}
+
+	/*
+	 * Having the range decoder always normalized when we are outside
+	 * this function makes it easier to correctly handle end of the chunk.
+	 */
+	rc_normalize(&s->rc);
+
+	return true;
+}
+
+/*
+ * Reset the LZMA decoder and range decoder state. Dictionary is nore reset
+ * here, because LZMA state may be reset without resetting the dictionary.
+ */
+static void INIT lzma_reset(struct xz_dec_lzma2 *s)
+{
+	uint16_t *probs;
+	size_t i;
+
+	s->lzma.state = STATE_LIT_LIT;
+	s->lzma.rep0 = 0;
+	s->lzma.rep1 = 0;
+	s->lzma.rep2 = 0;
+	s->lzma.rep3 = 0;
+
+	/*
+	 * All probabilities are initialized to the same value. This hack
+	 * makes the code smaller by avoiding a separate loop for each
+	 * probability array.
+	 *
+	 * This could be optimized so that only that part of literal
+	 * probabilities that are actually required. In the common case
+	 * we would write 12 KiB less.
+	 */
+	probs = s->lzma.is_match[0];
+	for (i = 0; i < PROBS_TOTAL; ++i)
+		probs[i] = RC_BIT_MODEL_TOTAL / 2;
+
+	rc_reset(&s->rc);
+}
+
+/*
+ * Decode and validate LZMA properties (lc/lp/pb) and calculate the bit masks
+ * from the decoded lp and pb values. On success, the LZMA decoder state is
+ * reset and true is returned.
+ */
+static bool_t INIT lzma_props(struct xz_dec_lzma2 *s, uint8_t props)
+{
+	if (props > (4 * 5 + 4) * 9 + 8)
+		return false;
+
+	s->lzma.pos_mask = 0;
+	while (props >= 9 * 5) {
+		props -= 9 * 5;
+		++s->lzma.pos_mask;
+	}
+
+	s->lzma.pos_mask = (1 << s->lzma.pos_mask) - 1;
+
+	s->lzma.literal_pos_mask = 0;
+	while (props >= 9) {
+		props -= 9;
+		++s->lzma.literal_pos_mask;
+	}
+
+	s->lzma.lc = props;
+
+	if (s->lzma.lc + s->lzma.literal_pos_mask > 4)
+		return false;
+
+	s->lzma.literal_pos_mask = (1 << s->lzma.literal_pos_mask) - 1;
+
+	lzma_reset(s);
+
+	return true;
+}
+
+/*********
+ * LZMA2 *
+ *********/
+
+/*
+ * The LZMA decoder assumes that if the input limit (s->rc.in_limit) hasn't
+ * been exceeded, it is safe to read up to LZMA_IN_REQUIRED bytes. This
+ * wrapper function takes care of making the LZMA decoder's assumption safe.
+ *
+ * As long as there is plenty of input left to be decoded in the current LZMA
+ * chunk, we decode directly from the caller-supplied input buffer until
+ * there's LZMA_IN_REQUIRED bytes left. Those remaining bytes are copied into
+ * s->temp.buf, which (hopefully) gets filled on the next call to this
+ * function. We decode a few bytes from the temporary buffer so that we can
+ * continue decoding from the caller-supplied input buffer again.
+ */
+static bool_t INIT lzma2_lzma(struct xz_dec_lzma2 *s, struct xz_buf *b)
+{
+	size_t in_avail;
+	uint32_t tmp;
+
+	in_avail = b->in_size - b->in_pos;
+	if (s->temp.size > 0 || s->lzma2.compressed == 0) {
+		tmp = 2 * LZMA_IN_REQUIRED - s->temp.size;
+		if (tmp > s->lzma2.compressed - s->temp.size)
+			tmp = s->lzma2.compressed - s->temp.size;
+		if (tmp > in_avail)
+			tmp = in_avail;
+
+		memcpy(s->temp.buf + s->temp.size, b->in + b->in_pos, tmp);
+
+		if (s->temp.size + tmp == s->lzma2.compressed) {
+			memzero(s->temp.buf + s->temp.size + tmp,
+					sizeof(s->temp.buf)
+						- s->temp.size - tmp);
+			s->rc.in_limit = s->temp.size + tmp;
+		} else if (s->temp.size + tmp < LZMA_IN_REQUIRED) {
+			s->temp.size += tmp;
+			b->in_pos += tmp;
+			return true;
+		} else {
+			s->rc.in_limit = s->temp.size + tmp - LZMA_IN_REQUIRED;
+		}
+
+		s->rc.in = s->temp.buf;
+		s->rc.in_pos = 0;
+
+		if (!lzma_main(s) || s->rc.in_pos > s->temp.size + tmp)
+			return false;
+
+		s->lzma2.compressed -= s->rc.in_pos;
+
+		if (s->rc.in_pos < s->temp.size) {
+			s->temp.size -= s->rc.in_pos;
+			memmove(s->temp.buf, s->temp.buf + s->rc.in_pos,
+					s->temp.size);
+			return true;
+		}
+
+		b->in_pos += s->rc.in_pos - s->temp.size;
+		s->temp.size = 0;
+	}
+
+	in_avail = b->in_size - b->in_pos;
+	if (in_avail >= LZMA_IN_REQUIRED) {
+		s->rc.in = b->in;
+		s->rc.in_pos = b->in_pos;
+
+		if (in_avail >= s->lzma2.compressed + LZMA_IN_REQUIRED)
+			s->rc.in_limit = b->in_pos + s->lzma2.compressed;
+		else
+			s->rc.in_limit = b->in_size - LZMA_IN_REQUIRED;
+
+		if (!lzma_main(s))
+			return false;
+
+		in_avail = s->rc.in_pos - b->in_pos;
+		if (in_avail > s->lzma2.compressed)
+			return false;
+
+		s->lzma2.compressed -= in_avail;
+		b->in_pos = s->rc.in_pos;
+	}
+
+	in_avail = b->in_size - b->in_pos;
+	if (in_avail < LZMA_IN_REQUIRED) {
+		if (in_avail > s->lzma2.compressed)
+			in_avail = s->lzma2.compressed;
+
+		memcpy(s->temp.buf, b->in + b->in_pos, in_avail);
+		s->temp.size = in_avail;
+		b->in_pos += in_avail;
+	}
+
+	return true;
+}
+
+/*
+ * Take care of the LZMA2 control layer, and forward the job of actual LZMA
+ * decoding or copying of uncompressed chunks to other functions.
+ */
+XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
+					    struct xz_buf *b)
+{
+	uint32_t tmp;
+
+	while (b->in_pos < b->in_size || s->lzma2.sequence == SEQ_LZMA_RUN) {
+		switch (s->lzma2.sequence) {
+		case SEQ_CONTROL:
+			/*
+			 * LZMA2 control byte
+			 *
+			 * Exact values:
+			 *   0x00   End marker
+			 *   0x01   Dictionary reset followed by
+			 *          an uncompressed chunk
+			 *   0x02   Uncompressed chunk (no dictionary reset)
+			 *
+			 * Highest three bits (s->control & 0xE0):
+			 *   0xE0   Dictionary reset, new properties and state
+			 *          reset, followed by LZMA compressed chunk
+			 *   0xC0   New properties and state reset, followed
+			 *          by LZMA compressed chunk (no dictionary
+			 *          reset)
+			 *   0xA0   State reset using old properties,
+			 *          followed by LZMA compressed chunk (no
+			 *          dictionary reset)
+			 *   0x80   LZMA chunk (no dictionary or state reset)
+			 *
+			 * For LZMA compressed chunks, the lowest five bits
+			 * (s->control & 1F) are the highest bits of the
+			 * uncompressed size (bits 16-20).
+			 *
+			 * A new LZMA2 stream must begin with a dictionary
+			 * reset. The first LZMA chunk must set new
+			 * properties and reset the LZMA state.
+			 *
+			 * Values that don't match anything described above
+			 * are invalid and we return XZ_DATA_ERROR.
+			 */
+			tmp = b->in[b->in_pos++];
+
+			if (tmp >= 0xE0 || tmp == 0x01) {
+				s->lzma2.need_props = true;
+				s->lzma2.need_dict_reset = false;
+				dict_reset(&s->dict, b);
+			} else if (s->lzma2.need_dict_reset) {
+				return XZ_DATA_ERROR;
+			}
+
+			if (tmp >= 0x80) {
+				s->lzma2.uncompressed = (tmp & 0x1F) << 16;
+				s->lzma2.sequence = SEQ_UNCOMPRESSED_1;
+
+				if (tmp >= 0xC0) {
+					/*
+					 * When there are new properties,
+					 * state reset is done at
+					 * SEQ_PROPERTIES.
+					 */
+					s->lzma2.need_props = false;
+					s->lzma2.next_sequence
+							= SEQ_PROPERTIES;
+
+				} else if (s->lzma2.need_props) {
+					return XZ_DATA_ERROR;
+
+				} else {
+					s->lzma2.next_sequence
+							= SEQ_LZMA_PREPARE;
+					if (tmp >= 0xA0)
+						lzma_reset(s);
+				}
+			} else {
+				if (tmp == 0x00)
+					return XZ_STREAM_END;
+
+				if (tmp > 0x02)
+					return XZ_DATA_ERROR;
+
+				s->lzma2.sequence = SEQ_COMPRESSED_0;
+				s->lzma2.next_sequence = SEQ_COPY;
+			}
+
+			break;
+
+		case SEQ_UNCOMPRESSED_1:
+			s->lzma2.uncompressed
+					+= (uint32_t)b->in[b->in_pos++] << 8;
+			s->lzma2.sequence = SEQ_UNCOMPRESSED_2;
+			break;
+
+		case SEQ_UNCOMPRESSED_2:
+			s->lzma2.uncompressed
+					+= (uint32_t)b->in[b->in_pos++] + 1;
+			s->lzma2.sequence = SEQ_COMPRESSED_0;
+			break;
+
+		case SEQ_COMPRESSED_0:
+			s->lzma2.compressed
+					= (uint32_t)b->in[b->in_pos++] << 8;
+			s->lzma2.sequence = SEQ_COMPRESSED_1;
+			break;
+
+		case SEQ_COMPRESSED_1:
+			s->lzma2.compressed
+					+= (uint32_t)b->in[b->in_pos++] + 1;
+			s->lzma2.sequence = s->lzma2.next_sequence;
+			break;
+
+		case SEQ_PROPERTIES:
+			if (!lzma_props(s, b->in[b->in_pos++]))
+				return XZ_DATA_ERROR;
+
+			s->lzma2.sequence = SEQ_LZMA_PREPARE;
+
+		case SEQ_LZMA_PREPARE:
+			if (s->lzma2.compressed < RC_INIT_BYTES)
+				return XZ_DATA_ERROR;
+
+			if (!rc_read_init(&s->rc, b))
+				return XZ_OK;
+
+			s->lzma2.compressed -= RC_INIT_BYTES;
+			s->lzma2.sequence = SEQ_LZMA_RUN;
+
+		case SEQ_LZMA_RUN:
+			/*
+			 * Set dictionary limit to indicate how much we want
+			 * to be encoded at maximum. Decode new data into the
+			 * dictionary. Flush the new data from dictionary to
+			 * b->out. Check if we finished decoding this chunk.
+			 * In case the dictionary got full but we didn't fill
+			 * the output buffer yet, we may run this loop
+			 * multiple times without changing s->lzma2.sequence.
+			 */
+			dict_limit(&s->dict, min_t(size_t,
+					b->out_size - b->out_pos,
+					s->lzma2.uncompressed));
+			if (!lzma2_lzma(s, b))
+				return XZ_DATA_ERROR;
+
+			s->lzma2.uncompressed -= dict_flush(&s->dict, b);
+
+			if (s->lzma2.uncompressed == 0) {
+				if (s->lzma2.compressed > 0 || s->lzma.len > 0
+						|| !rc_is_finished(&s->rc))
+					return XZ_DATA_ERROR;
+
+				rc_reset(&s->rc);
+				s->lzma2.sequence = SEQ_CONTROL;
+
+			} else if (b->out_pos == b->out_size
+					|| (b->in_pos == b->in_size
+						&& s->temp.size
+						< s->lzma2.compressed)) {
+				return XZ_OK;
+			}
+
+			break;
+
+		case SEQ_COPY:
+			dict_uncompressed(&s->dict, b, &s->lzma2.compressed);
+			if (s->lzma2.compressed > 0)
+				return XZ_OK;
+
+			s->lzma2.sequence = SEQ_CONTROL;
+			break;
+		}
+	}
+
+	return XZ_OK;
+}
+
+XZ_EXTERN struct xz_dec_lzma2 *INIT xz_dec_lzma2_create(enum xz_mode mode,
+						   uint32_t dict_max)
+{
+	struct xz_dec_lzma2 *s = malloc(sizeof(*s));
+	if (s == NULL)
+		return NULL;
+
+	s->dict.mode = mode;
+	s->dict.size_max = dict_max;
+
+	if (DEC_IS_PREALLOC(mode)) {
+		s->dict.buf = large_malloc(dict_max);
+		if (s->dict.buf == NULL) {
+			free(s);
+			return NULL;
+		}
+	} else if (DEC_IS_DYNALLOC(mode)) {
+		s->dict.buf = NULL;
+		s->dict.allocated = 0;
+	}
+
+	return s;
+}
+
+XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_reset(struct xz_dec_lzma2 *s, uint8_t props)
+{
+	/* This limits dictionary size to 3 GiB to keep parsing simpler. */
+	if (props > 39)
+		return XZ_OPTIONS_ERROR;
+
+	s->dict.size = 2 + (props & 1);
+	s->dict.size <<= (props >> 1) + 11;
+
+	if (DEC_IS_MULTI(s->dict.mode)) {
+		if (s->dict.size > s->dict.size_max)
+			return XZ_MEMLIMIT_ERROR;
+
+		s->dict.end = s->dict.size;
+
+		if (DEC_IS_DYNALLOC(s->dict.mode)) {
+			if (s->dict.allocated < s->dict.size) {
+				large_free(s->dict.buf);
+				s->dict.buf = large_malloc(s->dict.size);
+				if (s->dict.buf == NULL) {
+					s->dict.allocated = 0;
+					return XZ_MEM_ERROR;
+				}
+			}
+		}
+	}
+
+	s->lzma.len = 0;
+
+	s->lzma2.sequence = SEQ_CONTROL;
+	s->lzma2.need_dict_reset = true;
+
+	s->temp.size = 0;
+
+	return XZ_OK;
+}
+
+XZ_EXTERN void INIT xz_dec_lzma2_end(struct xz_dec_lzma2 *s)
+{
+	if (DEC_IS_MULTI(s->dict.mode))
+		large_free(s->dict.buf);
+
+	free(s);
+}
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/dec_stream.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/dec_stream.c	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,821 @@
+/*
+ * .xz Stream decoder
+ *
+ * Author: Lasse Collin <lasse.collin@tukaani.org>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#include "private.h"
+#include "stream.h"
+
+/* Hash used to validate the Index field */
+struct xz_dec_hash {
+	vli_type unpadded;
+	vli_type uncompressed;
+	uint32_t crc32;
+};
+
+struct xz_dec {
+	/* Position in dec_main() */
+	enum {
+		SEQ_STREAM_HEADER,
+		SEQ_BLOCK_START,
+		SEQ_BLOCK_HEADER,
+		SEQ_BLOCK_UNCOMPRESS,
+		SEQ_BLOCK_PADDING,
+		SEQ_BLOCK_CHECK,
+		SEQ_INDEX,
+		SEQ_INDEX_PADDING,
+		SEQ_INDEX_CRC32,
+		SEQ_STREAM_FOOTER
+	} sequence;
+
+	/* Position in variable-length integers and Check fields */
+	uint32_t pos;
+
+	/* Variable-length integer decoded by dec_vli() */
+	vli_type vli;
+
+	/* Saved in_pos and out_pos */
+	size_t in_start;
+	size_t out_start;
+
+	/* CRC32 value in Block or Index */
+	uint32_t crc32;
+
+	/* Type of the integrity check calculated from uncompressed data */
+	enum xz_check check_type;
+
+	/* Operation mode */
+	enum xz_mode mode;
+
+	/*
+	 * True if the next call to xz_dec_run() is allowed to return
+	 * XZ_BUF_ERROR.
+	 */
+	bool_t allow_buf_error;
+
+	/* Information stored in Block Header */
+	struct {
+		/*
+		 * Value stored in the Compressed Size field, or
+		 * VLI_UNKNOWN if Compressed Size is not present.
+		 */
+		vli_type compressed;
+
+		/*
+		 * Value stored in the Uncompressed Size field, or
+		 * VLI_UNKNOWN if Uncompressed Size is not present.
+		 */
+		vli_type uncompressed;
+
+		/* Size of the Block Header field */
+		uint32_t size;
+	} block_header;
+
+	/* Information collected when decoding Blocks */
+	struct {
+		/* Observed compressed size of the current Block */
+		vli_type compressed;
+
+		/* Observed uncompressed size of the current Block */
+		vli_type uncompressed;
+
+		/* Number of Blocks decoded so far */
+		vli_type count;
+
+		/*
+		 * Hash calculated from the Block sizes. This is used to
+		 * validate the Index field.
+		 */
+		struct xz_dec_hash hash;
+	} block;
+
+	/* Variables needed when verifying the Index field */
+	struct {
+		/* Position in dec_index() */
+		enum {
+			SEQ_INDEX_COUNT,
+			SEQ_INDEX_UNPADDED,
+			SEQ_INDEX_UNCOMPRESSED
+		} sequence;
+
+		/* Size of the Index in bytes */
+		vli_type size;
+
+		/* Number of Records (matches block.count in valid files) */
+		vli_type count;
+
+		/*
+		 * Hash calculated from the Records (matches block.hash in
+		 * valid files).
+		 */
+		struct xz_dec_hash hash;
+	} index;
+
+	/*
+	 * Temporary buffer needed to hold Stream Header, Block Header,
+	 * and Stream Footer. The Block Header is the biggest (1 KiB)
+	 * so we reserve space according to that. buf[] has to be aligned
+	 * to a multiple of four bytes; the size_t variables before it
+	 * should guarantee this.
+	 */
+	struct {
+		size_t pos;
+		size_t size;
+		uint8_t buf[1024];
+	} temp;
+
+	struct xz_dec_lzma2 *lzma2;
+
+#ifdef XZ_DEC_BCJ
+	struct xz_dec_bcj *bcj;
+	bool_t bcj_active;
+#endif
+};
+
+#ifdef XZ_DEC_ANY_CHECK
+/* Sizes of the Check field with different Check IDs */
+static const uint8_t check_sizes[16] = {
+	0,
+	4, 4, 4,
+	8, 8, 8,
+	16, 16, 16,
+	32, 32, 32,
+	64, 64, 64
+};
+#endif
+
+/*
+ * Fill s->temp by copying data starting from b->in[b->in_pos]. Caller
+ * must have set s->temp.pos to indicate how much data we are supposed
+ * to copy into s->temp.buf. Return true once s->temp.pos has reached
+ * s->temp.size.
+ */
+static bool_t INIT fill_temp(struct xz_dec *s, struct xz_buf *b)
+{
+	size_t copy_size = min_t(size_t,
+			b->in_size - b->in_pos, s->temp.size - s->temp.pos);
+
+	memcpy(s->temp.buf + s->temp.pos, b->in + b->in_pos, copy_size);
+	b->in_pos += copy_size;
+	s->temp.pos += copy_size;
+
+	if (s->temp.pos == s->temp.size) {
+		s->temp.pos = 0;
+		return true;
+	}
+
+	return false;
+}
+
+/* Decode a variable-length integer (little-endian base-128 encoding) */
+static enum xz_ret INIT dec_vli(struct xz_dec *s, const uint8_t *in,
+				size_t *in_pos, size_t in_size)
+{
+	uint8_t byte;
+
+	if (s->pos == 0)
+		s->vli = 0;
+
+	while (*in_pos < in_size) {
+		byte = in[*in_pos];
+		++*in_pos;
+
+		s->vli |= (vli_type)(byte & 0x7F) << s->pos;
+
+		if ((byte & 0x80) == 0) {
+			/* Don't allow non-minimal encodings. */
+			if (byte == 0 && s->pos != 0)
+				return XZ_DATA_ERROR;
+
+			s->pos = 0;
+			return XZ_STREAM_END;
+		}
+
+		s->pos += 7;
+		if (s->pos == 7 * VLI_BYTES_MAX)
+			return XZ_DATA_ERROR;
+	}
+
+	return XZ_OK;
+}
+
+/*
+ * Decode the Compressed Data field from a Block. Update and validate
+ * the observed compressed and uncompressed sizes of the Block so that
+ * they don't exceed the values possibly stored in the Block Header
+ * (validation assumes that no integer overflow occurs, since vli_type
+ * is normally uint64_t). Update the CRC32 if presence of the CRC32
+ * field was indicated in Stream Header.
+ *
+ * Once the decoding is finished, validate that the observed sizes match
+ * the sizes possibly stored in the Block Header. Update the hash and
+ * Block count, which are later used to validate the Index field.
+ */
+static enum xz_ret INIT dec_block(struct xz_dec *s, struct xz_buf *b)
+{
+	enum xz_ret ret;
+
+	s->in_start = b->in_pos;
+	s->out_start = b->out_pos;
+
+#ifdef XZ_DEC_BCJ
+	if (s->bcj_active)
+		ret = xz_dec_bcj_run(s->bcj, s->lzma2, b);
+	else
+#endif
+		ret = xz_dec_lzma2_run(s->lzma2, b);
+
+	s->block.compressed += b->in_pos - s->in_start;
+	s->block.uncompressed += b->out_pos - s->out_start;
+
+	/*
+	 * There is no need to separately check for VLI_UNKNOWN, since
+	 * the observed sizes are always smaller than VLI_UNKNOWN.
+	 */
+	if (s->block.compressed > s->block_header.compressed
+			|| s->block.uncompressed
+				> s->block_header.uncompressed)
+		return XZ_DATA_ERROR;
+
+	if (s->check_type == XZ_CHECK_CRC32)
+		s->crc32 = xz_crc32(b->out + s->out_start,
+				b->out_pos - s->out_start, s->crc32);
+
+	if (ret == XZ_STREAM_END) {
+		if (s->block_header.compressed != VLI_UNKNOWN
+				&& s->block_header.compressed
+					!= s->block.compressed)
+			return XZ_DATA_ERROR;
+
+		if (s->block_header.uncompressed != VLI_UNKNOWN
+				&& s->block_header.uncompressed
+					!= s->block.uncompressed)
+			return XZ_DATA_ERROR;
+
+		s->block.hash.unpadded += s->block_header.size
+				+ s->block.compressed;
+
+#ifdef XZ_DEC_ANY_CHECK
+		s->block.hash.unpadded += check_sizes[s->check_type];
+#else
+		if (s->check_type == XZ_CHECK_CRC32)
+			s->block.hash.unpadded += 4;
+#endif
+
+		s->block.hash.uncompressed += s->block.uncompressed;
+		s->block.hash.crc32 = xz_crc32(
+				(const uint8_t *)&s->block.hash,
+				sizeof(s->block.hash), s->block.hash.crc32);
+
+		++s->block.count;
+	}
+
+	return ret;
+}
+
+/* Update the Index size and the CRC32 value. */
+static void INIT index_update(struct xz_dec *s, const struct xz_buf *b)
+{
+	size_t in_used = b->in_pos - s->in_start;
+	s->index.size += in_used;
+	s->crc32 = xz_crc32(b->in + s->in_start, in_used, s->crc32);
+}
+
+/*
+ * Decode the Number of Records, Unpadded Size, and Uncompressed Size
+ * fields from the Index field. That is, Index Padding and CRC32 are not
+ * decoded by this function.
+ *
+ * This can return XZ_OK (more input needed), XZ_STREAM_END (everything
+ * successfully decoded), or XZ_DATA_ERROR (input is corrupt).
+ */
+static enum xz_ret INIT dec_index(struct xz_dec *s, struct xz_buf *b)
+{
+	enum xz_ret ret;
+
+	do {
+		ret = dec_vli(s, b->in, &b->in_pos, b->in_size);
+		if (ret != XZ_STREAM_END) {
+			index_update(s, b);
+			return ret;
+		}
+
+		switch (s->index.sequence) {
+		case SEQ_INDEX_COUNT:
+			s->index.count = s->vli;
+
+			/*
+			 * Validate that the Number of Records field
+			 * indicates the same number of Records as
+			 * there were Blocks in the Stream.
+			 */
+			if (s->index.count != s->block.count)
+				return XZ_DATA_ERROR;
+
+			s->index.sequence = SEQ_INDEX_UNPADDED;
+			break;
+
+		case SEQ_INDEX_UNPADDED:
+			s->index.hash.unpadded += s->vli;
+			s->index.sequence = SEQ_INDEX_UNCOMPRESSED;
+			break;
+
+		case SEQ_INDEX_UNCOMPRESSED:
+			s->index.hash.uncompressed += s->vli;
+			s->index.hash.crc32 = xz_crc32(
+					(const uint8_t *)&s->index.hash,
+					sizeof(s->index.hash),
+					s->index.hash.crc32);
+			--s->index.count;
+			s->index.sequence = SEQ_INDEX_UNPADDED;
+			break;
+		}
+	} while (s->index.count > 0);
+
+	return XZ_STREAM_END;
+}
+
+/*
+ * Validate that the next four input bytes match the value of s->crc32.
+ * s->pos must be zero when starting to validate the first byte.
+ */
+static enum xz_ret INIT crc32_validate(struct xz_dec *s, struct xz_buf *b)
+{
+	do {
+		if (b->in_pos == b->in_size)
+			return XZ_OK;
+
+		if (((s->crc32 >> s->pos) & 0xFF) != b->in[b->in_pos++])
+			return XZ_DATA_ERROR;
+
+		s->pos += 8;
+
+	} while (s->pos < 32);
+
+	s->crc32 = 0;
+	s->pos = 0;
+
+	return XZ_STREAM_END;
+}
+
+#ifdef XZ_DEC_ANY_CHECK
+/*
+ * Skip over the Check field when the Check ID is not supported.
+ * Returns true once the whole Check field has been skipped over.
+ */
+static bool_t INIT check_skip(struct xz_dec *s, struct xz_buf *b)
+{
+	while (s->pos < check_sizes[s->check_type]) {
+		if (b->in_pos == b->in_size)
+			return false;
+
+		++b->in_pos;
+		++s->pos;
+	}
+
+	s->pos = 0;
+
+	return true;
+}
+#endif
+
+/* Decode the Stream Header field (the first 12 bytes of the .xz Stream). */
+static enum xz_ret INIT dec_stream_header(struct xz_dec *s)
+{
+	if (!memeq(s->temp.buf, HEADER_MAGIC, HEADER_MAGIC_SIZE))
+		return XZ_FORMAT_ERROR;
+
+	if (xz_crc32(s->temp.buf + HEADER_MAGIC_SIZE, 2, 0)
+			!= get_le32(s->temp.buf + HEADER_MAGIC_SIZE + 2))
+		return XZ_DATA_ERROR;
+
+	if (s->temp.buf[HEADER_MAGIC_SIZE] != 0)
+		return XZ_OPTIONS_ERROR;
+
+	/*
+	 * Of integrity checks, we support only none (Check ID = 0) and
+	 * CRC32 (Check ID = 1). However, if XZ_DEC_ANY_CHECK is defined,
+	 * we will accept other check types too, but then the check won't
+	 * be verified and a warning (XZ_UNSUPPORTED_CHECK) will be given.
+	 */
+	s->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1];
+
+#ifdef XZ_DEC_ANY_CHECK
+	if (s->check_type > XZ_CHECK_MAX)
+		return XZ_OPTIONS_ERROR;
+
+	if (s->check_type > XZ_CHECK_CRC32)
+		return XZ_UNSUPPORTED_CHECK;
+#else
+	if (s->check_type > XZ_CHECK_CRC32)
+		return XZ_OPTIONS_ERROR;
+#endif
+
+	return XZ_OK;
+}
+
+/* Decode the Stream Footer field (the last 12 bytes of the .xz Stream) */
+static enum xz_ret INIT dec_stream_footer(struct xz_dec *s)
+{
+	if (!memeq(s->temp.buf + 10, FOOTER_MAGIC, FOOTER_MAGIC_SIZE))
+		return XZ_DATA_ERROR;
+
+	if (xz_crc32(s->temp.buf + 4, 6, 0) != get_le32(s->temp.buf))
+		return XZ_DATA_ERROR;
+
+	/*
+	 * Validate Backward Size. Note that we never added the size of the
+	 * Index CRC32 field to s->index.size, thus we use s->index.size / 4
+	 * instead of s->index.size / 4 - 1.
+	 */
+	if ((s->index.size >> 2) != get_le32(s->temp.buf + 4))
+		return XZ_DATA_ERROR;
+
+	if (s->temp.buf[8] != 0 || s->temp.buf[9] != s->check_type)
+		return XZ_DATA_ERROR;
+
+	/*
+	 * Use XZ_STREAM_END instead of XZ_OK to be more convenient
+	 * for the caller.
+	 */
+	return XZ_STREAM_END;
+}
+
+/* Decode the Block Header and initialize the filter chain. */
+static enum xz_ret INIT dec_block_header(struct xz_dec *s)
+{
+	enum xz_ret ret;
+
+	/*
+	 * Validate the CRC32. We know that the temp buffer is at least
+	 * eight bytes so this is safe.
+	 */
+	s->temp.size -= 4;
+	if (xz_crc32(s->temp.buf, s->temp.size, 0)
+			!= get_le32(s->temp.buf + s->temp.size))
+		return XZ_DATA_ERROR;
+
+	s->temp.pos = 2;
+
+	/*
+	 * Catch unsupported Block Flags. We support only one or two filters
+	 * in the chain, so we catch that with the same test.
+	 */
+#ifdef XZ_DEC_BCJ
+	if (s->temp.buf[1] & 0x3E)
+#else
+	if (s->temp.buf[1] & 0x3F)
+#endif
+		return XZ_OPTIONS_ERROR;
+
+	/* Compressed Size */
+	if (s->temp.buf[1] & 0x40) {
+		if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)
+					!= XZ_STREAM_END)
+			return XZ_DATA_ERROR;
+
+		s->block_header.compressed = s->vli;
+	} else {
+		s->block_header.compressed = VLI_UNKNOWN;
+	}
+
+	/* Uncompressed Size */
+	if (s->temp.buf[1] & 0x80) {
+		if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)
+				!= XZ_STREAM_END)
+			return XZ_DATA_ERROR;
+
+		s->block_header.uncompressed = s->vli;
+	} else {
+		s->block_header.uncompressed = VLI_UNKNOWN;
+	}
+
+#ifdef XZ_DEC_BCJ
+	/* If there are two filters, the first one must be a BCJ filter. */
+	s->bcj_active = s->temp.buf[1] & 0x01;
+	if (s->bcj_active) {
+		if (s->temp.size - s->temp.pos < 2)
+			return XZ_OPTIONS_ERROR;
+
+		ret = xz_dec_bcj_reset(s->bcj, s->temp.buf[s->temp.pos++]);
+		if (ret != XZ_OK)
+			return ret;
+
+		/*
+		 * We don't support custom start offset,
+		 * so Size of Properties must be zero.
+		 */
+		if (s->temp.buf[s->temp.pos++] != 0x00)
+			return XZ_OPTIONS_ERROR;
+	}
+#endif
+
+	/* Valid Filter Flags always take at least two bytes. */
+	if (s->temp.size - s->temp.pos < 2)
+		return XZ_DATA_ERROR;
+
+	/* Filter ID = LZMA2 */
+	if (s->temp.buf[s->temp.pos++] != 0x21)
+		return XZ_OPTIONS_ERROR;
+
+	/* Size of Properties = 1-byte Filter Properties */
+	if (s->temp.buf[s->temp.pos++] != 0x01)
+		return XZ_OPTIONS_ERROR;
+
+	/* Filter Properties contains LZMA2 dictionary size. */
+	if (s->temp.size - s->temp.pos < 1)
+		return XZ_DATA_ERROR;
+
+	ret = xz_dec_lzma2_reset(s->lzma2, s->temp.buf[s->temp.pos++]);
+	if (ret != XZ_OK)
+		return ret;
+
+	/* The rest must be Header Padding. */
+	while (s->temp.pos < s->temp.size)
+		if (s->temp.buf[s->temp.pos++] != 0x00)
+			return XZ_OPTIONS_ERROR;
+
+	s->temp.pos = 0;
+	s->block.compressed = 0;
+	s->block.uncompressed = 0;
+
+	return XZ_OK;
+}
+
+static enum xz_ret INIT dec_main(struct xz_dec *s, struct xz_buf *b)
+{
+	enum xz_ret ret;
+
+	/*
+	 * Store the start position for the case when we are in the middle
+	 * of the Index field.
+	 */
+	s->in_start = b->in_pos;
+
+	while (true) {
+		switch (s->sequence) {
+		case SEQ_STREAM_HEADER:
+			/*
+			 * Stream Header is copied to s->temp, and then
+			 * decoded from there. This way if the caller
+			 * gives us only little input at a time, we can
+			 * still keep the Stream Header decoding code
+			 * simple. Similar approach is used in many places
+			 * in this file.
+			 */
+			if (!fill_temp(s, b))
+				return XZ_OK;
+
+			/*
+			 * If dec_stream_header() returns
+			 * XZ_UNSUPPORTED_CHECK, it is still possible
+			 * to continue decoding if working in multi-call
+			 * mode. Thus, update s->sequence before calling
+			 * dec_stream_header().
+			 */
+			s->sequence = SEQ_BLOCK_START;
+
+			ret = dec_stream_header(s);
+			if (ret != XZ_OK)
+				return ret;
+
+		case SEQ_BLOCK_START:
+			/* We need one byte of input to continue. */
+			if (b->in_pos == b->in_size)
+				return XZ_OK;
+
+			/* See if this is the beginning of the Index field. */
+			if (b->in[b->in_pos] == 0) {
+				s->in_start = b->in_pos++;
+				s->sequence = SEQ_INDEX;
+				break;
+			}
+
+			/*
+			 * Calculate the size of the Block Header and
+			 * prepare to decode it.
+			 */
+			s->block_header.size
+				= ((uint32_t)b->in[b->in_pos] + 1) * 4;
+
+			s->temp.size = s->block_header.size;
+			s->temp.pos = 0;
+			s->sequence = SEQ_BLOCK_HEADER;
+
+		case SEQ_BLOCK_HEADER:
+			if (!fill_temp(s, b))
+				return XZ_OK;
+
+			ret = dec_block_header(s);
+			if (ret != XZ_OK)
+				return ret;
+
+			s->sequence = SEQ_BLOCK_UNCOMPRESS;
+
+		case SEQ_BLOCK_UNCOMPRESS:
+			ret = dec_block(s, b);
+			if (ret != XZ_STREAM_END)
+				return ret;
+
+			s->sequence = SEQ_BLOCK_PADDING;
+
+		case SEQ_BLOCK_PADDING:
+			/*
+			 * Size of Compressed Data + Block Padding
+			 * must be a multiple of four. We don't need
+			 * s->block.compressed for anything else
+			 * anymore, so we use it here to test the size
+			 * of the Block Padding field.
+			 */
+			while (s->block.compressed & 3) {
+				if (b->in_pos == b->in_size)
+					return XZ_OK;
+
+				if (b->in[b->in_pos++] != 0)
+					return XZ_DATA_ERROR;
+
+				++s->block.compressed;
+			}
+
+			s->sequence = SEQ_BLOCK_CHECK;
+
+		case SEQ_BLOCK_CHECK:
+			if (s->check_type == XZ_CHECK_CRC32) {
+				ret = crc32_validate(s, b);
+				if (ret != XZ_STREAM_END)
+					return ret;
+			}
+#ifdef XZ_DEC_ANY_CHECK
+			else if (!check_skip(s, b)) {
+				return XZ_OK;
+			}
+#endif
+
+			s->sequence = SEQ_BLOCK_START;
+			break;
+
+		case SEQ_INDEX:
+			ret = dec_index(s, b);
+			if (ret != XZ_STREAM_END)
+				return ret;
+
+			s->sequence = SEQ_INDEX_PADDING;
+
+		case SEQ_INDEX_PADDING:
+			while ((s->index.size + (b->in_pos - s->in_start))
+					& 3) {
+				if (b->in_pos == b->in_size) {
+					index_update(s, b);
+					return XZ_OK;
+				}
+
+				if (b->in[b->in_pos++] != 0)
+					return XZ_DATA_ERROR;
+			}
+
+			/* Finish the CRC32 value and Index size. */
+			index_update(s, b);
+
+			/* Compare the hashes to validate the Index field. */
+			if (!memeq(&s->block.hash, &s->index.hash,
+					sizeof(s->block.hash)))
+				return XZ_DATA_ERROR;
+
+			s->sequence = SEQ_INDEX_CRC32;
+
+		case SEQ_INDEX_CRC32:
+			ret = crc32_validate(s, b);
+			if (ret != XZ_STREAM_END)
+				return ret;
+
+			s->temp.size = STREAM_HEADER_SIZE;
+			s->sequence = SEQ_STREAM_FOOTER;
+
+		case SEQ_STREAM_FOOTER:
+			if (!fill_temp(s, b))
+				return XZ_OK;
+
+			return dec_stream_footer(s);
+		}
+	}
+
+	/* Never reached */
+}
+
+XZ_EXTERN void INIT xz_dec_reset(struct xz_dec *s)
+{
+	s->sequence = SEQ_STREAM_HEADER;
+	s->allow_buf_error = false;
+	s->pos = 0;
+	s->crc32 = 0;
+	memzero(&s->block, sizeof(s->block));
+	memzero(&s->index, sizeof(s->index));
+	s->temp.pos = 0;
+	s->temp.size = STREAM_HEADER_SIZE;
+}
+
+/*
+ * xz_dec_run() is a wrapper for dec_main() to handle some special cases in
+ * multi-call and single-call decoding.
+ *
+ * In multi-call mode, we must return XZ_BUF_ERROR when it seems clear that we
+ * are not going to make any progress anymore. This is to prevent the caller
+ * from calling us infinitely when the input file is truncated or otherwise
+ * corrupt. Since zlib-style API allows that the caller fills the input buffer
+ * only when the decoder doesn't produce any new output, we have to be careful
+ * to avoid returning XZ_BUF_ERROR too easily: XZ_BUF_ERROR is returned only
+ * after the second consecutive call to xz_dec_run() that makes no progress.
+ *
+ * In single-call mode, if we couldn't decode everything and no error
+ * occurred, either the input is truncated or the output buffer is too small.
+ * Since we know that the last input byte never produces any output, we know
+ * that if all the input was consumed and decoding wasn't finished, the file
+ * must be corrupt. Otherwise the output buffer has to be too small or the
+ * file is corrupt in a way that decoding it produces too big output.
+ *
+ * If single-call decoding fails, we reset b->in_pos and b->out_pos back to
+ * their original values. This is because with some filter chains there won't
+ * be any valid uncompressed data in the output buffer unless the decoding
+ * actually succeeds (that's the price to pay of using the output buffer as
+ * the workspace).
+ */
+XZ_EXTERN enum xz_ret INIT xz_dec_run(struct xz_dec *s, struct xz_buf *b)
+{
+	size_t in_start;
+	size_t out_start;
+	enum xz_ret ret;
+
+	if (DEC_IS_SINGLE(s->mode))
+		xz_dec_reset(s);
+
+	in_start = b->in_pos;
+	out_start = b->out_pos;
+	ret = dec_main(s, b);
+
+	if (DEC_IS_SINGLE(s->mode)) {
+		if (ret == XZ_OK)
+			ret = b->in_pos == b->in_size
+					? XZ_DATA_ERROR : XZ_BUF_ERROR;
+
+		if (ret != XZ_STREAM_END) {
+			b->in_pos = in_start;
+			b->out_pos = out_start;
+		}
+
+	} else if (ret == XZ_OK && in_start == b->in_pos
+			&& out_start == b->out_pos) {
+		if (s->allow_buf_error)
+			ret = XZ_BUF_ERROR;
+
+		s->allow_buf_error = true;
+	} else {
+		s->allow_buf_error = false;
+	}
+
+	return ret;
+}
+
+XZ_EXTERN struct xz_dec *INIT xz_dec_init(enum xz_mode mode, uint32_t dict_max)
+{
+	struct xz_dec *s = malloc(sizeof(*s));
+	if (s == NULL)
+		return NULL;
+
+	s->mode = mode;
+
+#ifdef XZ_DEC_BCJ
+	s->bcj = xz_dec_bcj_create(DEC_IS_SINGLE(mode));
+	if (s->bcj == NULL)
+		goto error_bcj;
+#endif
+
+	s->lzma2 = xz_dec_lzma2_create(mode, dict_max);
+	if (s->lzma2 == NULL)
+		goto error_lzma2;
+
+	xz_dec_reset(s);
+	return s;
+
+error_lzma2:
+#ifdef XZ_DEC_BCJ
+	xz_dec_bcj_end(s->bcj);
+error_bcj:
+#endif
+	free(s);
+	return NULL;
+}
+
+XZ_EXTERN void INIT xz_dec_end(struct xz_dec *s)
+{
+	if (s != NULL) {
+		xz_dec_lzma2_end(s->lzma2);
+#ifdef XZ_DEC_BCJ
+		xz_dec_bcj_end(s->bcj);
+#endif
+		free(s);
+	}
+}
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/lzma2.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/lzma2.h	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,204 @@
+/*
+ * LZMA2 definitions
+ *
+ * Authors: Lasse Collin <lasse.collin@tukaani.org>
+ *          Igor Pavlov <http://7-zip.org/>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#ifndef XZ_LZMA2_H
+#define XZ_LZMA2_H
+
+/* Range coder constants */
+#define RC_SHIFT_BITS 8
+#define RC_TOP_BITS 24
+#define RC_TOP_VALUE (1 << RC_TOP_BITS)
+#define RC_BIT_MODEL_TOTAL_BITS 11
+#define RC_BIT_MODEL_TOTAL (1 << RC_BIT_MODEL_TOTAL_BITS)
+#define RC_MOVE_BITS 5
+
+/*
+ * Maximum number of position states. A position state is the lowest pb
+ * number of bits of the current uncompressed offset. In some places there
+ * are different sets of probabilities for different position states.
+ */
+#define POS_STATES_MAX (1 << 4)
+
+/*
+ * This enum is used to track which LZMA symbols have occurred most recently
+ * and in which order. This information is used to predict the next symbol.
+ *
+ * Symbols:
+ *  - Literal: One 8-bit byte
+ *  - Match: Repeat a chunk of data at some distance
+ *  - Long repeat: Multi-byte match at a recently seen distance
+ *  - Short repeat: One-byte repeat at a recently seen distance
+ *
+ * The symbol names are in from STATE_oldest_older_previous. REP means
+ * either short or long repeated match, and NONLIT means any non-literal.
+ */
+enum lzma_state {
+	STATE_LIT_LIT,
+	STATE_MATCH_LIT_LIT,
+	STATE_REP_LIT_LIT,
+	STATE_SHORTREP_LIT_LIT,
+	STATE_MATCH_LIT,
+	STATE_REP_LIT,
+	STATE_SHORTREP_LIT,
+	STATE_LIT_MATCH,
+	STATE_LIT_LONGREP,
+	STATE_LIT_SHORTREP,
+	STATE_NONLIT_MATCH,
+	STATE_NONLIT_REP
+};
+
+/* Total number of states */
+#define STATES 12
+
+/* The lowest 7 states indicate that the previous state was a literal. */
+#define LIT_STATES 7
+
+/* Indicate that the latest symbol was a literal. */
+static inline void INIT lzma_state_literal(enum lzma_state *state)
+{
+	if (*state <= STATE_SHORTREP_LIT_LIT)
+		*state = STATE_LIT_LIT;
+	else if (*state <= STATE_LIT_SHORTREP)
+		*state -= 3;
+	else
+		*state -= 6;
+}
+
+/* Indicate that the latest symbol was a match. */
+static inline void INIT lzma_state_match(enum lzma_state *state)
+{
+	*state = *state < LIT_STATES ? STATE_LIT_MATCH : STATE_NONLIT_MATCH;
+}
+
+/* Indicate that the latest state was a long repeated match. */
+static inline void INIT lzma_state_long_rep(enum lzma_state *state)
+{
+	*state = *state < LIT_STATES ? STATE_LIT_LONGREP : STATE_NONLIT_REP;
+}
+
+/* Indicate that the latest symbol was a short match. */
+static inline void INIT lzma_state_short_rep(enum lzma_state *state)
+{
+	*state = *state < LIT_STATES ? STATE_LIT_SHORTREP : STATE_NONLIT_REP;
+}
+
+/* Test if the previous symbol was a literal. */
+static inline bool_t INIT lzma_state_is_literal(enum lzma_state state)
+{
+	return state < LIT_STATES;
+}
+
+/* Each literal coder is divided in three sections:
+ *   - 0x001-0x0FF: Without match byte
+ *   - 0x101-0x1FF: With match byte; match bit is 0
+ *   - 0x201-0x2FF: With match byte; match bit is 1
+ *
+ * Match byte is used when the previous LZMA symbol was something else than
+ * a literal (that is, it was some kind of match).
+ */
+#define LITERAL_CODER_SIZE 0x300
+
+/* Maximum number of literal coders */
+#define LITERAL_CODERS_MAX (1 << 4)
+
+/* Minimum length of a match is two bytes. */
+#define MATCH_LEN_MIN 2
+
+/* Match length is encoded with 4, 5, or 10 bits.
+ *
+ * Length   Bits
+ *  2-9      4 = Choice=0 + 3 bits
+ * 10-17     5 = Choice=1 + Choice2=0 + 3 bits
+ * 18-273   10 = Choice=1 + Choice2=1 + 8 bits
+ */
+#define LEN_LOW_BITS 3
+#define LEN_LOW_SYMBOLS (1 << LEN_LOW_BITS)
+#define LEN_MID_BITS 3
+#define LEN_MID_SYMBOLS (1 << LEN_MID_BITS)
+#define LEN_HIGH_BITS 8
+#define LEN_HIGH_SYMBOLS (1 << LEN_HIGH_BITS)
+#define LEN_SYMBOLS (LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS + LEN_HIGH_SYMBOLS)
+
+/*
+ * Maximum length of a match is 273 which is a result of the encoding
+ * described above.
+ */
+#define MATCH_LEN_MAX (MATCH_LEN_MIN + LEN_SYMBOLS - 1)
+
+/*
+ * Different sets of probabilities are used for match distances that have
+ * very short match length: Lengths of 2, 3, and 4 bytes have a separate
+ * set of probabilities for each length. The matches with longer length
+ * use a shared set of probabilities.
+ */
+#define DIST_STATES 4
+
+/*
+ * Get the index of the appropriate probability array for decoding
+ * the distance slot.
+ */
+static inline uint32_t INIT lzma_get_dist_state(uint32_t len)
+{
+	return len < DIST_STATES + MATCH_LEN_MIN
+			? len - MATCH_LEN_MIN : DIST_STATES - 1;
+}
+
+/*
+ * The highest two bits of a 32-bit match distance are encoded using six bits.
+ * This six-bit value is called a distance slot. This way encoding a 32-bit
+ * value takes 6-36 bits, larger values taking more bits.
+ */
+#define DIST_SLOT_BITS 6
+#define DIST_SLOTS (1 << DIST_SLOT_BITS)
+
+/* Match distances up to 127 are fully encoded using probabilities. Since
+ * the highest two bits (distance slot) are always encoded using six bits,
+ * the distances 0-3 don't need any additional bits to encode, since the
+ * distance slot itself is the same as the actual distance. DIST_MODEL_START
+ * indicates the first distance slot where at least one additional bit is
+ * needed.
+ */
+#define DIST_MODEL_START 4
+
+/*
+ * Match distances greater than 127 are encoded in three pieces:
+ *   - distance slot: the highest two bits
+ *   - direct bits: 2-26 bits below the highest two bits
+ *   - alignment bits: four lowest bits
+ *
+ * Direct bits don't use any probabilities.
+ *
+ * The distance slot value of 14 is for distances 128-191.
+ */
+#define DIST_MODEL_END 14
+
+/* Distance slots that indicate a distance <= 127. */
+#define FULL_DISTANCES_BITS (DIST_MODEL_END / 2)
+#define FULL_DISTANCES (1 << FULL_DISTANCES_BITS)
+
+/*
+ * For match distances greater than 127, only the highest two bits and the
+ * lowest four bits (alignment) is encoded using probabilities.
+ */
+#define ALIGN_BITS 4
+#define ALIGN_SIZE (1 << ALIGN_BITS)
+#define ALIGN_MASK (ALIGN_SIZE - 1)
+
+/* Total number of all probability variables */
+#define PROBS_TOTAL (1846 + LITERAL_CODERS_MAX * LITERAL_CODER_SIZE)
+
+/*
+ * LZMA remembers the four most recent match distances. Reusing these
+ * distances tends to take less space than re-encoding the actual
+ * distance value.
+ */
+#define REPS 4
+
+#endif
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/private.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/private.h	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,271 @@
+/*
+ * Private includes and definitions
+ *
+ * Author: Lasse Collin <lasse.collin@tukaani.org>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#ifndef XZ_PRIVATE_H
+#define XZ_PRIVATE_H
+
+#include <xen/kernel.h>
+#include <asm/byteorder.h>
+#define get_le32(p) le32_to_cpup((const uint32_t *)(p))
+
+#if 1 /* ndef CONFIG_??? */
+static inline u32 INIT get_unaligned_le32(void *p)
+{
+	return le32_to_cpup(p);
+}
+
+static inline void INIT put_unaligned_le32(u32 val, void *p)
+{
+	*(__force __le32*)p = cpu_to_le32(val);
+}
+#else
+#include <asm/unaligned.h>
+
+static inline u32 INIT get_unaligned_le32(void *p)
+{
+	return le32_to_cpu(__get_unaligned(p, 4));
+}
+
+static inline void INIT put_unaligned_le32(u32 val, void *p)
+{
+	__put_unaligned(cpu_to_le32(val), p, 4);
+}
+#endif
+
+#define false 0
+#define true 1
+
+/**
+ * enum xz_mode - Operation mode
+ *
+ * @XZ_SINGLE:              Single-call mode. This uses less RAM than
+ *                          than multi-call modes, because the LZMA2
+ *                          dictionary doesn't need to be allocated as
+ *                          part of the decoder state. All required data
+ *                          structures are allocated at initialization,
+ *                          so xz_dec_run() cannot return XZ_MEM_ERROR.
+ * @XZ_PREALLOC:            Multi-call mode with preallocated LZMA2
+ *                          dictionary buffer. All data structures are
+ *                          allocated at initialization, so xz_dec_run()
+ *                          cannot return XZ_MEM_ERROR.
+ * @XZ_DYNALLOC:            Multi-call mode. The LZMA2 dictionary is
+ *                          allocated once the required size has been
+ *                          parsed from the stream headers. If the
+ *                          allocation fails, xz_dec_run() will return
+ *                          XZ_MEM_ERROR.
+ *
+ * It is possible to enable support only for a subset of the above
+ * modes at compile time by defining XZ_DEC_SINGLE, XZ_DEC_PREALLOC,
+ * or XZ_DEC_DYNALLOC. The xz_dec kernel module is always compiled
+ * with support for all operation modes, but the preboot code may
+ * be built with fewer features to minimize code size.
+ */
+enum xz_mode {
+	XZ_SINGLE,
+	XZ_PREALLOC,
+	XZ_DYNALLOC
+};
+
+/**
+ * enum xz_ret - Return codes
+ * @XZ_OK:                  Everything is OK so far. More input or more
+ *                          output space is required to continue. This
+ *                          return code is possible only in multi-call mode
+ *                          (XZ_PREALLOC or XZ_DYNALLOC).
+ * @XZ_STREAM_END:          Operation finished successfully.
+ * @XZ_UNSUPPORTED_CHECK:   Integrity check type is not supported. Decoding
+ *                          is still possible in multi-call mode by simply
+ *                          calling xz_dec_run() again.
+ *                          Note that this return value is used only if
+ *                          XZ_DEC_ANY_CHECK was defined at build time,
+ *                          which is not used in the kernel. Unsupported
+ *                          check types return XZ_OPTIONS_ERROR if
+ *                          XZ_DEC_ANY_CHECK was not defined at build time.
+ * @XZ_MEM_ERROR:           Allocating memory failed. This return code is
+ *                          possible only if the decoder was initialized
+ *                          with XZ_DYNALLOC. The amount of memory that was
+ *                          tried to be allocated was no more than the
+ *                          dict_max argument given to xz_dec_init().
+ * @XZ_MEMLIMIT_ERROR:      A bigger LZMA2 dictionary would be needed than
+ *                          allowed by the dict_max argument given to
+ *                          xz_dec_init(). This return value is possible
+ *                          only in multi-call mode (XZ_PREALLOC or
+ *                          XZ_DYNALLOC); the single-call mode (XZ_SINGLE)
+ *                          ignores the dict_max argument.
+ * @XZ_FORMAT_ERROR:        File format was not recognized (wrong magic
+ *                          bytes).
+ * @XZ_OPTIONS_ERROR:       This implementation doesn't support the requested
+ *                          compression options. In the decoder this means
+ *                          that the header CRC32 matches, but the header
+ *                          itself specifies something that we don't support.
+ * @XZ_DATA_ERROR:          Compressed data is corrupt.
+ * @XZ_BUF_ERROR:           Cannot make any progress. Details are slightly
+ *                          different between multi-call and single-call
+ *                          mode; more information below.
+ *
+ * In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls
+ * to XZ code cannot consume any input and cannot produce any new output.
+ * This happens when there is no new input available, or the output buffer
+ * is full while at least one output byte is still pending. Assuming your
+ * code is not buggy, you can get this error only when decoding a compressed
+ * stream that is truncated or otherwise corrupt.
+ *
+ * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer
+ * is too small or the compressed input is corrupt in a way that makes the
+ * decoder produce more output than the caller expected. When it is
+ * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR
+ * is used instead of XZ_BUF_ERROR.
+ */
+enum xz_ret {
+	XZ_OK,
+	XZ_STREAM_END,
+	XZ_UNSUPPORTED_CHECK,
+	XZ_MEM_ERROR,
+	XZ_MEMLIMIT_ERROR,
+	XZ_FORMAT_ERROR,
+	XZ_OPTIONS_ERROR,
+	XZ_DATA_ERROR,
+	XZ_BUF_ERROR
+};
+
+/**
+ * struct xz_buf - Passing input and output buffers to XZ code
+ * @in:         Beginning of the input buffer. This may be NULL if and only
+ *              if in_pos is equal to in_size.
+ * @in_pos:     Current position in the input buffer. This must not exceed
+ *              in_size.
+ * @in_size:    Size of the input buffer
+ * @out:        Beginning of the output buffer. This may be NULL if and only
+ *              if out_pos is equal to out_size.
+ * @out_pos:    Current position in the output buffer. This must not exceed
+ *              out_size.
+ * @out_size:   Size of the output buffer
+ *
+ * Only the contents of the output buffer from out[out_pos] onward, and
+ * the variables in_pos and out_pos are modified by the XZ code.
+ */
+struct xz_buf {
+	const uint8_t *in;
+	size_t in_pos;
+	size_t in_size;
+
+	uint8_t *out;
+	size_t out_pos;
+	size_t out_size;
+};
+
+/**
+ * struct xz_dec - Opaque type to hold the XZ decoder state
+ */
+struct xz_dec;
+
+/* If no specific decoding mode is requested, enable support for all modes. */
+#if !defined(XZ_DEC_SINGLE) && !defined(XZ_DEC_PREALLOC) \
+		&& !defined(XZ_DEC_DYNALLOC)
+#	define XZ_DEC_SINGLE
+#	define XZ_DEC_PREALLOC
+#	define XZ_DEC_DYNALLOC
+#endif
+
+/*
+ * The DEC_IS_foo(mode) macros are used in "if" statements. If only some
+ * of the supported modes are enabled, these macros will evaluate to true or
+ * false at compile time and thus allow the compiler to omit unneeded code.
+ */
+#ifdef XZ_DEC_SINGLE
+#	define DEC_IS_SINGLE(mode) ((mode) == XZ_SINGLE)
+#else
+#	define DEC_IS_SINGLE(mode) (false)
+#endif
+
+#ifdef XZ_DEC_PREALLOC
+#	define DEC_IS_PREALLOC(mode) ((mode) == XZ_PREALLOC)
+#else
+#	define DEC_IS_PREALLOC(mode) (false)
+#endif
+
+#ifdef XZ_DEC_DYNALLOC
+#	define DEC_IS_DYNALLOC(mode) ((mode) == XZ_DYNALLOC)
+#else
+#	define DEC_IS_DYNALLOC(mode) (false)
+#endif
+
+#if !defined(XZ_DEC_SINGLE)
+#	define DEC_IS_MULTI(mode) (true)
+#elif defined(XZ_DEC_PREALLOC) || defined(XZ_DEC_DYNALLOC)
+#	define DEC_IS_MULTI(mode) ((mode) != XZ_SINGLE)
+#else
+#	define DEC_IS_MULTI(mode) (false)
+#endif
+
+/*
+ * If any of the BCJ filter decoders are wanted, define XZ_DEC_BCJ.
+ * XZ_DEC_BCJ is used to enable generic support for BCJ decoders.
+ */
+#ifndef XZ_DEC_BCJ
+#	if defined(XZ_DEC_X86) || defined(XZ_DEC_POWERPC) \
+			|| defined(XZ_DEC_IA64) || defined(XZ_DEC_ARM) \
+			|| defined(XZ_DEC_ARM) || defined(XZ_DEC_ARMTHUMB) \
+			|| defined(XZ_DEC_SPARC)
+#		define XZ_DEC_BCJ
+#	endif
+#endif
+
+/*
+ * Allocate memory for LZMA2 decoder. xz_dec_lzma2_reset() must be used
+ * before calling xz_dec_lzma2_run().
+ */
+XZ_EXTERN struct xz_dec_lzma2 *xz_dec_lzma2_create(enum xz_mode mode,
+						   uint32_t dict_max);
+
+/*
+ * Decode the LZMA2 properties (one byte) and reset the decoder. Return
+ * XZ_OK on success, XZ_MEMLIMIT_ERROR if the preallocated dictionary is not
+ * big enough, and XZ_OPTIONS_ERROR if props indicates something that this
+ * decoder doesn't support.
+ */
+XZ_EXTERN enum xz_ret xz_dec_lzma2_reset(struct xz_dec_lzma2 *s,
+					 uint8_t props);
+
+/* Decode raw LZMA2 stream from b->in to b->out. */
+XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
+				       struct xz_buf *b);
+
+/* Free the memory allocated for the LZMA2 decoder. */
+XZ_EXTERN void xz_dec_lzma2_end(struct xz_dec_lzma2 *s);
+
+#ifdef XZ_DEC_BCJ
+/*
+ * Allocate memory for BCJ decoders. xz_dec_bcj_reset() must be used before
+ * calling xz_dec_bcj_run().
+ */
+XZ_EXTERN struct xz_dec_bcj *xz_dec_bcj_create(bool_t single_call);
+
+/*
+ * Decode the Filter ID of a BCJ filter. This implementation doesn't
+ * support custom start offsets, so no decoding of Filter Properties
+ * is needed. Returns XZ_OK if the given Filter ID is supported.
+ * Otherwise XZ_OPTIONS_ERROR is returned.
+ */
+XZ_EXTERN enum xz_ret xz_dec_bcj_reset(struct xz_dec_bcj *s, uint8_t id);
+
+/*
+ * Decode raw BCJ + LZMA2 stream. This must be used only if there actually is
+ * a BCJ filter in the chain. If the chain has only LZMA2, xz_dec_lzma2_run()
+ * must be called directly.
+ */
+XZ_EXTERN enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s,
+				     struct xz_dec_lzma2 *lzma2,
+				     struct xz_buf *b);
+
+/* Free the memory allocated for the BCJ filters. */
+#define xz_dec_bcj_end(s) free(s)
+#endif
+
+#endif
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/stream.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/stream.h	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Definitions for handling the .xz file format
+ *
+ * Author: Lasse Collin <lasse.collin@tukaani.org>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#ifndef XZ_STREAM_H
+#define XZ_STREAM_H
+
+/*
+ * See the .xz file format specification at
+ * http://tukaani.org/xz/xz-file-format.txt
+ * to understand the container format.
+ */
+
+#define STREAM_HEADER_SIZE 12
+
+#define HEADER_MAGIC "\3757zXZ"
+#define HEADER_MAGIC_SIZE 6
+
+#define FOOTER_MAGIC "YZ"
+#define FOOTER_MAGIC_SIZE 2
+
+/*
+ * Variable-length integer can hold a 63-bit unsigned integer or a special
+ * value indicating that the value is unknown.
+ *
+ * Experimental: vli_type can be defined to uint32_t to save a few bytes
+ * in code size (no effect on speed). Doing so limits the uncompressed and
+ * compressed size of the file to less than 256 MiB and may also weaken
+ * error detection slightly.
+ */
+typedef uint64_t vli_type;
+
+#define VLI_MAX ((vli_type)-1 / 2)
+#define VLI_UNKNOWN ((vli_type)-1)
+
+/* Maximum encoded size of a VLI */
+#define VLI_BYTES_MAX (sizeof(vli_type) * 8 / 7)
+
+/* Integrity Check types */
+enum xz_check {
+	XZ_CHECK_NONE = 0,
+	XZ_CHECK_CRC32 = 1,
+	XZ_CHECK_CRC64 = 4,
+	XZ_CHECK_SHA256 = 10
+};
+
+/* Maximum possible Check ID */
+#define XZ_CHECK_MAX 15
+
+#endif
diff -r 7892ab82191b -r d72d30447ae8 xen/include/xen/decompress.h
--- a/xen/include/xen/decompress.h	Wed Dec 19 12:22:57 2012 +0100
+++ b/xen/include/xen/decompress.h	Wed Dec 19 12:25:27 2012 +0100
@@ -31,7 +31,7 @@ typedef int decompress_fn(unsigned char 
  * dependent).
  */
 
-decompress_fn bunzip2, unlzma, unlzo;
+decompress_fn bunzip2, unxz, unlzma, unlzo;
 
 int decompress(void *inbuf, unsigned int len, void *outbuf);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 11:34:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 11:34:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TleOG-0006Sc-9J; Thu, 20 Dec 2012 11:34:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleOE-0006SL-Hp
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:34:15 +0000
Received: from [85.158.139.211:47382] by server-2.bemta-5.messagelabs.com id
	A0/D8-16162-5B7F2D05; Thu, 20 Dec 2012 11:34:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-206.messagelabs.com!1356003189!19494561!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG,
	ML_RADAR_SPEW_LINKS_23,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13975 invoked from network); 20 Dec 2012 11:33:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 11:33:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNB-0002GR-Bq
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TleNB-0007WE-1K
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 11:33:09 +0000
Message-Id: <E1TleNB-0007WE-1K@xenbits.xen.org>
Date: Thu, 20 Dec 2012 11:33:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Add Dom0 xz kernel decompression
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@novell.com>
# Date 1355916327 -3600
# Node ID d72d30447ae8a1f66b6869f30e1e32ff57c8c4f6
# Parent  7892ab82191bab0ef767f7b248099a3af70f4ed8
Add Dom0 xz kernel decompression

Largely taken from Linux 2.6.38 and made build/work for Xen.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 23001:9eb9948904cd
xen-unstable date: Wed Mar  9 16:18:58 UTC 2011
---


diff -r 7892ab82191b -r d72d30447ae8 xen/common/Makefile
--- a/xen/common/Makefile	Wed Dec 19 12:22:57 2012 +0100
+++ b/xen/common/Makefile	Wed Dec 19 12:25:27 2012 +0100
@@ -43,7 +43,7 @@ obj-y += radix-tree.o
 obj-y += rbtree.o
 obj-y += lzo.o
 
-obj-$(CONFIG_X86) += decompress.o bunzip2.o unlzma.o unlzo.o
+obj-$(CONFIG_X86) += decompress.o bunzip2.o unxz.o unlzma.o unlzo.o
 
 obj-$(perfc)       += perfc.o
 obj-$(crash_debug) += gdbstub.o
diff -r 7892ab82191b -r d72d30447ae8 xen/common/decompress.c
--- a/xen/common/decompress.c	Wed Dec 19 12:22:57 2012 +0100
+++ b/xen/common/decompress.c	Wed Dec 19 12:25:27 2012 +0100
@@ -20,6 +20,9 @@ int __init decompress(void *inbuf, unsig
     if ( len >= 3 && !memcmp(inbuf, "\x42\x5a\x68", 3) )
         return bunzip2(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
+    if ( len >= 6 && !memcmp(inbuf, "\3757zXZ", 6) )
+        return unxz(inbuf, len, NULL, NULL, outbuf, NULL, error);
+
     if ( len >= 2 && !memcmp(inbuf, "\135\000", 2) )
         return unlzma(inbuf, len, NULL, NULL, outbuf, NULL, error);
 
diff -r 7892ab82191b -r d72d30447ae8 xen/common/decompress.h
--- a/xen/common/decompress.h	Wed Dec 19 12:22:57 2012 +0100
+++ b/xen/common/decompress.h	Wed Dec 19 12:25:27 2012 +0100
@@ -8,6 +8,7 @@
 
 #define STATIC
 #define INIT __init
+#define INITDATA __initdata
 
 static void(*__initdata error)(const char *);
 #define set_error_fn(x) error = x;
diff -r 7892ab82191b -r d72d30447ae8 xen/common/unxz.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/unxz.c	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,306 @@
+/*
+ * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd
+ *
+ * Author: Lasse Collin <lasse.collin@tukaani.org>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+/*
+ * Important notes about in-place decompression
+ *
+ * At least on x86, the kernel is decompressed in place: the compressed data
+ * is placed to the end of the output buffer, and the decompressor overwrites
+ * most of the compressed data. There must be enough safety margin to
+ * guarantee that the write position is always behind the read position.
+ *
+ * The safety margin for XZ with LZMA2 or BCJ+LZMA2 is calculated below.
+ * Note that the margin with XZ is bigger than with Deflate (gzip)!
+ *
+ * The worst case for in-place decompression is that the beginning of
+ * the file is compressed extremely well, and the rest of the file is
+ * uncompressible. Thus, we must look for worst-case expansion when the
+ * compressor is encoding uncompressible data.
+ *
+ * The structure of the .xz file in case of a compresed kernel is as follows.
+ * Sizes (as bytes) of the fields are in parenthesis.
+ *
+ *    Stream Header (12)
+ *    Block Header:
+ *      Block Header (8-12)
+ *      Compressed Data (N)
+ *      Block Padding (0-3)
+ *      CRC32 (4)
+ *    Index (8-20)
+ *    Stream Footer (12)
+ *
+ * Normally there is exactly one Block, but let's assume that there are
+ * 2-4 Blocks just in case. Because Stream Header and also Block Header
+ * of the first Block don't make the decompressor produce any uncompressed
+ * data, we can ignore them from our calculations. Block Headers of possible
+ * additional Blocks have to be taken into account still. With these
+ * assumptions, it is safe to assume that the total header overhead is
+ * less than 128 bytes.
+ *
+ * Compressed Data contains LZMA2 or BCJ+LZMA2 encoded data. Since BCJ
+ * doesn't change the size of the data, it is enough to calculate the
+ * safety margin for LZMA2.
+ *
+ * LZMA2 stores the data in chunks. Each chunk has a header whose size is
+ * a maximum of 6 bytes, but to get round 2^n numbers, let's assume that
+ * the maximum chunk header size is 8 bytes. After the chunk header, there
+ * may be up to 64 KiB of actual payload in the chunk. Often the payload is
+ * quite a bit smaller though; to be safe, let's assume that an average
+ * chunk has only 32 KiB of payload.
+ *
+ * The maximum uncompressed size of the payload is 2 MiB. The minimum
+ * uncompressed size of the payload is in practice never less than the
+ * payload size itself. The LZMA2 format would allow uncompressed size
+ * to be less than the payload size, but no sane compressor creates such
+ * files. LZMA2 supports storing uncompressible data in uncompressed form,
+ * so there's never a need to create payloads whose uncompressed size is
+ * smaller than the compressed size.
+ *
+ * The assumption, that the uncompressed size of the payload is never
+ * smaller than the payload itself, is valid only when talking about
+ * the payload as a whole. It is possible that the payload has parts where
+ * the decompressor consumes more input than it produces output. Calculating
+ * the worst case for this would be tricky. Instead of trying to do that,
+ * let's simply make sure that the decompressor never overwrites any bytes
+ * of the payload which it is currently reading.
+ *
+ * Now we have enough information to calculate the safety margin. We need
+ *   - 128 bytes for the .xz file format headers;
+ *   - 8 bytes per every 32 KiB of uncompressed size (one LZMA2 chunk header
+ *     per chunk, each chunk having average payload size of 32 KiB); and
+ *   - 64 KiB (biggest possible LZMA2 chunk payload size) to make sure that
+ *     the decompressor never overwrites anything from the LZMA2 chunk
+ *     payload it is currently reading.
+ *
+ * We get the following formula:
+ *
+ *    safety_margin = 128 + uncompressed_size * 8 / 32768 + 65536
+ *                  = 128 + (uncompressed_size >> 12) + 65536
+ *
+ * For comparision, according to arch/x86/boot/compressed/misc.c, the
+ * equivalent formula for Deflate is this:
+ *
+ *    safety_margin = 18 + (uncompressed_size >> 12) + 32768
+ *
+ * Thus, when updating Deflate-only in-place kernel decompressor to
+ * support XZ, the fixed overhead has to be increased from 18+32768 bytes
+ * to 128+65536 bytes.
+ */
+
+#include "decompress.h"
+
+#define XZ_EXTERN STATIC
+
+/*
+ * For boot time use, we enable only the BCJ filter of the current
+ * architecture or none if no BCJ filter is available for the architecture.
+ */
+#ifdef CONFIG_X86
+#	define XZ_DEC_X86
+#endif
+#ifdef CONFIG_PPC
+#	define XZ_DEC_POWERPC
+#endif
+#ifdef CONFIG_ARM
+#	define XZ_DEC_ARM
+#endif
+#ifdef CONFIG_IA64
+#	define XZ_DEC_IA64
+#endif
+#ifdef CONFIG_SPARC
+#	define XZ_DEC_SPARC
+#endif
+
+/*
+ * This will get the basic headers so that memeq() and others
+ * can be defined.
+ */
+#include "xz/private.h"
+
+/*
+ * memeq and memzero are not used much and any remotely sane implementation
+ * is fast enough. memcpy/memmove speed matters in multi-call mode, but
+ * the kernel image is decompressed in single-call mode, in which only
+ * memcpy speed can matter and only if there is a lot of uncompressible data
+ * (LZMA2 stores uncompressible chunks in uncompressed form). Thus, the
+ * functions below should just be kept small; it's probably not worth
+ * optimizing for speed.
+ */
+
+#ifndef memeq
+#define memeq(p1, p2, sz) (memcmp(p1, p2, sz) == 0)
+#endif
+
+#ifndef memzero
+#define memzero(p, sz) memset(p, 0, sz)
+#endif
+
+#include "xz/crc32.c"
+#include "xz/dec_stream.c"
+#include "xz/dec_lzma2.c"
+#include "xz/dec_bcj.c"
+
+/* Size of the input and output buffers in multi-call mode */
+#define XZ_IOBUF_SIZE 4096
+
+/*
+ * This function implements the API defined in <linux/decompress/generic.h>.
+ *
+ * This wrapper will automatically choose single-call or multi-call mode
+ * of the native XZ decoder API. The single-call mode can be used only when
+ * both input and output buffers are available as a single chunk, i.e. when
+ * fill() and flush() won't be used.
+ */
+STATIC int INIT unxz(unsigned char *in, unsigned int in_size,
+		     int (*fill)(void *dest, unsigned int size),
+		     int (*flush)(void *src, unsigned int size),
+		     unsigned char *out, unsigned int *in_used,
+		     void (*error_fn)(const char *x))
+{
+	struct xz_buf b;
+	struct xz_dec *s;
+	enum xz_ret ret;
+	bool_t must_free_in = false;
+
+	set_error_fn(error_fn);
+
+	xz_crc32_init();
+
+	if (in_used != NULL)
+		*in_used = 0;
+
+	if (fill == NULL && flush == NULL)
+		s = xz_dec_init(XZ_SINGLE, 0);
+	else
+		s = xz_dec_init(XZ_DYNALLOC, (uint32_t)-1);
+
+	if (s == NULL)
+		goto error_alloc_state;
+
+	if (flush == NULL) {
+		b.out = out;
+		b.out_size = (size_t)-1;
+	} else {
+		b.out_size = XZ_IOBUF_SIZE;
+		b.out = malloc(XZ_IOBUF_SIZE);
+		if (b.out == NULL)
+			goto error_alloc_out;
+	}
+
+	if (in == NULL) {
+		must_free_in = true;
+		in = malloc(XZ_IOBUF_SIZE);
+		if (in == NULL)
+			goto error_alloc_in;
+	}
+
+	b.in = in;
+	b.in_pos = 0;
+	b.in_size = in_size;
+	b.out_pos = 0;
+
+	if (fill == NULL && flush == NULL) {
+		ret = xz_dec_run(s, &b);
+	} else {
+		do {
+			if (b.in_pos == b.in_size && fill != NULL) {
+				if (in_used != NULL)
+					*in_used += b.in_pos;
+
+				b.in_pos = 0;
+
+				in_size = fill(in, XZ_IOBUF_SIZE);
+				if ((int)in_size < 0) {
+					/*
+					 * This isn't an optimal error code
+					 * but it probably isn't worth making
+					 * a new one either.
+					 */
+					ret = XZ_BUF_ERROR;
+					break;
+				}
+
+				b.in_size = in_size;
+			}
+
+			ret = xz_dec_run(s, &b);
+
+			if (flush != NULL && (b.out_pos == b.out_size
+					|| (ret != XZ_OK && b.out_pos > 0))) {
+				/*
+				 * Setting ret here may hide an error
+				 * returned by xz_dec_run(), but probably
+				 * it's not too bad.
+				 */
+				if (flush(b.out, b.out_pos) != (int)b.out_pos)
+					ret = XZ_BUF_ERROR;
+
+				b.out_pos = 0;
+			}
+		} while (ret == XZ_OK);
+
+		if (must_free_in)
+			free(in);
+
+		if (flush != NULL)
+			free(b.out);
+	}
+
+	if (in_used != NULL)
+		*in_used += b.in_pos;
+
+	xz_dec_end(s);
+
+	switch (ret) {
+	case XZ_STREAM_END:
+		return 0;
+
+	case XZ_MEM_ERROR:
+		/* This can occur only in multi-call mode. */
+		error("XZ decompressor ran out of memory");
+		break;
+
+	case XZ_FORMAT_ERROR:
+		error("Input is not in the XZ format (wrong magic bytes)");
+		break;
+
+	case XZ_OPTIONS_ERROR:
+		error("Input was encoded with settings that are not "
+				"supported by this XZ decoder");
+		break;
+
+	case XZ_DATA_ERROR:
+	case XZ_BUF_ERROR:
+		error("XZ-compressed data is corrupt");
+		break;
+
+	default:
+		error("Bug in the XZ decompressor");
+		break;
+	}
+
+	return -1;
+
+error_alloc_in:
+	if (flush != NULL)
+		free(b.out);
+
+error_alloc_out:
+	xz_dec_end(s);
+
+error_alloc_state:
+	error("XZ decompressor ran out of memory");
+	return -1;
+}
+
+/*
+ * This macro is used by architecture-specific files to decompress
+ * the kernel image.
+ */
+#define decompress unxz
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/crc32.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/crc32.c	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * CRC32 using the polynomial from IEEE-802.3
+ *
+ * Authors: Lasse Collin <lasse.collin@tukaani.org>
+ *          Igor Pavlov <http://7-zip.org/>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+/*
+ * This is not the fastest implementation, but it is pretty compact.
+ * The fastest versions of xz_crc32() on modern CPUs without hardware
+ * accelerated CRC instruction are 3-5 times as fast as this version,
+ * but they are bigger and use more memory for the lookup table.
+ */
+
+#include "private.h"
+
+XZ_EXTERN uint32_t INITDATA xz_crc32_table[256];
+
+XZ_EXTERN void INIT xz_crc32_init(void)
+{
+	const uint32_t poly = 0xEDB88320;
+
+	uint32_t i;
+	uint32_t j;
+	uint32_t r;
+
+	for (i = 0; i < 256; ++i) {
+		r = i;
+		for (j = 0; j < 8; ++j)
+			r = (r >> 1) ^ (poly & ~((r & 1) - 1));
+
+		xz_crc32_table[i] = r;
+	}
+
+	return;
+}
+
+XZ_EXTERN uint32_t INIT xz_crc32(const uint8_t *buf, size_t size, uint32_t crc)
+{
+	crc = ~crc;
+
+	while (size != 0) {
+		crc = xz_crc32_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8);
+		--size;
+	}
+
+	return ~crc;
+}
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/dec_bcj.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/dec_bcj.c	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,562 @@
+/*
+ * Branch/Call/Jump (BCJ) filter decoders
+ *
+ * Authors: Lasse Collin <lasse.collin@tukaani.org>
+ *          Igor Pavlov <http://7-zip.org/>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#include "private.h"
+
+/*
+ * The rest of the file is inside this ifdef. It makes things a little more
+ * convenient when building without support for any BCJ filters.
+ */
+#ifdef XZ_DEC_BCJ
+
+struct xz_dec_bcj {
+	/* Type of the BCJ filter being used */
+	enum {
+		BCJ_X86 = 4,        /* x86 or x86-64 */
+		BCJ_POWERPC = 5,    /* Big endian only */
+		BCJ_IA64 = 6,       /* Big or little endian */
+		BCJ_ARM = 7,        /* Little endian only */
+		BCJ_ARMTHUMB = 8,   /* Little endian only */
+		BCJ_SPARC = 9       /* Big or little endian */
+	} type;
+
+	/*
+	 * Return value of the next filter in the chain. We need to preserve
+	 * this information across calls, because we must not call the next
+	 * filter anymore once it has returned XZ_STREAM_END.
+	 */
+	enum xz_ret ret;
+
+	/* True if we are operating in single-call mode. */
+	bool_t single_call;
+
+	/*
+	 * Absolute position relative to the beginning of the uncompressed
+	 * data (in a single .xz Block). We care only about the lowest 32
+	 * bits so this doesn't need to be uint64_t even with big files.
+	 */
+	uint32_t pos;
+
+	/* x86 filter state */
+	uint32_t x86_prev_mask;
+
+	/* Temporary space to hold the variables from struct xz_buf */
+	uint8_t *out;
+	size_t out_pos;
+	size_t out_size;
+
+	struct {
+		/* Amount of already filtered data in the beginning of buf */
+		size_t filtered;
+
+		/* Total amount of data currently stored in buf  */
+		size_t size;
+
+		/*
+		 * Buffer to hold a mix of filtered and unfiltered data. This
+		 * needs to be big enough to hold Alignment + 2 * Look-ahead:
+		 *
+		 * Type         Alignment   Look-ahead
+		 * x86              1           4
+		 * PowerPC          4           0
+		 * IA-64           16           0
+		 * ARM              4           0
+		 * ARM-Thumb        2           2
+		 * SPARC            4           0
+		 */
+		uint8_t buf[16];
+	} temp;
+};
+
+#ifdef XZ_DEC_X86
+/*
+ * This is used to test the most significant byte of a memory address
+ * in an x86 instruction.
+ */
+static inline int INIT bcj_x86_test_msbyte(uint8_t b)
+{
+	return b == 0x00 || b == 0xFF;
+}
+
+static size_t INIT bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	static /*const*/ bool_t INITDATA mask_to_allowed_status[8]
+		= { true, true, true, false, true, false, false, false };
+
+	static /*const*/ uint8_t INITDATA mask_to_bit_num[8]
+		= { 0, 1, 2, 2, 3, 3, 3, 3 };
+
+	size_t i;
+	size_t prev_pos = (size_t)-1;
+	uint32_t prev_mask = s->x86_prev_mask;
+	uint32_t src;
+	uint32_t dest;
+	uint32_t j;
+	uint8_t b;
+
+	if (size <= 4)
+		return 0;
+
+	size -= 4;
+	for (i = 0; i < size; ++i) {
+		if ((buf[i] & 0xFE) != 0xE8)
+			continue;
+
+		prev_pos = i - prev_pos;
+		if (prev_pos > 3) {
+			prev_mask = 0;
+		} else {
+			prev_mask = (prev_mask << (prev_pos - 1)) & 7;
+			if (prev_mask != 0) {
+				b = buf[i + 4 - mask_to_bit_num[prev_mask]];
+				if (!mask_to_allowed_status[prev_mask]
+						|| bcj_x86_test_msbyte(b)) {
+					prev_pos = i;
+					prev_mask = (prev_mask << 1) | 1;
+					continue;
+				}
+			}
+		}
+
+		prev_pos = i;
+
+		if (bcj_x86_test_msbyte(buf[i + 4])) {
+			src = get_unaligned_le32(buf + i + 1);
+			while (true) {
+				dest = src - (s->pos + (uint32_t)i + 5);
+				if (prev_mask == 0)
+					break;
+
+				j = mask_to_bit_num[prev_mask] * 8;
+				b = (uint8_t)(dest >> (24 - j));
+				if (!bcj_x86_test_msbyte(b))
+					break;
+
+				src = dest ^ (((uint32_t)1 << (32 - j)) - 1);
+			}
+
+			dest &= 0x01FFFFFF;
+			dest |= (uint32_t)0 - (dest & 0x01000000);
+			put_unaligned_le32(dest, buf + i + 1);
+			i += 4;
+		} else {
+			prev_mask = (prev_mask << 1) | 1;
+		}
+	}
+
+	prev_pos = i - prev_pos;
+	s->x86_prev_mask = prev_pos > 3 ? 0 : prev_mask << (prev_pos - 1);
+	return i;
+}
+#endif
+
+#ifdef XZ_DEC_POWERPC
+static size_t INIT bcj_powerpc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	size_t i;
+	uint32_t instr;
+
+	for (i = 0; i + 4 <= size; i += 4) {
+		instr = get_unaligned_be32(buf + i);
+		if ((instr & 0xFC000003) == 0x48000001) {
+			instr &= 0x03FFFFFC;
+			instr -= s->pos + (uint32_t)i;
+			instr &= 0x03FFFFFC;
+			instr |= 0x48000001;
+			put_unaligned_be32(instr, buf + i);
+		}
+	}
+
+	return i;
+}
+#endif
+
+#ifdef XZ_DEC_IA64
+static size_t INIT bcj_ia64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	static const uint8_t branch_table[32] = {
+		0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0,
+		4, 4, 6, 6, 0, 0, 7, 7,
+		4, 4, 0, 0, 4, 4, 0, 0
+	};
+
+	/*
+	 * The local variables take a little bit stack space, but it's less
+	 * than what LZMA2 decoder takes, so it doesn't make sense to reduce
+	 * stack usage here without doing that for the LZMA2 decoder too.
+	 */
+
+	/* Loop counters */
+	size_t i;
+	size_t j;
+
+	/* Instruction slot (0, 1, or 2) in the 128-bit instruction word */
+	uint32_t slot;
+
+	/* Bitwise offset of the instruction indicated by slot */
+	uint32_t bit_pos;
+
+	/* bit_pos split into byte and bit parts */
+	uint32_t byte_pos;
+	uint32_t bit_res;
+
+	/* Address part of an instruction */
+	uint32_t addr;
+
+	/* Mask used to detect which instructions to convert */
+	uint32_t mask;
+
+	/* 41-bit instruction stored somewhere in the lowest 48 bits */
+	uint64_t instr;
+
+	/* Instruction normalized with bit_res for easier manipulation */
+	uint64_t norm;
+
+	for (i = 0; i + 16 <= size; i += 16) {
+		mask = branch_table[buf[i] & 0x1F];
+		for (slot = 0, bit_pos = 5; slot < 3; ++slot, bit_pos += 41) {
+			if (((mask >> slot) & 1) == 0)
+				continue;
+
+			byte_pos = bit_pos >> 3;
+			bit_res = bit_pos & 7;
+			instr = 0;
+			for (j = 0; j < 6; ++j)
+				instr |= (uint64_t)(buf[i + j + byte_pos])
+						<< (8 * j);
+
+			norm = instr >> bit_res;
+
+			if (((norm >> 37) & 0x0F) == 0x05
+					&& ((norm >> 9) & 0x07) == 0) {
+				addr = (norm >> 13) & 0x0FFFFF;
+				addr |= ((uint32_t)(norm >> 36) & 1) << 20;
+				addr <<= 4;
+				addr -= s->pos + (uint32_t)i;
+				addr >>= 4;
+
+				norm &= ~((uint64_t)0x8FFFFF << 13);
+				norm |= (uint64_t)(addr & 0x0FFFFF) << 13;
+				norm |= (uint64_t)(addr & 0x100000)
+						<< (36 - 20);
+
+				instr &= (1 << bit_res) - 1;
+				instr |= norm << bit_res;
+
+				for (j = 0; j < 6; j++)
+					buf[i + j + byte_pos]
+						= (uint8_t)(instr >> (8 * j));
+			}
+		}
+	}
+
+	return i;
+}
+#endif
+
+#ifdef XZ_DEC_ARM
+static size_t INIT bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	size_t i;
+	uint32_t addr;
+
+	for (i = 0; i + 4 <= size; i += 4) {
+		if (buf[i + 3] == 0xEB) {
+			addr = (uint32_t)buf[i] | ((uint32_t)buf[i + 1] << 8)
+					| ((uint32_t)buf[i + 2] << 16);
+			addr <<= 2;
+			addr -= s->pos + (uint32_t)i + 8;
+			addr >>= 2;
+			buf[i] = (uint8_t)addr;
+			buf[i + 1] = (uint8_t)(addr >> 8);
+			buf[i + 2] = (uint8_t)(addr >> 16);
+		}
+	}
+
+	return i;
+}
+#endif
+
+#ifdef XZ_DEC_ARMTHUMB
+static size_t INIT bcj_armthumb(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	size_t i;
+	uint32_t addr;
+
+	for (i = 0; i + 4 <= size; i += 2) {
+		if ((buf[i + 1] & 0xF8) == 0xF0
+				&& (buf[i + 3] & 0xF8) == 0xF8) {
+			addr = (((uint32_t)buf[i + 1] & 0x07) << 19)
+					| ((uint32_t)buf[i] << 11)
+					| (((uint32_t)buf[i + 3] & 0x07) << 8)
+					| (uint32_t)buf[i + 2];
+			addr <<= 1;
+			addr -= s->pos + (uint32_t)i + 4;
+			addr >>= 1;
+			buf[i + 1] = (uint8_t)(0xF0 | ((addr >> 19) & 0x07));
+			buf[i] = (uint8_t)(addr >> 11);
+			buf[i + 3] = (uint8_t)(0xF8 | ((addr >> 8) & 0x07));
+			buf[i + 2] = (uint8_t)addr;
+			i += 2;
+		}
+	}
+
+	return i;
+}
+#endif
+
+#ifdef XZ_DEC_SPARC
+static size_t INIT bcj_sparc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+{
+	size_t i;
+	uint32_t instr;
+
+	for (i = 0; i + 4 <= size; i += 4) {
+		instr = get_unaligned_be32(buf + i);
+		if ((instr >> 22) == 0x100 || (instr >> 22) == 0x1FF) {
+			instr <<= 2;
+			instr -= s->pos + (uint32_t)i;
+			instr >>= 2;
+			instr = ((uint32_t)0x40000000 - (instr & 0x400000))
+					| 0x40000000 | (instr & 0x3FFFFF);
+			put_unaligned_be32(instr, buf + i);
+		}
+	}
+
+	return i;
+}
+#endif
+
+/*
+ * Apply the selected BCJ filter. Update *pos and s->pos to match the amount
+ * of data that got filtered.
+ *
+ * NOTE: This is implemented as a switch statement to avoid using function
+ * pointers, which could be problematic in the kernel boot code, which must
+ * avoid pointers to static data (at least on x86).
+ */
+static void INIT bcj_apply(struct xz_dec_bcj *s,
+			   uint8_t *buf, size_t *pos, size_t size)
+{
+	size_t filtered;
+
+	buf += *pos;
+	size -= *pos;
+
+	switch (s->type) {
+#ifdef XZ_DEC_X86
+	case BCJ_X86:
+		filtered = bcj_x86(s, buf, size);
+		break;
+#endif
+#ifdef XZ_DEC_POWERPC
+	case BCJ_POWERPC:
+		filtered = bcj_powerpc(s, buf, size);
+		break;
+#endif
+#ifdef XZ_DEC_IA64
+	case BCJ_IA64:
+		filtered = bcj_ia64(s, buf, size);
+		break;
+#endif
+#ifdef XZ_DEC_ARM
+	case BCJ_ARM:
+		filtered = bcj_arm(s, buf, size);
+		break;
+#endif
+#ifdef XZ_DEC_ARMTHUMB
+	case BCJ_ARMTHUMB:
+		filtered = bcj_armthumb(s, buf, size);
+		break;
+#endif
+#ifdef XZ_DEC_SPARC
+	case BCJ_SPARC:
+		filtered = bcj_sparc(s, buf, size);
+		break;
+#endif
+	default:
+		/* Never reached but silence compiler warnings. */
+		filtered = 0;
+		break;
+	}
+
+	*pos += filtered;
+	s->pos += filtered;
+}
+
+/*
+ * Flush pending filtered data from temp to the output buffer.
+ * Move the remaining mixture of possibly filtered and unfiltered
+ * data to the beginning of temp.
+ */
+static void INIT bcj_flush(struct xz_dec_bcj *s, struct xz_buf *b)
+{
+	size_t copy_size;
+
+	copy_size = min_t(size_t, s->temp.filtered, b->out_size - b->out_pos);
+	memcpy(b->out + b->out_pos, s->temp.buf, copy_size);
+	b->out_pos += copy_size;
+
+	s->temp.filtered -= copy_size;
+	s->temp.size -= copy_size;
+	memmove(s->temp.buf, s->temp.buf + copy_size, s->temp.size);
+}
+
+/*
+ * The BCJ filter functions are primitive in sense that they process the
+ * data in chunks of 1-16 bytes. To hide this issue, this function does
+ * some buffering.
+ */
+XZ_EXTERN enum xz_ret INIT xz_dec_bcj_run(struct xz_dec_bcj *s,
+					  struct xz_dec_lzma2 *lzma2,
+					  struct xz_buf *b)
+{
+	size_t out_start;
+
+	/*
+	 * Flush pending already filtered data to the output buffer. Return
+	 * immediatelly if we couldn't flush everything, or if the next
+	 * filter in the chain had already returned XZ_STREAM_END.
+	 */
+	if (s->temp.filtered > 0) {
+		bcj_flush(s, b);
+		if (s->temp.filtered > 0)
+			return XZ_OK;
+
+		if (s->ret == XZ_STREAM_END)
+			return XZ_STREAM_END;
+	}
+
+	/*
+	 * If we have more output space than what is currently pending in
+	 * temp, copy the unfiltered data from temp to the output buffer
+	 * and try to fill the output buffer by decoding more data from the
+	 * next filter in the chain. Apply the BCJ filter on the new data
+	 * in the output buffer. If everything cannot be filtered, copy it
+	 * to temp and rewind the output buffer position accordingly.
+	 */
+	if (s->temp.size < b->out_size - b->out_pos) {
+		out_start = b->out_pos;
+		memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size);
+		b->out_pos += s->temp.size;
+
+		s->ret = xz_dec_lzma2_run(lzma2, b);
+		if (s->ret != XZ_STREAM_END
+				&& (s->ret != XZ_OK || s->single_call))
+			return s->ret;
+
+		bcj_apply(s, b->out, &out_start, b->out_pos);
+
+		/*
+		 * As an exception, if the next filter returned XZ_STREAM_END,
+		 * we can do that too, since the last few bytes that remain
+		 * unfiltered are meant to remain unfiltered.
+		 */
+		if (s->ret == XZ_STREAM_END)
+			return XZ_STREAM_END;
+
+		s->temp.size = b->out_pos - out_start;
+		b->out_pos -= s->temp.size;
+		memcpy(s->temp.buf, b->out + b->out_pos, s->temp.size);
+	}
+
+	/*
+	 * If we have unfiltered data in temp, try to fill by decoding more
+	 * data from the next filter. Apply the BCJ filter on temp. Then we
+	 * hopefully can fill the actual output buffer by copying filtered
+	 * data from temp. A mix of filtered and unfiltered data may be left
+	 * in temp; it will be taken care on the next call to this function.
+	 */
+	if (s->temp.size > 0) {
+		/* Make b->out{,_pos,_size} temporarily point to s->temp. */
+		s->out = b->out;
+		s->out_pos = b->out_pos;
+		s->out_size = b->out_size;
+		b->out = s->temp.buf;
+		b->out_pos = s->temp.size;
+		b->out_size = sizeof(s->temp.buf);
+
+		s->ret = xz_dec_lzma2_run(lzma2, b);
+
+		s->temp.size = b->out_pos;
+		b->out = s->out;
+		b->out_pos = s->out_pos;
+		b->out_size = s->out_size;
+
+		if (s->ret != XZ_OK && s->ret != XZ_STREAM_END)
+			return s->ret;
+
+		bcj_apply(s, s->temp.buf, &s->temp.filtered, s->temp.size);
+
+		/*
+		 * If the next filter returned XZ_STREAM_END, we mark that
+		 * everything is filtered, since the last unfiltered bytes
+		 * of the stream are meant to be left as is.
+		 */
+		if (s->ret == XZ_STREAM_END)
+			s->temp.filtered = s->temp.size;
+
+		bcj_flush(s, b);
+		if (s->temp.filtered > 0)
+			return XZ_OK;
+	}
+
+	return s->ret;
+}
+
+XZ_EXTERN struct xz_dec_bcj *INIT xz_dec_bcj_create(bool_t single_call)
+{
+	struct xz_dec_bcj *s = malloc(sizeof(*s));
+	if (s != NULL)
+		s->single_call = single_call;
+
+	return s;
+}
+
+XZ_EXTERN enum xz_ret INIT xz_dec_bcj_reset(struct xz_dec_bcj *s, uint8_t id)
+{
+	switch (id) {
+#ifdef XZ_DEC_X86
+	case BCJ_X86:
+#endif
+#ifdef XZ_DEC_POWERPC
+	case BCJ_POWERPC:
+#endif
+#ifdef XZ_DEC_IA64
+	case BCJ_IA64:
+#endif
+#ifdef XZ_DEC_ARM
+	case BCJ_ARM:
+#endif
+#ifdef XZ_DEC_ARMTHUMB
+	case BCJ_ARMTHUMB:
+#endif
+#ifdef XZ_DEC_SPARC
+	case BCJ_SPARC:
+#endif
+		break;
+
+	default:
+		/* Unsupported Filter ID */
+		return XZ_OPTIONS_ERROR;
+	}
+
+	s->type = id;
+	s->ret = XZ_OK;
+	s->pos = 0;
+	s->x86_prev_mask = 0;
+	s->temp.filtered = 0;
+	s->temp.size = 0;
+
+	return XZ_OK;
+}
+
+#endif
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/dec_lzma2.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/dec_lzma2.c	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,1171 @@
+/*
+ * LZMA2 decoder
+ *
+ * Authors: Lasse Collin <lasse.collin@tukaani.org>
+ *          Igor Pavlov <http://7-zip.org/>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#include "private.h"
+#include "lzma2.h"
+
+/*
+ * Range decoder initialization eats the first five bytes of each LZMA chunk.
+ */
+#define RC_INIT_BYTES 5
+
+/*
+ * Minimum number of usable input buffer to safely decode one LZMA symbol.
+ * The worst case is that we decode 22 bits using probabilities and 26
+ * direct bits. This may decode at maximum of 20 bytes of input. However,
+ * lzma_main() does an extra normalization before returning, thus we
+ * need to put 21 here.
+ */
+#define LZMA_IN_REQUIRED 21
+
+/*
+ * Dictionary (history buffer)
+ *
+ * These are always true:
+ *    start <= pos <= full <= end
+ *    pos <= limit <= end
+ *
+ * In multi-call mode, also these are true:
+ *    end == size
+ *    size <= size_max
+ *    allocated <= size
+ *
+ * Most of these variables are size_t to support single-call mode,
+ * in which the dictionary variables address the actual output
+ * buffer directly.
+ */
+struct dictionary {
+	/* Beginning of the history buffer */
+	uint8_t *buf;
+
+	/* Old position in buf (before decoding more data) */
+	size_t start;
+
+	/* Position in buf */
+	size_t pos;
+
+	/*
+	 * How full dictionary is. This is used to detect corrupt input that
+	 * would read beyond the beginning of the uncompressed stream.
+	 */
+	size_t full;
+
+	/* Write limit; we don't write to buf[limit] or later bytes. */
+	size_t limit;
+
+	/*
+	 * End of the dictionary buffer. In multi-call mode, this is
+	 * the same as the dictionary size. In single-call mode, this
+	 * indicates the size of the output buffer.
+	 */
+	size_t end;
+
+	/*
+	 * Size of the dictionary as specified in Block Header. This is used
+	 * together with "full" to detect corrupt input that would make us
+	 * read beyond the beginning of the uncompressed stream.
+	 */
+	uint32_t size;
+
+	/*
+	 * Maximum allowed dictionary size in multi-call mode.
+	 * This is ignored in single-call mode.
+	 */
+	uint32_t size_max;
+
+	/*
+	 * Amount of memory currently allocated for the dictionary.
+	 * This is used only with XZ_DYNALLOC. (With XZ_PREALLOC,
+	 * size_max is always the same as the allocated size.)
+	 */
+	uint32_t allocated;
+
+	/* Operation mode */
+	enum xz_mode mode;
+};
+
+/* Range decoder */
+struct rc_dec {
+	uint32_t range;
+	uint32_t code;
+
+	/*
+	 * Number of initializing bytes remaining to be read
+	 * by rc_read_init().
+	 */
+	uint32_t init_bytes_left;
+
+	/*
+	 * Buffer from which we read our input. It can be either
+	 * temp.buf or the caller-provided input buffer.
+	 */
+	const uint8_t *in;
+	size_t in_pos;
+	size_t in_limit;
+};
+
+/* Probabilities for a length decoder. */
+struct lzma_len_dec {
+	/* Probability of match length being at least 10 */
+	uint16_t choice;
+
+	/* Probability of match length being at least 18 */
+	uint16_t choice2;
+
+	/* Probabilities for match lengths 2-9 */
+	uint16_t low[POS_STATES_MAX][LEN_LOW_SYMBOLS];
+
+	/* Probabilities for match lengths 10-17 */
+	uint16_t mid[POS_STATES_MAX][LEN_MID_SYMBOLS];
+
+	/* Probabilities for match lengths 18-273 */
+	uint16_t high[LEN_HIGH_SYMBOLS];
+};
+
+struct lzma_dec {
+	/* Distances of latest four matches */
+	uint32_t rep0;
+	uint32_t rep1;
+	uint32_t rep2;
+	uint32_t rep3;
+
+	/* Types of the most recently seen LZMA symbols */
+	enum lzma_state state;
+
+	/*
+	 * Length of a match. This is updated so that dict_repeat can
+	 * be called again to finish repeating the whole match.
+	 */
+	uint32_t len;
+
+	/*
+	 * LZMA properties or related bit masks (number of literal
+	 * context bits, a mask dervied from the number of literal
+	 * position bits, and a mask dervied from the number
+	 * position bits)
+	 */
+	uint32_t lc;
+	uint32_t literal_pos_mask; /* (1 << lp) - 1 */
+	uint32_t pos_mask;         /* (1 << pb) - 1 */
+
+	/* If 1, it's a match. Otherwise it's a single 8-bit literal. */
+	uint16_t is_match[STATES][POS_STATES_MAX];
+
+	/* If 1, it's a repeated match. The distance is one of rep0 .. rep3. */
+	uint16_t is_rep[STATES];
+
+	/*
+	 * If 0, distance of a repeated match is rep0.
+	 * Otherwise check is_rep1.
+	 */
+	uint16_t is_rep0[STATES];
+
+	/*
+	 * If 0, distance of a repeated match is rep1.
+	 * Otherwise check is_rep2.
+	 */
+	uint16_t is_rep1[STATES];
+
+	/* If 0, distance of a repeated match is rep2. Otherwise it is rep3. */
+	uint16_t is_rep2[STATES];
+
+	/*
+	 * If 1, the repeated match has length of one byte. Otherwise
+	 * the length is decoded from rep_len_decoder.
+	 */
+	uint16_t is_rep0_long[STATES][POS_STATES_MAX];
+
+	/*
+	 * Probability tree for the highest two bits of the match
+	 * distance. There is a separate probability tree for match
+	 * lengths of 2 (i.e. MATCH_LEN_MIN), 3, 4, and [5, 273].
+	 */
+	uint16_t dist_slot[DIST_STATES][DIST_SLOTS];
+
+	/*
+	 * Probility trees for additional bits for match distance
+	 * when the distance is in the range [4, 127].
+	 */
+	uint16_t dist_special[FULL_DISTANCES - DIST_MODEL_END];
+
+	/*
+	 * Probability tree for the lowest four bits of a match
+	 * distance that is equal to or greater than 128.
+	 */
+	uint16_t dist_align[ALIGN_SIZE];
+
+	/* Length of a normal match */
+	struct lzma_len_dec match_len_dec;
+
+	/* Length of a repeated match */
+	struct lzma_len_dec rep_len_dec;
+
+	/* Probabilities of literals */
+	uint16_t literal[LITERAL_CODERS_MAX][LITERAL_CODER_SIZE];
+};
+
+struct lzma2_dec {
+	/* Position in xz_dec_lzma2_run(). */
+	enum lzma2_seq {
+		SEQ_CONTROL,
+		SEQ_UNCOMPRESSED_1,
+		SEQ_UNCOMPRESSED_2,
+		SEQ_COMPRESSED_0,
+		SEQ_COMPRESSED_1,
+		SEQ_PROPERTIES,
+		SEQ_LZMA_PREPARE,
+		SEQ_LZMA_RUN,
+		SEQ_COPY
+	} sequence;
+
+	/* Next position after decoding the compressed size of the chunk. */
+	enum lzma2_seq next_sequence;
+
+	/* Uncompressed size of LZMA chunk (2 MiB at maximum) */
+	uint32_t uncompressed;
+
+	/*
+	 * Compressed size of LZMA chunk or compressed/uncompressed
+	 * size of uncompressed chunk (64 KiB at maximum)
+	 */
+	uint32_t compressed;
+
+	/*
+	 * True if dictionary reset is needed. This is false before
+	 * the first chunk (LZMA or uncompressed).
+	 */
+	bool_t need_dict_reset;
+
+	/*
+	 * True if new LZMA properties are needed. This is false
+	 * before the first LZMA chunk.
+	 */
+	bool_t need_props;
+};
+
+struct xz_dec_lzma2 {
+	/*
+	 * The order below is important on x86 to reduce code size and
+	 * it shouldn't hurt on other platforms. Everything up to and
+	 * including lzma.pos_mask are in the first 128 bytes on x86-32,
+	 * which allows using smaller instructions to access those
+	 * variables. On x86-64, fewer variables fit into the first 128
+	 * bytes, but this is still the best order without sacrificing
+	 * the readability by splitting the structures.
+	 */
+	struct rc_dec rc;
+	struct dictionary dict;
+	struct lzma2_dec lzma2;
+	struct lzma_dec lzma;
+
+	/*
+	 * Temporary buffer which holds small number of input bytes between
+	 * decoder calls. See lzma2_lzma() for details.
+	 */
+	struct {
+		uint32_t size;
+		uint8_t buf[3 * LZMA_IN_REQUIRED];
+	} temp;
+};
+
+/**************
+ * Dictionary *
+ **************/
+
+/*
+ * Reset the dictionary state. When in single-call mode, set up the beginning
+ * of the dictionary to point to the actual output buffer.
+ */
+static void INIT dict_reset(struct dictionary *dict, struct xz_buf *b)
+{
+	if (DEC_IS_SINGLE(dict->mode)) {
+		dict->buf = b->out + b->out_pos;
+		dict->end = b->out_size - b->out_pos;
+	}
+
+	dict->start = 0;
+	dict->pos = 0;
+	dict->limit = 0;
+	dict->full = 0;
+}
+
+/* Set dictionary write limit */
+static void INIT dict_limit(struct dictionary *dict, size_t out_max)
+{
+	if (dict->end - dict->pos <= out_max)
+		dict->limit = dict->end;
+	else
+		dict->limit = dict->pos + out_max;
+}
+
+/* Return true if at least one byte can be written into the dictionary. */
+static inline bool_t INIT dict_has_space(const struct dictionary *dict)
+{
+	return dict->pos < dict->limit;
+}
+
+/*
+ * Get a byte from the dictionary at the given distance. The distance is
+ * assumed to valid, or as a special case, zero when the dictionary is
+ * still empty. This special case is needed for single-call decoding to
+ * avoid writing a '\0' to the end of the destination buffer.
+ */
+static inline uint32_t INIT dict_get(const struct dictionary *dict, uint32_t dist)
+{
+	size_t offset = dict->pos - dist - 1;
+
+	if (dist >= dict->pos)
+		offset += dict->end;
+
+	return dict->full > 0 ? dict->buf[offset] : 0;
+}
+
+/*
+ * Put one byte into the dictionary. It is assumed that there is space for it.
+ */
+static inline void INIT dict_put(struct dictionary *dict, uint8_t byte)
+{
+	dict->buf[dict->pos++] = byte;
+
+	if (dict->full < dict->pos)
+		dict->full = dict->pos;
+}
+
+/*
+ * Repeat given number of bytes from the given distance. If the distance is
+ * invalid, false is returned. On success, true is returned and *len is
+ * updated to indicate how many bytes were left to be repeated.
+ */
+static bool_t INIT dict_repeat(struct dictionary *dict, uint32_t *len, uint32_t dist)
+{
+	size_t back;
+	uint32_t left;
+
+	if (dist >= dict->full || dist >= dict->size)
+		return false;
+
+	left = min_t(size_t, dict->limit - dict->pos, *len);
+	*len -= left;
+
+	back = dict->pos - dist - 1;
+	if (dist >= dict->pos)
+		back += dict->end;
+
+	do {
+		dict->buf[dict->pos++] = dict->buf[back++];
+		if (back == dict->end)
+			back = 0;
+	} while (--left > 0);
+
+	if (dict->full < dict->pos)
+		dict->full = dict->pos;
+
+	return true;
+}
+
+/* Copy uncompressed data as is from input to dictionary and output buffers. */
+static void INIT dict_uncompressed(struct dictionary *dict, struct xz_buf *b,
+				   uint32_t *left)
+{
+	size_t copy_size;
+
+	while (*left > 0 && b->in_pos < b->in_size
+			&& b->out_pos < b->out_size) {
+		copy_size = min(b->in_size - b->in_pos,
+				b->out_size - b->out_pos);
+		if (copy_size > dict->end - dict->pos)
+			copy_size = dict->end - dict->pos;
+		if (copy_size > *left)
+			copy_size = *left;
+
+		*left -= copy_size;
+
+		memcpy(dict->buf + dict->pos, b->in + b->in_pos, copy_size);
+		dict->pos += copy_size;
+
+		if (dict->full < dict->pos)
+			dict->full = dict->pos;
+
+		if (DEC_IS_MULTI(dict->mode)) {
+			if (dict->pos == dict->end)
+				dict->pos = 0;
+
+			memcpy(b->out + b->out_pos, b->in + b->in_pos,
+					copy_size);
+		}
+
+		dict->start = dict->pos;
+
+		b->out_pos += copy_size;
+		b->in_pos += copy_size;
+	}
+}
+
+/*
+ * Flush pending data from dictionary to b->out. It is assumed that there is
+ * enough space in b->out. This is guaranteed because caller uses dict_limit()
+ * before decoding data into the dictionary.
+ */
+static uint32_t INIT dict_flush(struct dictionary *dict, struct xz_buf *b)
+{
+	size_t copy_size = dict->pos - dict->start;
+
+	if (DEC_IS_MULTI(dict->mode)) {
+		if (dict->pos == dict->end)
+			dict->pos = 0;
+
+		memcpy(b->out + b->out_pos, dict->buf + dict->start,
+				copy_size);
+	}
+
+	dict->start = dict->pos;
+	b->out_pos += copy_size;
+	return copy_size;
+}
+
+/*****************
+ * Range decoder *
+ *****************/
+
+/* Reset the range decoder. */
+static void INIT rc_reset(struct rc_dec *rc)
+{
+	rc->range = (uint32_t)-1;
+	rc->code = 0;
+	rc->init_bytes_left = RC_INIT_BYTES;
+}
+
+/*
+ * Read the first five initial bytes into rc->code if they haven't been
+ * read already. (Yes, the first byte gets completely ignored.)
+ */
+static bool_t INIT rc_read_init(struct rc_dec *rc, struct xz_buf *b)
+{
+	while (rc->init_bytes_left > 0) {
+		if (b->in_pos == b->in_size)
+			return false;
+
+		rc->code = (rc->code << 8) + b->in[b->in_pos++];
+		--rc->init_bytes_left;
+	}
+
+	return true;
+}
+
+/* Return true if there may not be enough input for the next decoding loop. */
+static inline bool_t INIT rc_limit_exceeded(const struct rc_dec *rc)
+{
+	return rc->in_pos > rc->in_limit;
+}
+
+/*
+ * Return true if it is possible (from point of view of range decoder) that
+ * we have reached the end of the LZMA chunk.
+ */
+static inline bool_t INIT rc_is_finished(const struct rc_dec *rc)
+{
+	return rc->code == 0;
+}
+
+/* Read the next input byte if needed. */
+static always_inline void rc_normalize(struct rc_dec *rc)
+{
+	if (rc->range < RC_TOP_VALUE) {
+		rc->range <<= RC_SHIFT_BITS;
+		rc->code = (rc->code << RC_SHIFT_BITS) + rc->in[rc->in_pos++];
+	}
+}
+
+/*
+ * Decode one bit. In some versions, this function has been splitted in three
+ * functions so that the compiler is supposed to be able to more easily avoid
+ * an extra branch. In this particular version of the LZMA decoder, this
+ * doesn't seem to be a good idea (tested with GCC 3.3.6, 3.4.6, and 4.3.3
+ * on x86). Using a non-splitted version results in nicer looking code too.
+ *
+ * NOTE: This must return an int. Do not make it return a bool or the speed
+ * of the code generated by GCC 3.x decreases 10-15 %. (GCC 4.3 doesn't care,
+ * and it generates 10-20 % faster code than GCC 3.x from this file anyway.)
+ */
+static always_inline int rc_bit(struct rc_dec *rc, uint16_t *prob)
+{
+	uint32_t bound;
+	int bit;
+
+	rc_normalize(rc);
+	bound = (rc->range >> RC_BIT_MODEL_TOTAL_BITS) * *prob;
+	if (rc->code < bound) {
+		rc->range = bound;
+		*prob += (RC_BIT_MODEL_TOTAL - *prob) >> RC_MOVE_BITS;
+		bit = 0;
+	} else {
+		rc->range -= bound;
+		rc->code -= bound;
+		*prob -= *prob >> RC_MOVE_BITS;
+		bit = 1;
+	}
+
+	return bit;
+}
+
+/* Decode a bittree starting from the most significant bit. */
+static always_inline uint32_t rc_bittree(struct rc_dec *rc,
+					 uint16_t *probs, uint32_t limit)
+{
+	uint32_t symbol = 1;
+
+	do {
+		if (rc_bit(rc, &probs[symbol]))
+			symbol = (symbol << 1) + 1;
+		else
+			symbol <<= 1;
+	} while (symbol < limit);
+
+	return symbol;
+}
+
+/* Decode a bittree starting from the least significant bit. */
+static always_inline void rc_bittree_reverse(struct rc_dec *rc,
+					     uint16_t *probs,
+					     uint32_t *dest, uint32_t limit)
+{
+	uint32_t symbol = 1;
+	uint32_t i = 0;
+
+	do {
+		if (rc_bit(rc, &probs[symbol])) {
+			symbol = (symbol << 1) + 1;
+			*dest += 1 << i;
+		} else {
+			symbol <<= 1;
+		}
+	} while (++i < limit);
+}
+
+/* Decode direct bits (fixed fifty-fifty probability) */
+static inline void INIT rc_direct(struct rc_dec *rc, uint32_t *dest, uint32_t limit)
+{
+	uint32_t mask;
+
+	do {
+		rc_normalize(rc);
+		rc->range >>= 1;
+		rc->code -= rc->range;
+		mask = (uint32_t)0 - (rc->code >> 31);
+		rc->code += rc->range & mask;
+		*dest = (*dest << 1) + (mask + 1);
+	} while (--limit > 0);
+}
+
+/********
+ * LZMA *
+ ********/
+
+/* Get pointer to literal coder probability array. */
+static uint16_t *INIT lzma_literal_probs(struct xz_dec_lzma2 *s)
+{
+	uint32_t prev_byte = dict_get(&s->dict, 0);
+	uint32_t low = prev_byte >> (8 - s->lzma.lc);
+	uint32_t high = (s->dict.pos & s->lzma.literal_pos_mask) << s->lzma.lc;
+	return s->lzma.literal[low + high];
+}
+
+/* Decode a literal (one 8-bit byte) */
+static void INIT lzma_literal(struct xz_dec_lzma2 *s)
+{
+	uint16_t *probs;
+	uint32_t symbol;
+	uint32_t match_byte;
+	uint32_t match_bit;
+	uint32_t offset;
+	uint32_t i;
+
+	probs = lzma_literal_probs(s);
+
+	if (lzma_state_is_literal(s->lzma.state)) {
+		symbol = rc_bittree(&s->rc, probs, 0x100);
+	} else {
+		symbol = 1;
+		match_byte = dict_get(&s->dict, s->lzma.rep0) << 1;
+		offset = 0x100;
+
+		do {
+			match_bit = match_byte & offset;
+			match_byte <<= 1;
+			i = offset + match_bit + symbol;
+
+			if (rc_bit(&s->rc, &probs[i])) {
+				symbol = (symbol << 1) + 1;
+				offset &= match_bit;
+			} else {
+				symbol <<= 1;
+				offset &= ~match_bit;
+			}
+		} while (symbol < 0x100);
+	}
+
+	dict_put(&s->dict, (uint8_t)symbol);
+	lzma_state_literal(&s->lzma.state);
+}
+
+/* Decode the length of the match into s->lzma.len. */
+static void INIT lzma_len(struct xz_dec_lzma2 *s, struct lzma_len_dec *l,
+			  uint32_t pos_state)
+{
+	uint16_t *probs;
+	uint32_t limit;
+
+	if (!rc_bit(&s->rc, &l->choice)) {
+		probs = l->low[pos_state];
+		limit = LEN_LOW_SYMBOLS;
+		s->lzma.len = MATCH_LEN_MIN;
+	} else {
+		if (!rc_bit(&s->rc, &l->choice2)) {
+			probs = l->mid[pos_state];
+			limit = LEN_MID_SYMBOLS;
+			s->lzma.len = MATCH_LEN_MIN + LEN_LOW_SYMBOLS;
+		} else {
+			probs = l->high;
+			limit = LEN_HIGH_SYMBOLS;
+			s->lzma.len = MATCH_LEN_MIN + LEN_LOW_SYMBOLS
+					+ LEN_MID_SYMBOLS;
+		}
+	}
+
+	s->lzma.len += rc_bittree(&s->rc, probs, limit) - limit;
+}
+
+/* Decode a match. The distance will be stored in s->lzma.rep0. */
+static void INIT lzma_match(struct xz_dec_lzma2 *s, uint32_t pos_state)
+{
+	uint16_t *probs;
+	uint32_t dist_slot;
+	uint32_t limit;
+
+	lzma_state_match(&s->lzma.state);
+
+	s->lzma.rep3 = s->lzma.rep2;
+	s->lzma.rep2 = s->lzma.rep1;
+	s->lzma.rep1 = s->lzma.rep0;
+
+	lzma_len(s, &s->lzma.match_len_dec, pos_state);
+
+	probs = s->lzma.dist_slot[lzma_get_dist_state(s->lzma.len)];
+	dist_slot = rc_bittree(&s->rc, probs, DIST_SLOTS) - DIST_SLOTS;
+
+	if (dist_slot < DIST_MODEL_START) {
+		s->lzma.rep0 = dist_slot;
+	} else {
+		limit = (dist_slot >> 1) - 1;
+		s->lzma.rep0 = 2 + (dist_slot & 1);
+
+		if (dist_slot < DIST_MODEL_END) {
+			s->lzma.rep0 <<= limit;
+			probs = s->lzma.dist_special + s->lzma.rep0
+					- dist_slot - 1;
+			rc_bittree_reverse(&s->rc, probs,
+					&s->lzma.rep0, limit);
+		} else {
+			rc_direct(&s->rc, &s->lzma.rep0, limit - ALIGN_BITS);
+			s->lzma.rep0 <<= ALIGN_BITS;
+			rc_bittree_reverse(&s->rc, s->lzma.dist_align,
+					&s->lzma.rep0, ALIGN_BITS);
+		}
+	}
+}
+
+/*
+ * Decode a repeated match. The distance is one of the four most recently
+ * seen matches. The distance will be stored in s->lzma.rep0.
+ */
+static void INIT lzma_rep_match(struct xz_dec_lzma2 *s, uint32_t pos_state)
+{
+	uint32_t tmp;
+
+	if (!rc_bit(&s->rc, &s->lzma.is_rep0[s->lzma.state])) {
+		if (!rc_bit(&s->rc, &s->lzma.is_rep0_long[
+				s->lzma.state][pos_state])) {
+			lzma_state_short_rep(&s->lzma.state);
+			s->lzma.len = 1;
+			return;
+		}
+	} else {
+		if (!rc_bit(&s->rc, &s->lzma.is_rep1[s->lzma.state])) {
+			tmp = s->lzma.rep1;
+		} else {
+			if (!rc_bit(&s->rc, &s->lzma.is_rep2[s->lzma.state])) {
+				tmp = s->lzma.rep2;
+			} else {
+				tmp = s->lzma.rep3;
+				s->lzma.rep3 = s->lzma.rep2;
+			}
+
+			s->lzma.rep2 = s->lzma.rep1;
+		}
+
+		s->lzma.rep1 = s->lzma.rep0;
+		s->lzma.rep0 = tmp;
+	}
+
+	lzma_state_long_rep(&s->lzma.state);
+	lzma_len(s, &s->lzma.rep_len_dec, pos_state);
+}
+
+/* LZMA decoder core */
+static bool_t INIT lzma_main(struct xz_dec_lzma2 *s)
+{
+	uint32_t pos_state;
+
+	/*
+	 * If the dictionary was reached during the previous call, try to
+	 * finish the possibly pending repeat in the dictionary.
+	 */
+	if (dict_has_space(&s->dict) && s->lzma.len > 0)
+		dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0);
+
+	/*
+	 * Decode more LZMA symbols. One iteration may consume up to
+	 * LZMA_IN_REQUIRED - 1 bytes.
+	 */
+	while (dict_has_space(&s->dict) && !rc_limit_exceeded(&s->rc)) {
+		pos_state = s->dict.pos & s->lzma.pos_mask;
+
+		if (!rc_bit(&s->rc, &s->lzma.is_match[
+				s->lzma.state][pos_state])) {
+			lzma_literal(s);
+		} else {
+			if (rc_bit(&s->rc, &s->lzma.is_rep[s->lzma.state]))
+				lzma_rep_match(s, pos_state);
+			else
+				lzma_match(s, pos_state);
+
+			if (!dict_repeat(&s->dict, &s->lzma.len, s->lzma.rep0))
+				return false;
+		}
+	}
+
+	/*
+	 * Having the range decoder always normalized when we are outside
+	 * this function makes it easier to correctly handle end of the chunk.
+	 */
+	rc_normalize(&s->rc);
+
+	return true;
+}
+
+/*
+ * Reset the LZMA decoder and range decoder state. Dictionary is nore reset
+ * here, because LZMA state may be reset without resetting the dictionary.
+ */
+static void INIT lzma_reset(struct xz_dec_lzma2 *s)
+{
+	uint16_t *probs;
+	size_t i;
+
+	s->lzma.state = STATE_LIT_LIT;
+	s->lzma.rep0 = 0;
+	s->lzma.rep1 = 0;
+	s->lzma.rep2 = 0;
+	s->lzma.rep3 = 0;
+
+	/*
+	 * All probabilities are initialized to the same value. This hack
+	 * makes the code smaller by avoiding a separate loop for each
+	 * probability array.
+	 *
+	 * This could be optimized so that only that part of literal
+	 * probabilities that are actually required. In the common case
+	 * we would write 12 KiB less.
+	 */
+	probs = s->lzma.is_match[0];
+	for (i = 0; i < PROBS_TOTAL; ++i)
+		probs[i] = RC_BIT_MODEL_TOTAL / 2;
+
+	rc_reset(&s->rc);
+}
+
+/*
+ * Decode and validate LZMA properties (lc/lp/pb) and calculate the bit masks
+ * from the decoded lp and pb values. On success, the LZMA decoder state is
+ * reset and true is returned.
+ */
+static bool_t INIT lzma_props(struct xz_dec_lzma2 *s, uint8_t props)
+{
+	if (props > (4 * 5 + 4) * 9 + 8)
+		return false;
+
+	s->lzma.pos_mask = 0;
+	while (props >= 9 * 5) {
+		props -= 9 * 5;
+		++s->lzma.pos_mask;
+	}
+
+	s->lzma.pos_mask = (1 << s->lzma.pos_mask) - 1;
+
+	s->lzma.literal_pos_mask = 0;
+	while (props >= 9) {
+		props -= 9;
+		++s->lzma.literal_pos_mask;
+	}
+
+	s->lzma.lc = props;
+
+	if (s->lzma.lc + s->lzma.literal_pos_mask > 4)
+		return false;
+
+	s->lzma.literal_pos_mask = (1 << s->lzma.literal_pos_mask) - 1;
+
+	lzma_reset(s);
+
+	return true;
+}
+
+/*********
+ * LZMA2 *
+ *********/
+
+/*
+ * The LZMA decoder assumes that if the input limit (s->rc.in_limit) hasn't
+ * been exceeded, it is safe to read up to LZMA_IN_REQUIRED bytes. This
+ * wrapper function takes care of making the LZMA decoder's assumption safe.
+ *
+ * As long as there is plenty of input left to be decoded in the current LZMA
+ * chunk, we decode directly from the caller-supplied input buffer until
+ * there's LZMA_IN_REQUIRED bytes left. Those remaining bytes are copied into
+ * s->temp.buf, which (hopefully) gets filled on the next call to this
+ * function. We decode a few bytes from the temporary buffer so that we can
+ * continue decoding from the caller-supplied input buffer again.
+ */
+static bool_t INIT lzma2_lzma(struct xz_dec_lzma2 *s, struct xz_buf *b)
+{
+	size_t in_avail;
+	uint32_t tmp;
+
+	in_avail = b->in_size - b->in_pos;
+	if (s->temp.size > 0 || s->lzma2.compressed == 0) {
+		tmp = 2 * LZMA_IN_REQUIRED - s->temp.size;
+		if (tmp > s->lzma2.compressed - s->temp.size)
+			tmp = s->lzma2.compressed - s->temp.size;
+		if (tmp > in_avail)
+			tmp = in_avail;
+
+		memcpy(s->temp.buf + s->temp.size, b->in + b->in_pos, tmp);
+
+		if (s->temp.size + tmp == s->lzma2.compressed) {
+			memzero(s->temp.buf + s->temp.size + tmp,
+					sizeof(s->temp.buf)
+						- s->temp.size - tmp);
+			s->rc.in_limit = s->temp.size + tmp;
+		} else if (s->temp.size + tmp < LZMA_IN_REQUIRED) {
+			s->temp.size += tmp;
+			b->in_pos += tmp;
+			return true;
+		} else {
+			s->rc.in_limit = s->temp.size + tmp - LZMA_IN_REQUIRED;
+		}
+
+		s->rc.in = s->temp.buf;
+		s->rc.in_pos = 0;
+
+		if (!lzma_main(s) || s->rc.in_pos > s->temp.size + tmp)
+			return false;
+
+		s->lzma2.compressed -= s->rc.in_pos;
+
+		if (s->rc.in_pos < s->temp.size) {
+			s->temp.size -= s->rc.in_pos;
+			memmove(s->temp.buf, s->temp.buf + s->rc.in_pos,
+					s->temp.size);
+			return true;
+		}
+
+		b->in_pos += s->rc.in_pos - s->temp.size;
+		s->temp.size = 0;
+	}
+
+	in_avail = b->in_size - b->in_pos;
+	if (in_avail >= LZMA_IN_REQUIRED) {
+		s->rc.in = b->in;
+		s->rc.in_pos = b->in_pos;
+
+		if (in_avail >= s->lzma2.compressed + LZMA_IN_REQUIRED)
+			s->rc.in_limit = b->in_pos + s->lzma2.compressed;
+		else
+			s->rc.in_limit = b->in_size - LZMA_IN_REQUIRED;
+
+		if (!lzma_main(s))
+			return false;
+
+		in_avail = s->rc.in_pos - b->in_pos;
+		if (in_avail > s->lzma2.compressed)
+			return false;
+
+		s->lzma2.compressed -= in_avail;
+		b->in_pos = s->rc.in_pos;
+	}
+
+	in_avail = b->in_size - b->in_pos;
+	if (in_avail < LZMA_IN_REQUIRED) {
+		if (in_avail > s->lzma2.compressed)
+			in_avail = s->lzma2.compressed;
+
+		memcpy(s->temp.buf, b->in + b->in_pos, in_avail);
+		s->temp.size = in_avail;
+		b->in_pos += in_avail;
+	}
+
+	return true;
+}
+
+/*
+ * Take care of the LZMA2 control layer, and forward the job of actual LZMA
+ * decoding or copying of uncompressed chunks to other functions.
+ */
+XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
+					    struct xz_buf *b)
+{
+	uint32_t tmp;
+
+	while (b->in_pos < b->in_size || s->lzma2.sequence == SEQ_LZMA_RUN) {
+		switch (s->lzma2.sequence) {
+		case SEQ_CONTROL:
+			/*
+			 * LZMA2 control byte
+			 *
+			 * Exact values:
+			 *   0x00   End marker
+			 *   0x01   Dictionary reset followed by
+			 *          an uncompressed chunk
+			 *   0x02   Uncompressed chunk (no dictionary reset)
+			 *
+			 * Highest three bits (s->control & 0xE0):
+			 *   0xE0   Dictionary reset, new properties and state
+			 *          reset, followed by LZMA compressed chunk
+			 *   0xC0   New properties and state reset, followed
+			 *          by LZMA compressed chunk (no dictionary
+			 *          reset)
+			 *   0xA0   State reset using old properties,
+			 *          followed by LZMA compressed chunk (no
+			 *          dictionary reset)
+			 *   0x80   LZMA chunk (no dictionary or state reset)
+			 *
+			 * For LZMA compressed chunks, the lowest five bits
+			 * (s->control & 1F) are the highest bits of the
+			 * uncompressed size (bits 16-20).
+			 *
+			 * A new LZMA2 stream must begin with a dictionary
+			 * reset. The first LZMA chunk must set new
+			 * properties and reset the LZMA state.
+			 *
+			 * Values that don't match anything described above
+			 * are invalid and we return XZ_DATA_ERROR.
+			 */
+			tmp = b->in[b->in_pos++];
+
+			if (tmp >= 0xE0 || tmp == 0x01) {
+				s->lzma2.need_props = true;
+				s->lzma2.need_dict_reset = false;
+				dict_reset(&s->dict, b);
+			} else if (s->lzma2.need_dict_reset) {
+				return XZ_DATA_ERROR;
+			}
+
+			if (tmp >= 0x80) {
+				s->lzma2.uncompressed = (tmp & 0x1F) << 16;
+				s->lzma2.sequence = SEQ_UNCOMPRESSED_1;
+
+				if (tmp >= 0xC0) {
+					/*
+					 * When there are new properties,
+					 * state reset is done at
+					 * SEQ_PROPERTIES.
+					 */
+					s->lzma2.need_props = false;
+					s->lzma2.next_sequence
+							= SEQ_PROPERTIES;
+
+				} else if (s->lzma2.need_props) {
+					return XZ_DATA_ERROR;
+
+				} else {
+					s->lzma2.next_sequence
+							= SEQ_LZMA_PREPARE;
+					if (tmp >= 0xA0)
+						lzma_reset(s);
+				}
+			} else {
+				if (tmp == 0x00)
+					return XZ_STREAM_END;
+
+				if (tmp > 0x02)
+					return XZ_DATA_ERROR;
+
+				s->lzma2.sequence = SEQ_COMPRESSED_0;
+				s->lzma2.next_sequence = SEQ_COPY;
+			}
+
+			break;
+
+		case SEQ_UNCOMPRESSED_1:
+			s->lzma2.uncompressed
+					+= (uint32_t)b->in[b->in_pos++] << 8;
+			s->lzma2.sequence = SEQ_UNCOMPRESSED_2;
+			break;
+
+		case SEQ_UNCOMPRESSED_2:
+			s->lzma2.uncompressed
+					+= (uint32_t)b->in[b->in_pos++] + 1;
+			s->lzma2.sequence = SEQ_COMPRESSED_0;
+			break;
+
+		case SEQ_COMPRESSED_0:
+			s->lzma2.compressed
+					= (uint32_t)b->in[b->in_pos++] << 8;
+			s->lzma2.sequence = SEQ_COMPRESSED_1;
+			break;
+
+		case SEQ_COMPRESSED_1:
+			s->lzma2.compressed
+					+= (uint32_t)b->in[b->in_pos++] + 1;
+			s->lzma2.sequence = s->lzma2.next_sequence;
+			break;
+
+		case SEQ_PROPERTIES:
+			if (!lzma_props(s, b->in[b->in_pos++]))
+				return XZ_DATA_ERROR;
+
+			s->lzma2.sequence = SEQ_LZMA_PREPARE;
+
+		case SEQ_LZMA_PREPARE:
+			if (s->lzma2.compressed < RC_INIT_BYTES)
+				return XZ_DATA_ERROR;
+
+			if (!rc_read_init(&s->rc, b))
+				return XZ_OK;
+
+			s->lzma2.compressed -= RC_INIT_BYTES;
+			s->lzma2.sequence = SEQ_LZMA_RUN;
+
+		case SEQ_LZMA_RUN:
+			/*
+			 * Set dictionary limit to indicate how much we want
+			 * to be encoded at maximum. Decode new data into the
+			 * dictionary. Flush the new data from dictionary to
+			 * b->out. Check if we finished decoding this chunk.
+			 * In case the dictionary got full but we didn't fill
+			 * the output buffer yet, we may run this loop
+			 * multiple times without changing s->lzma2.sequence.
+			 */
+			dict_limit(&s->dict, min_t(size_t,
+					b->out_size - b->out_pos,
+					s->lzma2.uncompressed));
+			if (!lzma2_lzma(s, b))
+				return XZ_DATA_ERROR;
+
+			s->lzma2.uncompressed -= dict_flush(&s->dict, b);
+
+			if (s->lzma2.uncompressed == 0) {
+				if (s->lzma2.compressed > 0 || s->lzma.len > 0
+						|| !rc_is_finished(&s->rc))
+					return XZ_DATA_ERROR;
+
+				rc_reset(&s->rc);
+				s->lzma2.sequence = SEQ_CONTROL;
+
+			} else if (b->out_pos == b->out_size
+					|| (b->in_pos == b->in_size
+						&& s->temp.size
+						< s->lzma2.compressed)) {
+				return XZ_OK;
+			}
+
+			break;
+
+		case SEQ_COPY:
+			dict_uncompressed(&s->dict, b, &s->lzma2.compressed);
+			if (s->lzma2.compressed > 0)
+				return XZ_OK;
+
+			s->lzma2.sequence = SEQ_CONTROL;
+			break;
+		}
+	}
+
+	return XZ_OK;
+}
+
+XZ_EXTERN struct xz_dec_lzma2 *INIT xz_dec_lzma2_create(enum xz_mode mode,
+						   uint32_t dict_max)
+{
+	struct xz_dec_lzma2 *s = malloc(sizeof(*s));
+	if (s == NULL)
+		return NULL;
+
+	s->dict.mode = mode;
+	s->dict.size_max = dict_max;
+
+	if (DEC_IS_PREALLOC(mode)) {
+		s->dict.buf = large_malloc(dict_max);
+		if (s->dict.buf == NULL) {
+			free(s);
+			return NULL;
+		}
+	} else if (DEC_IS_DYNALLOC(mode)) {
+		s->dict.buf = NULL;
+		s->dict.allocated = 0;
+	}
+
+	return s;
+}
+
+XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_reset(struct xz_dec_lzma2 *s, uint8_t props)
+{
+	/* This limits dictionary size to 3 GiB to keep parsing simpler. */
+	if (props > 39)
+		return XZ_OPTIONS_ERROR;
+
+	s->dict.size = 2 + (props & 1);
+	s->dict.size <<= (props >> 1) + 11;
+
+	if (DEC_IS_MULTI(s->dict.mode)) {
+		if (s->dict.size > s->dict.size_max)
+			return XZ_MEMLIMIT_ERROR;
+
+		s->dict.end = s->dict.size;
+
+		if (DEC_IS_DYNALLOC(s->dict.mode)) {
+			if (s->dict.allocated < s->dict.size) {
+				large_free(s->dict.buf);
+				s->dict.buf = large_malloc(s->dict.size);
+				if (s->dict.buf == NULL) {
+					s->dict.allocated = 0;
+					return XZ_MEM_ERROR;
+				}
+			}
+		}
+	}
+
+	s->lzma.len = 0;
+
+	s->lzma2.sequence = SEQ_CONTROL;
+	s->lzma2.need_dict_reset = true;
+
+	s->temp.size = 0;
+
+	return XZ_OK;
+}
+
+XZ_EXTERN void INIT xz_dec_lzma2_end(struct xz_dec_lzma2 *s)
+{
+	if (DEC_IS_MULTI(s->dict.mode))
+		large_free(s->dict.buf);
+
+	free(s);
+}
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/dec_stream.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/dec_stream.c	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,821 @@
+/*
+ * .xz Stream decoder
+ *
+ * Author: Lasse Collin <lasse.collin@tukaani.org>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#include "private.h"
+#include "stream.h"
+
+/* Hash used to validate the Index field */
+struct xz_dec_hash {
+	vli_type unpadded;
+	vli_type uncompressed;
+	uint32_t crc32;
+};
+
+struct xz_dec {
+	/* Position in dec_main() */
+	enum {
+		SEQ_STREAM_HEADER,
+		SEQ_BLOCK_START,
+		SEQ_BLOCK_HEADER,
+		SEQ_BLOCK_UNCOMPRESS,
+		SEQ_BLOCK_PADDING,
+		SEQ_BLOCK_CHECK,
+		SEQ_INDEX,
+		SEQ_INDEX_PADDING,
+		SEQ_INDEX_CRC32,
+		SEQ_STREAM_FOOTER
+	} sequence;
+
+	/* Position in variable-length integers and Check fields */
+	uint32_t pos;
+
+	/* Variable-length integer decoded by dec_vli() */
+	vli_type vli;
+
+	/* Saved in_pos and out_pos */
+	size_t in_start;
+	size_t out_start;
+
+	/* CRC32 value in Block or Index */
+	uint32_t crc32;
+
+	/* Type of the integrity check calculated from uncompressed data */
+	enum xz_check check_type;
+
+	/* Operation mode */
+	enum xz_mode mode;
+
+	/*
+	 * True if the next call to xz_dec_run() is allowed to return
+	 * XZ_BUF_ERROR.
+	 */
+	bool_t allow_buf_error;
+
+	/* Information stored in Block Header */
+	struct {
+		/*
+		 * Value stored in the Compressed Size field, or
+		 * VLI_UNKNOWN if Compressed Size is not present.
+		 */
+		vli_type compressed;
+
+		/*
+		 * Value stored in the Uncompressed Size field, or
+		 * VLI_UNKNOWN if Uncompressed Size is not present.
+		 */
+		vli_type uncompressed;
+
+		/* Size of the Block Header field */
+		uint32_t size;
+	} block_header;
+
+	/* Information collected when decoding Blocks */
+	struct {
+		/* Observed compressed size of the current Block */
+		vli_type compressed;
+
+		/* Observed uncompressed size of the current Block */
+		vli_type uncompressed;
+
+		/* Number of Blocks decoded so far */
+		vli_type count;
+
+		/*
+		 * Hash calculated from the Block sizes. This is used to
+		 * validate the Index field.
+		 */
+		struct xz_dec_hash hash;
+	} block;
+
+	/* Variables needed when verifying the Index field */
+	struct {
+		/* Position in dec_index() */
+		enum {
+			SEQ_INDEX_COUNT,
+			SEQ_INDEX_UNPADDED,
+			SEQ_INDEX_UNCOMPRESSED
+		} sequence;
+
+		/* Size of the Index in bytes */
+		vli_type size;
+
+		/* Number of Records (matches block.count in valid files) */
+		vli_type count;
+
+		/*
+		 * Hash calculated from the Records (matches block.hash in
+		 * valid files).
+		 */
+		struct xz_dec_hash hash;
+	} index;
+
+	/*
+	 * Temporary buffer needed to hold Stream Header, Block Header,
+	 * and Stream Footer. The Block Header is the biggest (1 KiB)
+	 * so we reserve space according to that. buf[] has to be aligned
+	 * to a multiple of four bytes; the size_t variables before it
+	 * should guarantee this.
+	 */
+	struct {
+		size_t pos;
+		size_t size;
+		uint8_t buf[1024];
+	} temp;
+
+	struct xz_dec_lzma2 *lzma2;
+
+#ifdef XZ_DEC_BCJ
+	struct xz_dec_bcj *bcj;
+	bool_t bcj_active;
+#endif
+};
+
+#ifdef XZ_DEC_ANY_CHECK
+/* Sizes of the Check field with different Check IDs */
+static const uint8_t check_sizes[16] = {
+	0,
+	4, 4, 4,
+	8, 8, 8,
+	16, 16, 16,
+	32, 32, 32,
+	64, 64, 64
+};
+#endif
+
+/*
+ * Fill s->temp by copying data starting from b->in[b->in_pos]. Caller
+ * must have set s->temp.pos to indicate how much data we are supposed
+ * to copy into s->temp.buf. Return true once s->temp.pos has reached
+ * s->temp.size.
+ */
+static bool_t INIT fill_temp(struct xz_dec *s, struct xz_buf *b)
+{
+	size_t copy_size = min_t(size_t,
+			b->in_size - b->in_pos, s->temp.size - s->temp.pos);
+
+	memcpy(s->temp.buf + s->temp.pos, b->in + b->in_pos, copy_size);
+	b->in_pos += copy_size;
+	s->temp.pos += copy_size;
+
+	if (s->temp.pos == s->temp.size) {
+		s->temp.pos = 0;
+		return true;
+	}
+
+	return false;
+}
+
+/* Decode a variable-length integer (little-endian base-128 encoding) */
+static enum xz_ret INIT dec_vli(struct xz_dec *s, const uint8_t *in,
+				size_t *in_pos, size_t in_size)
+{
+	uint8_t byte;
+
+	if (s->pos == 0)
+		s->vli = 0;
+
+	while (*in_pos < in_size) {
+		byte = in[*in_pos];
+		++*in_pos;
+
+		s->vli |= (vli_type)(byte & 0x7F) << s->pos;
+
+		if ((byte & 0x80) == 0) {
+			/* Don't allow non-minimal encodings. */
+			if (byte == 0 && s->pos != 0)
+				return XZ_DATA_ERROR;
+
+			s->pos = 0;
+			return XZ_STREAM_END;
+		}
+
+		s->pos += 7;
+		if (s->pos == 7 * VLI_BYTES_MAX)
+			return XZ_DATA_ERROR;
+	}
+
+	return XZ_OK;
+}
+
+/*
+ * Decode the Compressed Data field from a Block. Update and validate
+ * the observed compressed and uncompressed sizes of the Block so that
+ * they don't exceed the values possibly stored in the Block Header
+ * (validation assumes that no integer overflow occurs, since vli_type
+ * is normally uint64_t). Update the CRC32 if presence of the CRC32
+ * field was indicated in Stream Header.
+ *
+ * Once the decoding is finished, validate that the observed sizes match
+ * the sizes possibly stored in the Block Header. Update the hash and
+ * Block count, which are later used to validate the Index field.
+ */
+static enum xz_ret INIT dec_block(struct xz_dec *s, struct xz_buf *b)
+{
+	enum xz_ret ret;
+
+	s->in_start = b->in_pos;
+	s->out_start = b->out_pos;
+
+#ifdef XZ_DEC_BCJ
+	if (s->bcj_active)
+		ret = xz_dec_bcj_run(s->bcj, s->lzma2, b);
+	else
+#endif
+		ret = xz_dec_lzma2_run(s->lzma2, b);
+
+	s->block.compressed += b->in_pos - s->in_start;
+	s->block.uncompressed += b->out_pos - s->out_start;
+
+	/*
+	 * There is no need to separately check for VLI_UNKNOWN, since
+	 * the observed sizes are always smaller than VLI_UNKNOWN.
+	 */
+	if (s->block.compressed > s->block_header.compressed
+			|| s->block.uncompressed
+				> s->block_header.uncompressed)
+		return XZ_DATA_ERROR;
+
+	if (s->check_type == XZ_CHECK_CRC32)
+		s->crc32 = xz_crc32(b->out + s->out_start,
+				b->out_pos - s->out_start, s->crc32);
+
+	if (ret == XZ_STREAM_END) {
+		if (s->block_header.compressed != VLI_UNKNOWN
+				&& s->block_header.compressed
+					!= s->block.compressed)
+			return XZ_DATA_ERROR;
+
+		if (s->block_header.uncompressed != VLI_UNKNOWN
+				&& s->block_header.uncompressed
+					!= s->block.uncompressed)
+			return XZ_DATA_ERROR;
+
+		s->block.hash.unpadded += s->block_header.size
+				+ s->block.compressed;
+
+#ifdef XZ_DEC_ANY_CHECK
+		s->block.hash.unpadded += check_sizes[s->check_type];
+#else
+		if (s->check_type == XZ_CHECK_CRC32)
+			s->block.hash.unpadded += 4;
+#endif
+
+		s->block.hash.uncompressed += s->block.uncompressed;
+		s->block.hash.crc32 = xz_crc32(
+				(const uint8_t *)&s->block.hash,
+				sizeof(s->block.hash), s->block.hash.crc32);
+
+		++s->block.count;
+	}
+
+	return ret;
+}
+
+/* Update the Index size and the CRC32 value. */
+static void INIT index_update(struct xz_dec *s, const struct xz_buf *b)
+{
+	size_t in_used = b->in_pos - s->in_start;
+	s->index.size += in_used;
+	s->crc32 = xz_crc32(b->in + s->in_start, in_used, s->crc32);
+}
+
+/*
+ * Decode the Number of Records, Unpadded Size, and Uncompressed Size
+ * fields from the Index field. That is, Index Padding and CRC32 are not
+ * decoded by this function.
+ *
+ * This can return XZ_OK (more input needed), XZ_STREAM_END (everything
+ * successfully decoded), or XZ_DATA_ERROR (input is corrupt).
+ */
+static enum xz_ret INIT dec_index(struct xz_dec *s, struct xz_buf *b)
+{
+	enum xz_ret ret;
+
+	do {
+		ret = dec_vli(s, b->in, &b->in_pos, b->in_size);
+		if (ret != XZ_STREAM_END) {
+			index_update(s, b);
+			return ret;
+		}
+
+		switch (s->index.sequence) {
+		case SEQ_INDEX_COUNT:
+			s->index.count = s->vli;
+
+			/*
+			 * Validate that the Number of Records field
+			 * indicates the same number of Records as
+			 * there were Blocks in the Stream.
+			 */
+			if (s->index.count != s->block.count)
+				return XZ_DATA_ERROR;
+
+			s->index.sequence = SEQ_INDEX_UNPADDED;
+			break;
+
+		case SEQ_INDEX_UNPADDED:
+			s->index.hash.unpadded += s->vli;
+			s->index.sequence = SEQ_INDEX_UNCOMPRESSED;
+			break;
+
+		case SEQ_INDEX_UNCOMPRESSED:
+			s->index.hash.uncompressed += s->vli;
+			s->index.hash.crc32 = xz_crc32(
+					(const uint8_t *)&s->index.hash,
+					sizeof(s->index.hash),
+					s->index.hash.crc32);
+			--s->index.count;
+			s->index.sequence = SEQ_INDEX_UNPADDED;
+			break;
+		}
+	} while (s->index.count > 0);
+
+	return XZ_STREAM_END;
+}
+
+/*
+ * Validate that the next four input bytes match the value of s->crc32.
+ * s->pos must be zero when starting to validate the first byte.
+ */
+static enum xz_ret INIT crc32_validate(struct xz_dec *s, struct xz_buf *b)
+{
+	do {
+		if (b->in_pos == b->in_size)
+			return XZ_OK;
+
+		if (((s->crc32 >> s->pos) & 0xFF) != b->in[b->in_pos++])
+			return XZ_DATA_ERROR;
+
+		s->pos += 8;
+
+	} while (s->pos < 32);
+
+	s->crc32 = 0;
+	s->pos = 0;
+
+	return XZ_STREAM_END;
+}
+
+#ifdef XZ_DEC_ANY_CHECK
+/*
+ * Skip over the Check field when the Check ID is not supported.
+ * Returns true once the whole Check field has been skipped over.
+ */
+static bool_t INIT check_skip(struct xz_dec *s, struct xz_buf *b)
+{
+	while (s->pos < check_sizes[s->check_type]) {
+		if (b->in_pos == b->in_size)
+			return false;
+
+		++b->in_pos;
+		++s->pos;
+	}
+
+	s->pos = 0;
+
+	return true;
+}
+#endif
+
+/* Decode the Stream Header field (the first 12 bytes of the .xz Stream). */
+static enum xz_ret INIT dec_stream_header(struct xz_dec *s)
+{
+	if (!memeq(s->temp.buf, HEADER_MAGIC, HEADER_MAGIC_SIZE))
+		return XZ_FORMAT_ERROR;
+
+	if (xz_crc32(s->temp.buf + HEADER_MAGIC_SIZE, 2, 0)
+			!= get_le32(s->temp.buf + HEADER_MAGIC_SIZE + 2))
+		return XZ_DATA_ERROR;
+
+	if (s->temp.buf[HEADER_MAGIC_SIZE] != 0)
+		return XZ_OPTIONS_ERROR;
+
+	/*
+	 * Of integrity checks, we support only none (Check ID = 0) and
+	 * CRC32 (Check ID = 1). However, if XZ_DEC_ANY_CHECK is defined,
+	 * we will accept other check types too, but then the check won't
+	 * be verified and a warning (XZ_UNSUPPORTED_CHECK) will be given.
+	 */
+	s->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1];
+
+#ifdef XZ_DEC_ANY_CHECK
+	if (s->check_type > XZ_CHECK_MAX)
+		return XZ_OPTIONS_ERROR;
+
+	if (s->check_type > XZ_CHECK_CRC32)
+		return XZ_UNSUPPORTED_CHECK;
+#else
+	if (s->check_type > XZ_CHECK_CRC32)
+		return XZ_OPTIONS_ERROR;
+#endif
+
+	return XZ_OK;
+}
+
+/* Decode the Stream Footer field (the last 12 bytes of the .xz Stream) */
+static enum xz_ret INIT dec_stream_footer(struct xz_dec *s)
+{
+	if (!memeq(s->temp.buf + 10, FOOTER_MAGIC, FOOTER_MAGIC_SIZE))
+		return XZ_DATA_ERROR;
+
+	if (xz_crc32(s->temp.buf + 4, 6, 0) != get_le32(s->temp.buf))
+		return XZ_DATA_ERROR;
+
+	/*
+	 * Validate Backward Size. Note that we never added the size of the
+	 * Index CRC32 field to s->index.size, thus we use s->index.size / 4
+	 * instead of s->index.size / 4 - 1.
+	 */
+	if ((s->index.size >> 2) != get_le32(s->temp.buf + 4))
+		return XZ_DATA_ERROR;
+
+	if (s->temp.buf[8] != 0 || s->temp.buf[9] != s->check_type)
+		return XZ_DATA_ERROR;
+
+	/*
+	 * Use XZ_STREAM_END instead of XZ_OK to be more convenient
+	 * for the caller.
+	 */
+	return XZ_STREAM_END;
+}
+
+/* Decode the Block Header and initialize the filter chain. */
+static enum xz_ret INIT dec_block_header(struct xz_dec *s)
+{
+	enum xz_ret ret;
+
+	/*
+	 * Validate the CRC32. We know that the temp buffer is at least
+	 * eight bytes so this is safe.
+	 */
+	s->temp.size -= 4;
+	if (xz_crc32(s->temp.buf, s->temp.size, 0)
+			!= get_le32(s->temp.buf + s->temp.size))
+		return XZ_DATA_ERROR;
+
+	s->temp.pos = 2;
+
+	/*
+	 * Catch unsupported Block Flags. We support only one or two filters
+	 * in the chain, so we catch that with the same test.
+	 */
+#ifdef XZ_DEC_BCJ
+	if (s->temp.buf[1] & 0x3E)
+#else
+	if (s->temp.buf[1] & 0x3F)
+#endif
+		return XZ_OPTIONS_ERROR;
+
+	/* Compressed Size */
+	if (s->temp.buf[1] & 0x40) {
+		if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)
+					!= XZ_STREAM_END)
+			return XZ_DATA_ERROR;
+
+		s->block_header.compressed = s->vli;
+	} else {
+		s->block_header.compressed = VLI_UNKNOWN;
+	}
+
+	/* Uncompressed Size */
+	if (s->temp.buf[1] & 0x80) {
+		if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)
+				!= XZ_STREAM_END)
+			return XZ_DATA_ERROR;
+
+		s->block_header.uncompressed = s->vli;
+	} else {
+		s->block_header.uncompressed = VLI_UNKNOWN;
+	}
+
+#ifdef XZ_DEC_BCJ
+	/* If there are two filters, the first one must be a BCJ filter. */
+	s->bcj_active = s->temp.buf[1] & 0x01;
+	if (s->bcj_active) {
+		if (s->temp.size - s->temp.pos < 2)
+			return XZ_OPTIONS_ERROR;
+
+		ret = xz_dec_bcj_reset(s->bcj, s->temp.buf[s->temp.pos++]);
+		if (ret != XZ_OK)
+			return ret;
+
+		/*
+		 * We don't support custom start offset,
+		 * so Size of Properties must be zero.
+		 */
+		if (s->temp.buf[s->temp.pos++] != 0x00)
+			return XZ_OPTIONS_ERROR;
+	}
+#endif
+
+	/* Valid Filter Flags always take at least two bytes. */
+	if (s->temp.size - s->temp.pos < 2)
+		return XZ_DATA_ERROR;
+
+	/* Filter ID = LZMA2 */
+	if (s->temp.buf[s->temp.pos++] != 0x21)
+		return XZ_OPTIONS_ERROR;
+
+	/* Size of Properties = 1-byte Filter Properties */
+	if (s->temp.buf[s->temp.pos++] != 0x01)
+		return XZ_OPTIONS_ERROR;
+
+	/* Filter Properties contains LZMA2 dictionary size. */
+	if (s->temp.size - s->temp.pos < 1)
+		return XZ_DATA_ERROR;
+
+	ret = xz_dec_lzma2_reset(s->lzma2, s->temp.buf[s->temp.pos++]);
+	if (ret != XZ_OK)
+		return ret;
+
+	/* The rest must be Header Padding. */
+	while (s->temp.pos < s->temp.size)
+		if (s->temp.buf[s->temp.pos++] != 0x00)
+			return XZ_OPTIONS_ERROR;
+
+	s->temp.pos = 0;
+	s->block.compressed = 0;
+	s->block.uncompressed = 0;
+
+	return XZ_OK;
+}
+
+static enum xz_ret INIT dec_main(struct xz_dec *s, struct xz_buf *b)
+{
+	enum xz_ret ret;
+
+	/*
+	 * Store the start position for the case when we are in the middle
+	 * of the Index field.
+	 */
+	s->in_start = b->in_pos;
+
+	while (true) {
+		switch (s->sequence) {
+		case SEQ_STREAM_HEADER:
+			/*
+			 * Stream Header is copied to s->temp, and then
+			 * decoded from there. This way if the caller
+			 * gives us only little input at a time, we can
+			 * still keep the Stream Header decoding code
+			 * simple. Similar approach is used in many places
+			 * in this file.
+			 */
+			if (!fill_temp(s, b))
+				return XZ_OK;
+
+			/*
+			 * If dec_stream_header() returns
+			 * XZ_UNSUPPORTED_CHECK, it is still possible
+			 * to continue decoding if working in multi-call
+			 * mode. Thus, update s->sequence before calling
+			 * dec_stream_header().
+			 */
+			s->sequence = SEQ_BLOCK_START;
+
+			ret = dec_stream_header(s);
+			if (ret != XZ_OK)
+				return ret;
+
+		case SEQ_BLOCK_START:
+			/* We need one byte of input to continue. */
+			if (b->in_pos == b->in_size)
+				return XZ_OK;
+
+			/* See if this is the beginning of the Index field. */
+			if (b->in[b->in_pos] == 0) {
+				s->in_start = b->in_pos++;
+				s->sequence = SEQ_INDEX;
+				break;
+			}
+
+			/*
+			 * Calculate the size of the Block Header and
+			 * prepare to decode it.
+			 */
+			s->block_header.size
+				= ((uint32_t)b->in[b->in_pos] + 1) * 4;
+
+			s->temp.size = s->block_header.size;
+			s->temp.pos = 0;
+			s->sequence = SEQ_BLOCK_HEADER;
+
+		case SEQ_BLOCK_HEADER:
+			if (!fill_temp(s, b))
+				return XZ_OK;
+
+			ret = dec_block_header(s);
+			if (ret != XZ_OK)
+				return ret;
+
+			s->sequence = SEQ_BLOCK_UNCOMPRESS;
+
+		case SEQ_BLOCK_UNCOMPRESS:
+			ret = dec_block(s, b);
+			if (ret != XZ_STREAM_END)
+				return ret;
+
+			s->sequence = SEQ_BLOCK_PADDING;
+
+		case SEQ_BLOCK_PADDING:
+			/*
+			 * Size of Compressed Data + Block Padding
+			 * must be a multiple of four. We don't need
+			 * s->block.compressed for anything else
+			 * anymore, so we use it here to test the size
+			 * of the Block Padding field.
+			 */
+			while (s->block.compressed & 3) {
+				if (b->in_pos == b->in_size)
+					return XZ_OK;
+
+				if (b->in[b->in_pos++] != 0)
+					return XZ_DATA_ERROR;
+
+				++s->block.compressed;
+			}
+
+			s->sequence = SEQ_BLOCK_CHECK;
+
+		case SEQ_BLOCK_CHECK:
+			if (s->check_type == XZ_CHECK_CRC32) {
+				ret = crc32_validate(s, b);
+				if (ret != XZ_STREAM_END)
+					return ret;
+			}
+#ifdef XZ_DEC_ANY_CHECK
+			else if (!check_skip(s, b)) {
+				return XZ_OK;
+			}
+#endif
+
+			s->sequence = SEQ_BLOCK_START;
+			break;
+
+		case SEQ_INDEX:
+			ret = dec_index(s, b);
+			if (ret != XZ_STREAM_END)
+				return ret;
+
+			s->sequence = SEQ_INDEX_PADDING;
+
+		case SEQ_INDEX_PADDING:
+			while ((s->index.size + (b->in_pos - s->in_start))
+					& 3) {
+				if (b->in_pos == b->in_size) {
+					index_update(s, b);
+					return XZ_OK;
+				}
+
+				if (b->in[b->in_pos++] != 0)
+					return XZ_DATA_ERROR;
+			}
+
+			/* Finish the CRC32 value and Index size. */
+			index_update(s, b);
+
+			/* Compare the hashes to validate the Index field. */
+			if (!memeq(&s->block.hash, &s->index.hash,
+					sizeof(s->block.hash)))
+				return XZ_DATA_ERROR;
+
+			s->sequence = SEQ_INDEX_CRC32;
+
+		case SEQ_INDEX_CRC32:
+			ret = crc32_validate(s, b);
+			if (ret != XZ_STREAM_END)
+				return ret;
+
+			s->temp.size = STREAM_HEADER_SIZE;
+			s->sequence = SEQ_STREAM_FOOTER;
+
+		case SEQ_STREAM_FOOTER:
+			if (!fill_temp(s, b))
+				return XZ_OK;
+
+			return dec_stream_footer(s);
+		}
+	}
+
+	/* Never reached */
+}
+
+XZ_EXTERN void INIT xz_dec_reset(struct xz_dec *s)
+{
+	s->sequence = SEQ_STREAM_HEADER;
+	s->allow_buf_error = false;
+	s->pos = 0;
+	s->crc32 = 0;
+	memzero(&s->block, sizeof(s->block));
+	memzero(&s->index, sizeof(s->index));
+	s->temp.pos = 0;
+	s->temp.size = STREAM_HEADER_SIZE;
+}
+
+/*
+ * xz_dec_run() is a wrapper for dec_main() to handle some special cases in
+ * multi-call and single-call decoding.
+ *
+ * In multi-call mode, we must return XZ_BUF_ERROR when it seems clear that we
+ * are not going to make any progress anymore. This is to prevent the caller
+ * from calling us infinitely when the input file is truncated or otherwise
+ * corrupt. Since zlib-style API allows that the caller fills the input buffer
+ * only when the decoder doesn't produce any new output, we have to be careful
+ * to avoid returning XZ_BUF_ERROR too easily: XZ_BUF_ERROR is returned only
+ * after the second consecutive call to xz_dec_run() that makes no progress.
+ *
+ * In single-call mode, if we couldn't decode everything and no error
+ * occurred, either the input is truncated or the output buffer is too small.
+ * Since we know that the last input byte never produces any output, we know
+ * that if all the input was consumed and decoding wasn't finished, the file
+ * must be corrupt. Otherwise the output buffer has to be too small or the
+ * file is corrupt in a way that decoding it produces too big output.
+ *
+ * If single-call decoding fails, we reset b->in_pos and b->out_pos back to
+ * their original values. This is because with some filter chains there won't
+ * be any valid uncompressed data in the output buffer unless the decoding
+ * actually succeeds (that's the price to pay of using the output buffer as
+ * the workspace).
+ */
+XZ_EXTERN enum xz_ret INIT xz_dec_run(struct xz_dec *s, struct xz_buf *b)
+{
+	size_t in_start;
+	size_t out_start;
+	enum xz_ret ret;
+
+	if (DEC_IS_SINGLE(s->mode))
+		xz_dec_reset(s);
+
+	in_start = b->in_pos;
+	out_start = b->out_pos;
+	ret = dec_main(s, b);
+
+	if (DEC_IS_SINGLE(s->mode)) {
+		if (ret == XZ_OK)
+			ret = b->in_pos == b->in_size
+					? XZ_DATA_ERROR : XZ_BUF_ERROR;
+
+		if (ret != XZ_STREAM_END) {
+			b->in_pos = in_start;
+			b->out_pos = out_start;
+		}
+
+	} else if (ret == XZ_OK && in_start == b->in_pos
+			&& out_start == b->out_pos) {
+		if (s->allow_buf_error)
+			ret = XZ_BUF_ERROR;
+
+		s->allow_buf_error = true;
+	} else {
+		s->allow_buf_error = false;
+	}
+
+	return ret;
+}
+
+XZ_EXTERN struct xz_dec *INIT xz_dec_init(enum xz_mode mode, uint32_t dict_max)
+{
+	struct xz_dec *s = malloc(sizeof(*s));
+	if (s == NULL)
+		return NULL;
+
+	s->mode = mode;
+
+#ifdef XZ_DEC_BCJ
+	s->bcj = xz_dec_bcj_create(DEC_IS_SINGLE(mode));
+	if (s->bcj == NULL)
+		goto error_bcj;
+#endif
+
+	s->lzma2 = xz_dec_lzma2_create(mode, dict_max);
+	if (s->lzma2 == NULL)
+		goto error_lzma2;
+
+	xz_dec_reset(s);
+	return s;
+
+error_lzma2:
+#ifdef XZ_DEC_BCJ
+	xz_dec_bcj_end(s->bcj);
+error_bcj:
+#endif
+	free(s);
+	return NULL;
+}
+
+XZ_EXTERN void INIT xz_dec_end(struct xz_dec *s)
+{
+	if (s != NULL) {
+		xz_dec_lzma2_end(s->lzma2);
+#ifdef XZ_DEC_BCJ
+		xz_dec_bcj_end(s->bcj);
+#endif
+		free(s);
+	}
+}
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/lzma2.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/lzma2.h	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,204 @@
+/*
+ * LZMA2 definitions
+ *
+ * Authors: Lasse Collin <lasse.collin@tukaani.org>
+ *          Igor Pavlov <http://7-zip.org/>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#ifndef XZ_LZMA2_H
+#define XZ_LZMA2_H
+
+/* Range coder constants */
+#define RC_SHIFT_BITS 8
+#define RC_TOP_BITS 24
+#define RC_TOP_VALUE (1 << RC_TOP_BITS)
+#define RC_BIT_MODEL_TOTAL_BITS 11
+#define RC_BIT_MODEL_TOTAL (1 << RC_BIT_MODEL_TOTAL_BITS)
+#define RC_MOVE_BITS 5
+
+/*
+ * Maximum number of position states. A position state is the lowest pb
+ * number of bits of the current uncompressed offset. In some places there
+ * are different sets of probabilities for different position states.
+ */
+#define POS_STATES_MAX (1 << 4)
+
+/*
+ * This enum is used to track which LZMA symbols have occurred most recently
+ * and in which order. This information is used to predict the next symbol.
+ *
+ * Symbols:
+ *  - Literal: One 8-bit byte
+ *  - Match: Repeat a chunk of data at some distance
+ *  - Long repeat: Multi-byte match at a recently seen distance
+ *  - Short repeat: One-byte repeat at a recently seen distance
+ *
+ * The symbol names are in from STATE_oldest_older_previous. REP means
+ * either short or long repeated match, and NONLIT means any non-literal.
+ */
+enum lzma_state {
+	STATE_LIT_LIT,
+	STATE_MATCH_LIT_LIT,
+	STATE_REP_LIT_LIT,
+	STATE_SHORTREP_LIT_LIT,
+	STATE_MATCH_LIT,
+	STATE_REP_LIT,
+	STATE_SHORTREP_LIT,
+	STATE_LIT_MATCH,
+	STATE_LIT_LONGREP,
+	STATE_LIT_SHORTREP,
+	STATE_NONLIT_MATCH,
+	STATE_NONLIT_REP
+};
+
+/* Total number of states */
+#define STATES 12
+
+/* The lowest 7 states indicate that the previous state was a literal. */
+#define LIT_STATES 7
+
+/* Indicate that the latest symbol was a literal. */
+static inline void INIT lzma_state_literal(enum lzma_state *state)
+{
+	if (*state <= STATE_SHORTREP_LIT_LIT)
+		*state = STATE_LIT_LIT;
+	else if (*state <= STATE_LIT_SHORTREP)
+		*state -= 3;
+	else
+		*state -= 6;
+}
+
+/* Indicate that the latest symbol was a match. */
+static inline void INIT lzma_state_match(enum lzma_state *state)
+{
+	*state = *state < LIT_STATES ? STATE_LIT_MATCH : STATE_NONLIT_MATCH;
+}
+
+/* Indicate that the latest state was a long repeated match. */
+static inline void INIT lzma_state_long_rep(enum lzma_state *state)
+{
+	*state = *state < LIT_STATES ? STATE_LIT_LONGREP : STATE_NONLIT_REP;
+}
+
+/* Indicate that the latest symbol was a short match. */
+static inline void INIT lzma_state_short_rep(enum lzma_state *state)
+{
+	*state = *state < LIT_STATES ? STATE_LIT_SHORTREP : STATE_NONLIT_REP;
+}
+
+/* Test if the previous symbol was a literal. */
+static inline bool_t INIT lzma_state_is_literal(enum lzma_state state)
+{
+	return state < LIT_STATES;
+}
+
+/* Each literal coder is divided in three sections:
+ *   - 0x001-0x0FF: Without match byte
+ *   - 0x101-0x1FF: With match byte; match bit is 0
+ *   - 0x201-0x2FF: With match byte; match bit is 1
+ *
+ * Match byte is used when the previous LZMA symbol was something else than
+ * a literal (that is, it was some kind of match).
+ */
+#define LITERAL_CODER_SIZE 0x300
+
+/* Maximum number of literal coders */
+#define LITERAL_CODERS_MAX (1 << 4)
+
+/* Minimum length of a match is two bytes. */
+#define MATCH_LEN_MIN 2
+
+/* Match length is encoded with 4, 5, or 10 bits.
+ *
+ * Length   Bits
+ *  2-9      4 = Choice=0 + 3 bits
+ * 10-17     5 = Choice=1 + Choice2=0 + 3 bits
+ * 18-273   10 = Choice=1 + Choice2=1 + 8 bits
+ */
+#define LEN_LOW_BITS 3
+#define LEN_LOW_SYMBOLS (1 << LEN_LOW_BITS)
+#define LEN_MID_BITS 3
+#define LEN_MID_SYMBOLS (1 << LEN_MID_BITS)
+#define LEN_HIGH_BITS 8
+#define LEN_HIGH_SYMBOLS (1 << LEN_HIGH_BITS)
+#define LEN_SYMBOLS (LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS + LEN_HIGH_SYMBOLS)
+
+/*
+ * Maximum length of a match is 273 which is a result of the encoding
+ * described above.
+ */
+#define MATCH_LEN_MAX (MATCH_LEN_MIN + LEN_SYMBOLS - 1)
+
+/*
+ * Different sets of probabilities are used for match distances that have
+ * very short match length: Lengths of 2, 3, and 4 bytes have a separate
+ * set of probabilities for each length. The matches with longer length
+ * use a shared set of probabilities.
+ */
+#define DIST_STATES 4
+
+/*
+ * Get the index of the appropriate probability array for decoding
+ * the distance slot.
+ */
+static inline uint32_t INIT lzma_get_dist_state(uint32_t len)
+{
+	return len < DIST_STATES + MATCH_LEN_MIN
+			? len - MATCH_LEN_MIN : DIST_STATES - 1;
+}
+
+/*
+ * The highest two bits of a 32-bit match distance are encoded using six bits.
+ * This six-bit value is called a distance slot. This way encoding a 32-bit
+ * value takes 6-36 bits, larger values taking more bits.
+ */
+#define DIST_SLOT_BITS 6
+#define DIST_SLOTS (1 << DIST_SLOT_BITS)
+
+/* Match distances up to 127 are fully encoded using probabilities. Since
+ * the highest two bits (distance slot) are always encoded using six bits,
+ * the distances 0-3 don't need any additional bits to encode, since the
+ * distance slot itself is the same as the actual distance. DIST_MODEL_START
+ * indicates the first distance slot where at least one additional bit is
+ * needed.
+ */
+#define DIST_MODEL_START 4
+
+/*
+ * Match distances greater than 127 are encoded in three pieces:
+ *   - distance slot: the highest two bits
+ *   - direct bits: 2-26 bits below the highest two bits
+ *   - alignment bits: four lowest bits
+ *
+ * Direct bits don't use any probabilities.
+ *
+ * The distance slot value of 14 is for distances 128-191.
+ */
+#define DIST_MODEL_END 14
+
+/* Distance slots that indicate a distance <= 127. */
+#define FULL_DISTANCES_BITS (DIST_MODEL_END / 2)
+#define FULL_DISTANCES (1 << FULL_DISTANCES_BITS)
+
+/*
+ * For match distances greater than 127, only the highest two bits and the
+ * lowest four bits (alignment) is encoded using probabilities.
+ */
+#define ALIGN_BITS 4
+#define ALIGN_SIZE (1 << ALIGN_BITS)
+#define ALIGN_MASK (ALIGN_SIZE - 1)
+
+/* Total number of all probability variables */
+#define PROBS_TOTAL (1846 + LITERAL_CODERS_MAX * LITERAL_CODER_SIZE)
+
+/*
+ * LZMA remembers the four most recent match distances. Reusing these
+ * distances tends to take less space than re-encoding the actual
+ * distance value.
+ */
+#define REPS 4
+
+#endif
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/private.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/private.h	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,271 @@
+/*
+ * Private includes and definitions
+ *
+ * Author: Lasse Collin <lasse.collin@tukaani.org>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#ifndef XZ_PRIVATE_H
+#define XZ_PRIVATE_H
+
+#include <xen/kernel.h>
+#include <asm/byteorder.h>
+#define get_le32(p) le32_to_cpup((const uint32_t *)(p))
+
+#if 1 /* ndef CONFIG_??? */
+static inline u32 INIT get_unaligned_le32(void *p)
+{
+	return le32_to_cpup(p);
+}
+
+static inline void INIT put_unaligned_le32(u32 val, void *p)
+{
+	*(__force __le32*)p = cpu_to_le32(val);
+}
+#else
+#include <asm/unaligned.h>
+
+static inline u32 INIT get_unaligned_le32(void *p)
+{
+	return le32_to_cpu(__get_unaligned(p, 4));
+}
+
+static inline void INIT put_unaligned_le32(u32 val, void *p)
+{
+	__put_unaligned(cpu_to_le32(val), p, 4);
+}
+#endif
+
+#define false 0
+#define true 1
+
+/**
+ * enum xz_mode - Operation mode
+ *
+ * @XZ_SINGLE:              Single-call mode. This uses less RAM than
+ *                          than multi-call modes, because the LZMA2
+ *                          dictionary doesn't need to be allocated as
+ *                          part of the decoder state. All required data
+ *                          structures are allocated at initialization,
+ *                          so xz_dec_run() cannot return XZ_MEM_ERROR.
+ * @XZ_PREALLOC:            Multi-call mode with preallocated LZMA2
+ *                          dictionary buffer. All data structures are
+ *                          allocated at initialization, so xz_dec_run()
+ *                          cannot return XZ_MEM_ERROR.
+ * @XZ_DYNALLOC:            Multi-call mode. The LZMA2 dictionary is
+ *                          allocated once the required size has been
+ *                          parsed from the stream headers. If the
+ *                          allocation fails, xz_dec_run() will return
+ *                          XZ_MEM_ERROR.
+ *
+ * It is possible to enable support only for a subset of the above
+ * modes at compile time by defining XZ_DEC_SINGLE, XZ_DEC_PREALLOC,
+ * or XZ_DEC_DYNALLOC. The xz_dec kernel module is always compiled
+ * with support for all operation modes, but the preboot code may
+ * be built with fewer features to minimize code size.
+ */
+enum xz_mode {
+	XZ_SINGLE,
+	XZ_PREALLOC,
+	XZ_DYNALLOC
+};
+
+/**
+ * enum xz_ret - Return codes
+ * @XZ_OK:                  Everything is OK so far. More input or more
+ *                          output space is required to continue. This
+ *                          return code is possible only in multi-call mode
+ *                          (XZ_PREALLOC or XZ_DYNALLOC).
+ * @XZ_STREAM_END:          Operation finished successfully.
+ * @XZ_UNSUPPORTED_CHECK:   Integrity check type is not supported. Decoding
+ *                          is still possible in multi-call mode by simply
+ *                          calling xz_dec_run() again.
+ *                          Note that this return value is used only if
+ *                          XZ_DEC_ANY_CHECK was defined at build time,
+ *                          which is not used in the kernel. Unsupported
+ *                          check types return XZ_OPTIONS_ERROR if
+ *                          XZ_DEC_ANY_CHECK was not defined at build time.
+ * @XZ_MEM_ERROR:           Allocating memory failed. This return code is
+ *                          possible only if the decoder was initialized
+ *                          with XZ_DYNALLOC. The amount of memory that was
+ *                          tried to be allocated was no more than the
+ *                          dict_max argument given to xz_dec_init().
+ * @XZ_MEMLIMIT_ERROR:      A bigger LZMA2 dictionary would be needed than
+ *                          allowed by the dict_max argument given to
+ *                          xz_dec_init(). This return value is possible
+ *                          only in multi-call mode (XZ_PREALLOC or
+ *                          XZ_DYNALLOC); the single-call mode (XZ_SINGLE)
+ *                          ignores the dict_max argument.
+ * @XZ_FORMAT_ERROR:        File format was not recognized (wrong magic
+ *                          bytes).
+ * @XZ_OPTIONS_ERROR:       This implementation doesn't support the requested
+ *                          compression options. In the decoder this means
+ *                          that the header CRC32 matches, but the header
+ *                          itself specifies something that we don't support.
+ * @XZ_DATA_ERROR:          Compressed data is corrupt.
+ * @XZ_BUF_ERROR:           Cannot make any progress. Details are slightly
+ *                          different between multi-call and single-call
+ *                          mode; more information below.
+ *
+ * In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls
+ * to XZ code cannot consume any input and cannot produce any new output.
+ * This happens when there is no new input available, or the output buffer
+ * is full while at least one output byte is still pending. Assuming your
+ * code is not buggy, you can get this error only when decoding a compressed
+ * stream that is truncated or otherwise corrupt.
+ *
+ * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer
+ * is too small or the compressed input is corrupt in a way that makes the
+ * decoder produce more output than the caller expected. When it is
+ * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR
+ * is used instead of XZ_BUF_ERROR.
+ */
+enum xz_ret {
+	XZ_OK,
+	XZ_STREAM_END,
+	XZ_UNSUPPORTED_CHECK,
+	XZ_MEM_ERROR,
+	XZ_MEMLIMIT_ERROR,
+	XZ_FORMAT_ERROR,
+	XZ_OPTIONS_ERROR,
+	XZ_DATA_ERROR,
+	XZ_BUF_ERROR
+};
+
+/**
+ * struct xz_buf - Passing input and output buffers to XZ code
+ * @in:         Beginning of the input buffer. This may be NULL if and only
+ *              if in_pos is equal to in_size.
+ * @in_pos:     Current position in the input buffer. This must not exceed
+ *              in_size.
+ * @in_size:    Size of the input buffer
+ * @out:        Beginning of the output buffer. This may be NULL if and only
+ *              if out_pos is equal to out_size.
+ * @out_pos:    Current position in the output buffer. This must not exceed
+ *              out_size.
+ * @out_size:   Size of the output buffer
+ *
+ * Only the contents of the output buffer from out[out_pos] onward, and
+ * the variables in_pos and out_pos are modified by the XZ code.
+ */
+struct xz_buf {
+	const uint8_t *in;
+	size_t in_pos;
+	size_t in_size;
+
+	uint8_t *out;
+	size_t out_pos;
+	size_t out_size;
+};
+
+/**
+ * struct xz_dec - Opaque type to hold the XZ decoder state
+ */
+struct xz_dec;
+
+/* If no specific decoding mode is requested, enable support for all modes. */
+#if !defined(XZ_DEC_SINGLE) && !defined(XZ_DEC_PREALLOC) \
+		&& !defined(XZ_DEC_DYNALLOC)
+#	define XZ_DEC_SINGLE
+#	define XZ_DEC_PREALLOC
+#	define XZ_DEC_DYNALLOC
+#endif
+
+/*
+ * The DEC_IS_foo(mode) macros are used in "if" statements. If only some
+ * of the supported modes are enabled, these macros will evaluate to true or
+ * false at compile time and thus allow the compiler to omit unneeded code.
+ */
+#ifdef XZ_DEC_SINGLE
+#	define DEC_IS_SINGLE(mode) ((mode) == XZ_SINGLE)
+#else
+#	define DEC_IS_SINGLE(mode) (false)
+#endif
+
+#ifdef XZ_DEC_PREALLOC
+#	define DEC_IS_PREALLOC(mode) ((mode) == XZ_PREALLOC)
+#else
+#	define DEC_IS_PREALLOC(mode) (false)
+#endif
+
+#ifdef XZ_DEC_DYNALLOC
+#	define DEC_IS_DYNALLOC(mode) ((mode) == XZ_DYNALLOC)
+#else
+#	define DEC_IS_DYNALLOC(mode) (false)
+#endif
+
+#if !defined(XZ_DEC_SINGLE)
+#	define DEC_IS_MULTI(mode) (true)
+#elif defined(XZ_DEC_PREALLOC) || defined(XZ_DEC_DYNALLOC)
+#	define DEC_IS_MULTI(mode) ((mode) != XZ_SINGLE)
+#else
+#	define DEC_IS_MULTI(mode) (false)
+#endif
+
+/*
+ * If any of the BCJ filter decoders are wanted, define XZ_DEC_BCJ.
+ * XZ_DEC_BCJ is used to enable generic support for BCJ decoders.
+ */
+#ifndef XZ_DEC_BCJ
+#	if defined(XZ_DEC_X86) || defined(XZ_DEC_POWERPC) \
+			|| defined(XZ_DEC_IA64) || defined(XZ_DEC_ARM) \
+			|| defined(XZ_DEC_ARM) || defined(XZ_DEC_ARMTHUMB) \
+			|| defined(XZ_DEC_SPARC)
+#		define XZ_DEC_BCJ
+#	endif
+#endif
+
+/*
+ * Allocate memory for LZMA2 decoder. xz_dec_lzma2_reset() must be used
+ * before calling xz_dec_lzma2_run().
+ */
+XZ_EXTERN struct xz_dec_lzma2 *xz_dec_lzma2_create(enum xz_mode mode,
+						   uint32_t dict_max);
+
+/*
+ * Decode the LZMA2 properties (one byte) and reset the decoder. Return
+ * XZ_OK on success, XZ_MEMLIMIT_ERROR if the preallocated dictionary is not
+ * big enough, and XZ_OPTIONS_ERROR if props indicates something that this
+ * decoder doesn't support.
+ */
+XZ_EXTERN enum xz_ret xz_dec_lzma2_reset(struct xz_dec_lzma2 *s,
+					 uint8_t props);
+
+/* Decode raw LZMA2 stream from b->in to b->out. */
+XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
+				       struct xz_buf *b);
+
+/* Free the memory allocated for the LZMA2 decoder. */
+XZ_EXTERN void xz_dec_lzma2_end(struct xz_dec_lzma2 *s);
+
+#ifdef XZ_DEC_BCJ
+/*
+ * Allocate memory for BCJ decoders. xz_dec_bcj_reset() must be used before
+ * calling xz_dec_bcj_run().
+ */
+XZ_EXTERN struct xz_dec_bcj *xz_dec_bcj_create(bool_t single_call);
+
+/*
+ * Decode the Filter ID of a BCJ filter. This implementation doesn't
+ * support custom start offsets, so no decoding of Filter Properties
+ * is needed. Returns XZ_OK if the given Filter ID is supported.
+ * Otherwise XZ_OPTIONS_ERROR is returned.
+ */
+XZ_EXTERN enum xz_ret xz_dec_bcj_reset(struct xz_dec_bcj *s, uint8_t id);
+
+/*
+ * Decode raw BCJ + LZMA2 stream. This must be used only if there actually is
+ * a BCJ filter in the chain. If the chain has only LZMA2, xz_dec_lzma2_run()
+ * must be called directly.
+ */
+XZ_EXTERN enum xz_ret xz_dec_bcj_run(struct xz_dec_bcj *s,
+				     struct xz_dec_lzma2 *lzma2,
+				     struct xz_buf *b);
+
+/* Free the memory allocated for the BCJ filters. */
+#define xz_dec_bcj_end(s) free(s)
+#endif
+
+#endif
diff -r 7892ab82191b -r d72d30447ae8 xen/common/xz/stream.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/xz/stream.h	Wed Dec 19 12:25:27 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Definitions for handling the .xz file format
+ *
+ * Author: Lasse Collin <lasse.collin@tukaani.org>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+#ifndef XZ_STREAM_H
+#define XZ_STREAM_H
+
+/*
+ * See the .xz file format specification at
+ * http://tukaani.org/xz/xz-file-format.txt
+ * to understand the container format.
+ */
+
+#define STREAM_HEADER_SIZE 12
+
+#define HEADER_MAGIC "\3757zXZ"
+#define HEADER_MAGIC_SIZE 6
+
+#define FOOTER_MAGIC "YZ"
+#define FOOTER_MAGIC_SIZE 2
+
+/*
+ * Variable-length integer can hold a 63-bit unsigned integer or a special
+ * value indicating that the value is unknown.
+ *
+ * Experimental: vli_type can be defined to uint32_t to save a few bytes
+ * in code size (no effect on speed). Doing so limits the uncompressed and
+ * compressed size of the file to less than 256 MiB and may also weaken
+ * error detection slightly.
+ */
+typedef uint64_t vli_type;
+
+#define VLI_MAX ((vli_type)-1 / 2)
+#define VLI_UNKNOWN ((vli_type)-1)
+
+/* Maximum encoded size of a VLI */
+#define VLI_BYTES_MAX (sizeof(vli_type) * 8 / 7)
+
+/* Integrity Check types */
+enum xz_check {
+	XZ_CHECK_NONE = 0,
+	XZ_CHECK_CRC32 = 1,
+	XZ_CHECK_CRC64 = 4,
+	XZ_CHECK_SHA256 = 10
+};
+
+/* Maximum possible Check ID */
+#define XZ_CHECK_MAX 15
+
+#endif
diff -r 7892ab82191b -r d72d30447ae8 xen/include/xen/decompress.h
--- a/xen/include/xen/decompress.h	Wed Dec 19 12:22:57 2012 +0100
+++ b/xen/include/xen/decompress.h	Wed Dec 19 12:25:27 2012 +0100
@@ -31,7 +31,7 @@ typedef int decompress_fn(unsigned char 
  * dependent).
  */
 
-decompress_fn bunzip2, unlzma, unlzo;
+decompress_fn bunzip2, unxz, unlzma, unlzo;
 
 int decompress(void *inbuf, unsigned int len, void *outbuf);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiJ-00070r-Sf; Thu, 20 Dec 2012 16:11:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiI-00070g-EU
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:14 +0000
Received: from [193.109.254.147:49865] by server-5.bemta-14.messagelabs.com id
	90/2D-32031-1A833D05; Thu, 20 Dec 2012 16:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1356019871!8551332!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13727 invoked from network); 20 Dec 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiF-0005fG-Jm
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiF-00068q-IB
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:11 +0000
Message-Id: <E1TliiF-00068q-IB@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: make smp_send_state_dump a
	real function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926579 0
# Node ID 41bf7e2d5e8b9606f279ef9d1530f62d12d38ce3
# Parent  73895827e5e00536a28bb31a74306cff571f9b17
xen: arm: make smp_send_state_dump a real function

It still doesn't do anything useful, but at least it isn't in dummy.S!

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 73895827e5e0 -r 41bf7e2d5e8b xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:19 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:19 2012 +0000
@@ -6,9 +6,6 @@ x:	.word 0xe7f000f0 /* Undefined instruc
 	.globl x; \
 x:	mov pc, lr
 	
-/* SMP support */
-DUMMY(smp_send_state_dump);
-
 /* PIRQ support */
 DUMMY(alloc_pirq_struct);
 DUMMY(nr_irqs_gsi);
diff -r 73895827e5e0 -r 41bf7e2d5e8b xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Wed Dec 19 14:16:19 2012 +0000
+++ b/xen/arch/arm/gic.c	Wed Dec 19 14:16:19 2012 +0000
@@ -348,6 +348,12 @@ void __init gic_init(void)
     spin_unlock(&gic.lock);
 }
 
+void smp_send_state_dump(unsigned int cpu)
+{
+    printk("WARNING: unable to send state dump request to CPU%d\n", cpu);
+    /* XXX TODO -- send an SGI */
+}
+
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
 void __cpuinit gic_init_secondary_cpu(void)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiJ-00070r-Sf; Thu, 20 Dec 2012 16:11:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiI-00070g-EU
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:14 +0000
Received: from [193.109.254.147:49865] by server-5.bemta-14.messagelabs.com id
	90/2D-32031-1A833D05; Thu, 20 Dec 2012 16:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1356019871!8551332!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13727 invoked from network); 20 Dec 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiF-0005fG-Jm
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiF-00068q-IB
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:11 +0000
Message-Id: <E1TliiF-00068q-IB@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: make smp_send_state_dump a
	real function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926579 0
# Node ID 41bf7e2d5e8b9606f279ef9d1530f62d12d38ce3
# Parent  73895827e5e00536a28bb31a74306cff571f9b17
xen: arm: make smp_send_state_dump a real function

It still doesn't do anything useful, but at least it isn't in dummy.S!

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 73895827e5e0 -r 41bf7e2d5e8b xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:19 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:19 2012 +0000
@@ -6,9 +6,6 @@ x:	.word 0xe7f000f0 /* Undefined instruc
 	.globl x; \
 x:	mov pc, lr
 	
-/* SMP support */
-DUMMY(smp_send_state_dump);
-
 /* PIRQ support */
 DUMMY(alloc_pirq_struct);
 DUMMY(nr_irqs_gsi);
diff -r 73895827e5e0 -r 41bf7e2d5e8b xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Wed Dec 19 14:16:19 2012 +0000
+++ b/xen/arch/arm/gic.c	Wed Dec 19 14:16:19 2012 +0000
@@ -348,6 +348,12 @@ void __init gic_init(void)
     spin_unlock(&gic.lock);
 }
 
+void smp_send_state_dump(unsigned int cpu)
+{
+    printk("WARNING: unable to send state dump request to CPU%d\n", cpu);
+    /* XXX TODO -- send an SGI */
+}
+
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
 void __cpuinit gic_init_secondary_cpu(void)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiK-000713-VB; Thu, 20 Dec 2012 16:11:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiJ-00070h-NY
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:15 +0000
Received: from [85.158.143.35:6085] by server-1.bemta-4.messagelabs.com id
	10/5D-28401-1A833D05; Thu, 20 Dec 2012 16:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1356019871!14500950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23237 invoked from network); 20 Dec 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiE-0005fA-OM
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiE-00068M-GK
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:10 +0000
Message-Id: <E1TliiE-00068M-GK@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: Call init_xen_time earlier
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926578 0
# Node ID 102e2894e12a45898db69887f923a1338dfb7c9c
# Parent  d0a4968e857893d9b159061f4bc7755675728709
xen: arm: Call init_xen_time earlier

If we panic before calling init_xen_time then the "Rebooting in 5
seconds" delay ends up calling udelay which uses cntfrq before it has
been initialised resulting in a divide by zero.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d0a4968e8578 -r 102e2894e12a xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Wed Dec 19 14:16:17 2012 +0000
+++ b/xen/arch/arm/setup.c	Wed Dec 19 14:16:18 2012 +0000
@@ -219,6 +219,8 @@ void __init start_xen(unsigned long boot
     console_init_preirq();
 #endif
 
+    init_xen_time();
+
     gic_init();
     make_cpus_ready(cpus, boot_phys_offset);
 
@@ -227,8 +229,6 @@ void __init start_xen(unsigned long boot
     set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
 
-    init_xen_time();
-
     setup_mm(atag_paddr, fdt_size);
 
     /* Setup Hyp vector base */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiK-000713-VB; Thu, 20 Dec 2012 16:11:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiJ-00070h-NY
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:15 +0000
Received: from [85.158.143.35:6085] by server-1.bemta-4.messagelabs.com id
	10/5D-28401-1A833D05; Thu, 20 Dec 2012 16:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1356019871!14500950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23237 invoked from network); 20 Dec 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiE-0005fA-OM
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiE-00068M-GK
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:10 +0000
Message-Id: <E1TliiE-00068M-GK@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: Call init_xen_time earlier
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926578 0
# Node ID 102e2894e12a45898db69887f923a1338dfb7c9c
# Parent  d0a4968e857893d9b159061f4bc7755675728709
xen: arm: Call init_xen_time earlier

If we panic before calling init_xen_time then the "Rebooting in 5
seconds" delay ends up calling udelay which uses cntfrq before it has
been initialised resulting in a divide by zero.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d0a4968e8578 -r 102e2894e12a xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Wed Dec 19 14:16:17 2012 +0000
+++ b/xen/arch/arm/setup.c	Wed Dec 19 14:16:18 2012 +0000
@@ -219,6 +219,8 @@ void __init start_xen(unsigned long boot
     console_init_preirq();
 #endif
 
+    init_xen_time();
+
     gic_init();
     make_cpus_ready(cpus, boot_phys_offset);
 
@@ -227,8 +229,6 @@ void __init start_xen(unsigned long boot
     set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
 
-    init_xen_time();
-
     setup_mm(atag_paddr, fdt_size);
 
     /* Setup Hyp vector base */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-00071x-8z; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-00071D-OG
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Received: from [85.158.137.99:46887] by server-10.bemta-3.messagelabs.com id
	46/47-07616-4A833D05; Thu, 20 Dec 2012 16:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1356019873!14053704!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15631 invoked from network); 20 Dec 2012 16:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiH-0005fS-M2
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiH-00069o-KN
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:13 +0000
Message-Id: <E1TliiH-00069o-KN@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub out wallclock time.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926582 0
# Node ID f6984864e580c4c7daf5db5951b19767bc979fc5
# Parent  43193e52d15a66c0b6c246099302081b887134d6
xen: arm: stub out wallclock time.

We don't currently have much concept of wallclock time on ARM (for
either the hypervisor, dom0 or guests). For now just stub everything
out. Specifically domain_set_time_offset, update_vcpu_system_time and
wallclock_time.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
`
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 43193e52d15a -r f6984864e580 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:21 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:22 2012 +0000
@@ -9,9 +9,6 @@ x:	mov pc, lr
 /* PIRQ support */
 DUMMY(nr_irqs_gsi);
 
-/* VCPU */
-NOP(update_vcpu_system_time);
-
 /* Grant Tables */
 DUMMY(steal_page);
 
@@ -21,8 +18,6 @@ DUMMY(page_is_ram_type);
 /* Other */
 DUMMY(domain_get_maximum_gpfn);
 DUMMY(domain_relinquish_resources);
-DUMMY(domain_set_time_offset);
 DUMMY(dom_cow);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
-DUMMY(wallclock_time);
diff -r 43193e52d15a -r f6984864e580 xen/arch/arm/time.c
--- a/xen/arch/arm/time.c	Wed Dec 19 14:16:21 2012 +0000
+++ b/xen/arch/arm/time.c	Wed Dec 19 14:16:22 2012 +0000
@@ -25,6 +25,7 @@
 #include <xen/mm.h>
 #include <xen/softirq.h>
 #include <xen/time.h>
+#include <xen/sched.h>
 #include <asm/system.h>
 
 /*
@@ -185,6 +186,23 @@ void udelay(unsigned long usecs)
     isb();
 }
 
+/* VCPU PV clock. */
+void update_vcpu_system_time(struct vcpu *v)
+{
+    /* XXX update shared_info->wc_* */
+}
+
+void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds)
+{
+    d->time_offset_seconds = time_offset_seconds;
+    /* XXX update guest visible wallclock time */
+}
+
+struct tm wallclock_time(void)
+{
+    return (struct tm) { 0 };
+}
+
 /*
  * Local variables:
  * mode: C

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-00071p-6c; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-00070h-QA
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Received: from [85.158.143.99:63490] by server-1.bemta-4.messagelabs.com id
	11/6D-28401-5A833D05; Thu, 20 Dec 2012 16:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1356019875!19164426!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32174 invoked from network); 20 Dec 2012 16:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiJ-0005fb-8j
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiJ-0006AX-6a
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:15 +0000
Message-Id: <E1TliiJ-0006AX-6a@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub out
	domain_get_maximum_gpfn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926584 0
# Node ID dcee6a203836bcb8727edb505dbccfc6566e6420
# Parent  dd943de93c88ced67733e7b087055b26c1f55ed8
xen: arm: stub out domain_get_maximum_gpfn

It currently has no callers, so return ENOSYS until such a time as one
arrives.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r dd943de93c88 -r dcee6a203836 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:23 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:24 2012 +0000
@@ -10,7 +10,6 @@ x:	mov pc, lr
 DUMMY(nr_irqs_gsi);
 
 /* Other */
-DUMMY(domain_get_maximum_gpfn);
 DUMMY(domain_relinquish_resources);
 DUMMY(dom_cow);
 DUMMY(send_timer_event);
diff -r dd943de93c88 -r dcee6a203836 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Dec 19 14:16:23 2012 +0000
+++ b/xen/arch/arm/mm.c	Wed Dec 19 14:16:24 2012 +0000
@@ -447,6 +447,11 @@ int page_is_ram_type(unsigned long mfn, 
     return 0;
 }
 
+unsigned long domain_get_maximum_gpfn(struct domain *d)
+{
+    return -ENOSYS;
+}
+
 void share_xen_page_with_guest(struct page_info *page,
                           struct domain *d, int readonly)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-00071x-8z; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-00071D-OG
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Received: from [85.158.137.99:46887] by server-10.bemta-3.messagelabs.com id
	46/47-07616-4A833D05; Thu, 20 Dec 2012 16:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-217.messagelabs.com!1356019873!14053704!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15631 invoked from network); 20 Dec 2012 16:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiH-0005fS-M2
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiH-00069o-KN
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:13 +0000
Message-Id: <E1TliiH-00069o-KN@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub out wallclock time.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926582 0
# Node ID f6984864e580c4c7daf5db5951b19767bc979fc5
# Parent  43193e52d15a66c0b6c246099302081b887134d6
xen: arm: stub out wallclock time.

We don't currently have much concept of wallclock time on ARM (for
either the hypervisor, dom0 or guests). For now just stub everything
out. Specifically domain_set_time_offset, update_vcpu_system_time and
wallclock_time.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
`
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 43193e52d15a -r f6984864e580 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:21 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:22 2012 +0000
@@ -9,9 +9,6 @@ x:	mov pc, lr
 /* PIRQ support */
 DUMMY(nr_irqs_gsi);
 
-/* VCPU */
-NOP(update_vcpu_system_time);
-
 /* Grant Tables */
 DUMMY(steal_page);
 
@@ -21,8 +18,6 @@ DUMMY(page_is_ram_type);
 /* Other */
 DUMMY(domain_get_maximum_gpfn);
 DUMMY(domain_relinquish_resources);
-DUMMY(domain_set_time_offset);
 DUMMY(dom_cow);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
-DUMMY(wallclock_time);
diff -r 43193e52d15a -r f6984864e580 xen/arch/arm/time.c
--- a/xen/arch/arm/time.c	Wed Dec 19 14:16:21 2012 +0000
+++ b/xen/arch/arm/time.c	Wed Dec 19 14:16:22 2012 +0000
@@ -25,6 +25,7 @@
 #include <xen/mm.h>
 #include <xen/softirq.h>
 #include <xen/time.h>
+#include <xen/sched.h>
 #include <asm/system.h>
 
 /*
@@ -185,6 +186,23 @@ void udelay(unsigned long usecs)
     isb();
 }
 
+/* VCPU PV clock. */
+void update_vcpu_system_time(struct vcpu *v)
+{
+    /* XXX update shared_info->wc_* */
+}
+
+void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds)
+{
+    d->time_offset_seconds = time_offset_seconds;
+    /* XXX update guest visible wallclock time */
+}
+
+struct tm wallclock_time(void)
+{
+    return (struct tm) { 0 };
+}
+
 /*
  * Local variables:
  * mode: C

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-00071p-6c; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-00070h-QA
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Received: from [85.158.143.99:63490] by server-1.bemta-4.messagelabs.com id
	11/6D-28401-5A833D05; Thu, 20 Dec 2012 16:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-216.messagelabs.com!1356019875!19164426!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32174 invoked from network); 20 Dec 2012 16:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiJ-0005fb-8j
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiJ-0006AX-6a
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:15 +0000
Message-Id: <E1TliiJ-0006AX-6a@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub out
	domain_get_maximum_gpfn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926584 0
# Node ID dcee6a203836bcb8727edb505dbccfc6566e6420
# Parent  dd943de93c88ced67733e7b087055b26c1f55ed8
xen: arm: stub out domain_get_maximum_gpfn

It currently has no callers, so return ENOSYS until such a time as one
arrives.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r dd943de93c88 -r dcee6a203836 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:23 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:24 2012 +0000
@@ -10,7 +10,6 @@ x:	mov pc, lr
 DUMMY(nr_irqs_gsi);
 
 /* Other */
-DUMMY(domain_get_maximum_gpfn);
 DUMMY(domain_relinquish_resources);
 DUMMY(dom_cow);
 DUMMY(send_timer_event);
diff -r dd943de93c88 -r dcee6a203836 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Dec 19 14:16:23 2012 +0000
+++ b/xen/arch/arm/mm.c	Wed Dec 19 14:16:24 2012 +0000
@@ -447,6 +447,11 @@ int page_is_ram_type(unsigned long mfn, 
     return 0;
 }
 
+unsigned long domain_get_maximum_gpfn(struct domain *d)
+{
+    return -ENOSYS;
+}
+
 void share_xen_page_with_guest(struct page_info *page,
                           struct domain *d, int readonly)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-000722-Ba; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-00070g-VA
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Received: from [193.109.254.147:50037] by server-5.bemta-14.messagelabs.com id
	B5/3D-32031-5A833D05; Thu, 20 Dec 2012 16:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1356019876!9404494!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10829 invoked from network); 20 Dec 2012 16:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiJ-0005fe-Sn
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiJ-0006Am-O1
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:15 +0000
Message-Id: <E1TliiJ-0006Am-O1@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub
	domain_relinquish_resources.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926585 0
# Node ID 8dad184a8e2a9c539c4c359f4cab165f5eac29e0
# Parent  dcee6a203836bcb8727edb505dbccfc6566e6420
xen: arm: stub domain_relinquish_resources.

Currently unimplemented. Domain teardown in general needs looking at.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r dcee6a203836 -r 8dad184a8e2a xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Wed Dec 19 14:16:24 2012 +0000
+++ b/xen/arch/arm/domain.c	Wed Dec 19 14:16:25 2012 +0000
@@ -520,6 +520,13 @@ void arch_vcpu_reset(struct vcpu *v)
     vcpu_end_shutdown_deferral(v);
 }
 
+int domain_relinquish_resources(struct domain *d)
+{
+    /* XXX teardown pagetables, free pages etc */
+    ASSERT(0);
+    return 0;
+}
+
 void arch_dump_domain_info(struct domain *d)
 {
 }
diff -r dcee6a203836 -r 8dad184a8e2a xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:24 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:25 2012 +0000
@@ -10,7 +10,6 @@ x:	mov pc, lr
 DUMMY(nr_irqs_gsi);
 
 /* Other */
-DUMMY(domain_relinquish_resources);
 DUMMY(dom_cow);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-00071k-4A; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-000712-E9
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Received: from [193.109.254.147:55886] by server-8.bemta-14.messagelabs.com id
	9D/8B-26341-4A833D05; Thu, 20 Dec 2012 16:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1356019873!3636848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22264 invoked from network); 20 Dec 2012 16:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiH-0005fP-86
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiH-00069Z-3Q
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:13 +0000
Message-Id: <E1TliiH-00069Z-3Q@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub out pirq related
	functions.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926581 0
# Node ID 43193e52d15a66c0b6c246099302081b887134d6
# Parent  98b8d7121332a1db990429c7f432ae11dbb31bfa
xen: arm: stub out pirq related functions.

On ARM we use GIC functionality to inject virtualised real interrupts
for h/w devices rather than evtchn-pirqs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 98b8d7121332 -r 43193e52d15a xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:21 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:21 2012 +0000
@@ -7,11 +7,7 @@ x:	.word 0xe7f000f0 /* Undefined instruc
 x:	mov pc, lr
 	
 /* PIRQ support */
-DUMMY(alloc_pirq_struct);
 DUMMY(nr_irqs_gsi);
-DUMMY(pirq_guest_bind);
-DUMMY(pirq_guest_unbind);
-DUMMY(pirq_set_affinity);
 
 /* VCPU */
 NOP(update_vcpu_system_time);
diff -r 98b8d7121332 -r 43193e52d15a xen/arch/arm/irq.c
--- a/xen/arch/arm/irq.c	Wed Dec 19 14:16:21 2012 +0000
+++ b/xen/arch/arm/irq.c	Wed Dec 19 14:16:21 2012 +0000
@@ -192,6 +192,35 @@ out_no_end:
 }
 
 /*
+ * pirq event channels. We don't use these on ARM, instead we use the
+ * features of the GIC to inject virtualised normal interrupts.
+ */
+struct pirq *alloc_pirq_struct(struct domain *d)
+{
+    return NULL;
+}
+
+/*
+ * These are all unreachable given an alloc_pirq_struct
+ * which returns NULL, all callers try to lookup struct pirq first
+ * which will fail.
+ */
+int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share)
+{
+    BUG();
+}
+
+void pirq_guest_unbind(struct domain *d, struct pirq *pirq)
+{
+    BUG();
+}
+
+void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
+{
+    BUG();
+}
+
+/*
  * Local variables:
  * mode: C
  * c-set-style: "BSD"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-000722-Ba; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-00070g-VA
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Received: from [193.109.254.147:50037] by server-5.bemta-14.messagelabs.com id
	B5/3D-32031-5A833D05; Thu, 20 Dec 2012 16:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1356019876!9404494!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10829 invoked from network); 20 Dec 2012 16:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiJ-0005fe-Sn
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiJ-0006Am-O1
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:15 +0000
Message-Id: <E1TliiJ-0006Am-O1@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub
	domain_relinquish_resources.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926585 0
# Node ID 8dad184a8e2a9c539c4c359f4cab165f5eac29e0
# Parent  dcee6a203836bcb8727edb505dbccfc6566e6420
xen: arm: stub domain_relinquish_resources.

Currently unimplemented. Domain teardown in general needs looking at.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r dcee6a203836 -r 8dad184a8e2a xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Wed Dec 19 14:16:24 2012 +0000
+++ b/xen/arch/arm/domain.c	Wed Dec 19 14:16:25 2012 +0000
@@ -520,6 +520,13 @@ void arch_vcpu_reset(struct vcpu *v)
     vcpu_end_shutdown_deferral(v);
 }
 
+int domain_relinquish_resources(struct domain *d)
+{
+    /* XXX teardown pagetables, free pages etc */
+    ASSERT(0);
+    return 0;
+}
+
 void arch_dump_domain_info(struct domain *d)
 {
 }
diff -r dcee6a203836 -r 8dad184a8e2a xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:24 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:25 2012 +0000
@@ -10,7 +10,6 @@ x:	mov pc, lr
 DUMMY(nr_irqs_gsi);
 
 /* Other */
-DUMMY(domain_relinquish_resources);
 DUMMY(dom_cow);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-00071k-4A; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-000712-E9
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Received: from [193.109.254.147:55886] by server-8.bemta-14.messagelabs.com id
	9D/8B-26341-4A833D05; Thu, 20 Dec 2012 16:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1356019873!3636848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22264 invoked from network); 20 Dec 2012 16:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiH-0005fP-86
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiH-00069Z-3Q
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:13 +0000
Message-Id: <E1TliiH-00069Z-3Q@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub out pirq related
	functions.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926581 0
# Node ID 43193e52d15a66c0b6c246099302081b887134d6
# Parent  98b8d7121332a1db990429c7f432ae11dbb31bfa
xen: arm: stub out pirq related functions.

On ARM we use GIC functionality to inject virtualised real interrupts
for h/w devices rather than evtchn-pirqs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 98b8d7121332 -r 43193e52d15a xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:21 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:21 2012 +0000
@@ -7,11 +7,7 @@ x:	.word 0xe7f000f0 /* Undefined instruc
 x:	mov pc, lr
 	
 /* PIRQ support */
-DUMMY(alloc_pirq_struct);
 DUMMY(nr_irqs_gsi);
-DUMMY(pirq_guest_bind);
-DUMMY(pirq_guest_unbind);
-DUMMY(pirq_set_affinity);
 
 /* VCPU */
 NOP(update_vcpu_system_time);
diff -r 98b8d7121332 -r 43193e52d15a xen/arch/arm/irq.c
--- a/xen/arch/arm/irq.c	Wed Dec 19 14:16:21 2012 +0000
+++ b/xen/arch/arm/irq.c	Wed Dec 19 14:16:21 2012 +0000
@@ -192,6 +192,35 @@ out_no_end:
 }
 
 /*
+ * pirq event channels. We don't use these on ARM, instead we use the
+ * features of the GIC to inject virtualised normal interrupts.
+ */
+struct pirq *alloc_pirq_struct(struct domain *d)
+{
+    return NULL;
+}
+
+/*
+ * These are all unreachable given an alloc_pirq_struct
+ * which returns NULL, all callers try to lookup struct pirq first
+ * which will fail.
+ */
+int pirq_guest_bind(struct vcpu *v, struct pirq *pirq, int will_share)
+{
+    BUG();
+}
+
+void pirq_guest_unbind(struct domain *d, struct pirq *pirq)
+{
+    BUG();
+}
+
+void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
+{
+    BUG();
+}
+
+/*
  * Local variables:
  * mode: C
  * c-set-style: "BSD"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-000729-E2; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-00071S-FW
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Received: from [85.158.139.211:9543] by server-13.bemta-5.messagelabs.com id
	88/E5-10716-5A833D05; Thu, 20 Dec 2012 16:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-206.messagelabs.com!1356019874!19906734!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13564 invoked from network); 20 Dec 2012 16:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiI-0005fV-A4
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiI-0006A3-5T
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:14 +0000
Message-Id: <E1TliiI-0006A3-5T@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub out steal_page.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926583 0
# Node ID f32398f24969563375ec0db253ef4cbc92ccf346
# Parent  f6984864e580c4c7daf5db5951b19767bc979fc5
xen: arm: stub out steal_page.

Callers handle the failure gracefully, can be called by
GNTTABOP_transfer, XENMEM_exchange or tmem.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r f6984864e580 -r f32398f24969 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:22 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:23 2012 +0000
@@ -9,9 +9,6 @@ x:	mov pc, lr
 /* PIRQ support */
 DUMMY(nr_irqs_gsi);
 
-/* Grant Tables */
-DUMMY(steal_page);
-
 /* Page Offlining */
 DUMMY(page_is_ram_type);
 
diff -r f6984864e580 -r f32398f24969 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Dec 19 14:16:22 2012 +0000
+++ b/xen/arch/arm/mm.c	Wed Dec 19 14:16:23 2012 +0000
@@ -435,6 +435,12 @@ int donate_page(struct domain *d, struct
     return -ENOSYS;
 }
 
+int steal_page(
+    struct domain *d, struct page_info *page, unsigned int memflags)
+{
+    return -1;
+}
+
 void share_xen_page_with_guest(struct page_info *page,
                           struct domain *d, int readonly)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-000729-E2; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-00071S-FW
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Received: from [85.158.139.211:9543] by server-13.bemta-5.messagelabs.com id
	88/E5-10716-5A833D05; Thu, 20 Dec 2012 16:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-206.messagelabs.com!1356019874!19906734!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13564 invoked from network); 20 Dec 2012 16:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiI-0005fV-A4
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiI-0006A3-5T
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:14 +0000
Message-Id: <E1TliiI-0006A3-5T@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub out steal_page.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926583 0
# Node ID f32398f24969563375ec0db253ef4cbc92ccf346
# Parent  f6984864e580c4c7daf5db5951b19767bc979fc5
xen: arm: stub out steal_page.

Callers handle the failure gracefully, can be called by
GNTTABOP_transfer, XENMEM_exchange or tmem.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r f6984864e580 -r f32398f24969 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:22 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:23 2012 +0000
@@ -9,9 +9,6 @@ x:	mov pc, lr
 /* PIRQ support */
 DUMMY(nr_irqs_gsi);
 
-/* Grant Tables */
-DUMMY(steal_page);
-
 /* Page Offlining */
 DUMMY(page_is_ram_type);
 
diff -r f6984864e580 -r f32398f24969 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Dec 19 14:16:22 2012 +0000
+++ b/xen/arch/arm/mm.c	Wed Dec 19 14:16:23 2012 +0000
@@ -435,6 +435,12 @@ int donate_page(struct domain *d, struct
     return -ENOSYS;
 }
 
+int steal_page(
+    struct domain *d, struct page_info *page, unsigned int memflags)
+{
+    return -1;
+}
+
 void share_xen_page_with_guest(struct page_info *page,
                           struct domain *d, int readonly)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiL-000718-1O; Thu, 20 Dec 2012 16:11:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiK-00070m-2I
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:16 +0000
Received: from [85.158.137.99:46694] by server-11.bemta-3.messagelabs.com id
	27/28-13335-2A833D05; Thu, 20 Dec 2012 16:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1356019872!20274267!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18842 invoked from network); 20 Dec 2012 16:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiG-0005fM-Kc
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiG-00069K-J3
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:12 +0000
Message-Id: <E1TliiG-00069K-J3@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: implement arch_vcpu_reset.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926581 0
# Node ID 98b8d7121332a1db990429c7f432ae11dbb31bfa
# Parent  d72be2fc7e755fbc9471a1e801d0b88b02971ce4
xen: arm: implement arch_vcpu_reset.

Untested.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d72be2fc7e75 -r 98b8d7121332 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Wed Dec 19 14:16:20 2012 +0000
+++ b/xen/arch/arm/domain.c	Wed Dec 19 14:16:21 2012 +0000
@@ -515,6 +515,11 @@ int arch_set_info_guest(
     return 0;
 }
 
+void arch_vcpu_reset(struct vcpu *v)
+{
+    vcpu_end_shutdown_deferral(v);
+}
+
 void arch_dump_domain_info(struct domain *d)
 {
 }
diff -r d72be2fc7e75 -r 98b8d7121332 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:20 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:21 2012 +0000
@@ -14,7 +14,6 @@ DUMMY(pirq_guest_unbind);
 DUMMY(pirq_set_affinity);
 
 /* VCPU */
-DUMMY(arch_vcpu_reset);
 NOP(update_vcpu_system_time);
 
 /* Grant Tables */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiL-000718-1O; Thu, 20 Dec 2012 16:11:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiK-00070m-2I
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:16 +0000
Received: from [85.158.137.99:46694] by server-11.bemta-3.messagelabs.com id
	27/28-13335-2A833D05; Thu, 20 Dec 2012 16:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-217.messagelabs.com!1356019872!20274267!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18842 invoked from network); 20 Dec 2012 16:11:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiG-0005fM-Kc
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiG-00069K-J3
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:12 +0000
Message-Id: <E1TliiG-00069K-J3@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: implement arch_vcpu_reset.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926581 0
# Node ID 98b8d7121332a1db990429c7f432ae11dbb31bfa
# Parent  d72be2fc7e755fbc9471a1e801d0b88b02971ce4
xen: arm: implement arch_vcpu_reset.

Untested.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d72be2fc7e75 -r 98b8d7121332 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Wed Dec 19 14:16:20 2012 +0000
+++ b/xen/arch/arm/domain.c	Wed Dec 19 14:16:21 2012 +0000
@@ -515,6 +515,11 @@ int arch_set_info_guest(
     return 0;
 }
 
+void arch_vcpu_reset(struct vcpu *v)
+{
+    vcpu_end_shutdown_deferral(v);
+}
+
 void arch_dump_domain_info(struct domain *d)
 {
 }
diff -r d72be2fc7e75 -r 98b8d7121332 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:20 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:21 2012 +0000
@@ -14,7 +14,6 @@ DUMMY(pirq_guest_unbind);
 DUMMY(pirq_set_affinity);
 
 /* VCPU */
-DUMMY(arch_vcpu_reset);
 NOP(update_vcpu_system_time);
 
 /* Grant Tables */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-00072E-Gi; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-00071N-CU
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Received: from [193.109.254.147:12339] by server-12.bemta-14.messagelabs.com
	id AA/50-06523-5A833D05; Thu, 20 Dec 2012 16:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1356019874!1009521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10373 invoked from network); 20 Dec 2012 16:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiI-0005fY-NY
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiI-0006AI-MD
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:14 +0000
Message-Id: <E1TliiI-0006AI-MD@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub page_is_ram_type.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926583 0
# Node ID dd943de93c88ced67733e7b087055b26c1f55ed8
# Parent  f32398f24969563375ec0db253ef4cbc92ccf346
xen: arm: stub page_is_ram_type.

Callers are VT-d (so x86 specific) and various bits of page offlining
support, which although it looks generic (and is in xen/common) does
things like diving into page_info->count_info which is not generic.

In any case on this is only reachable via XEN_SYSCTL_page_offline_op,
which clearly shouldn't be called on ARM just yet.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r f32398f24969 -r dd943de93c88 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:23 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:23 2012 +0000
@@ -9,9 +9,6 @@ x:	mov pc, lr
 /* PIRQ support */
 DUMMY(nr_irqs_gsi);
 
-/* Page Offlining */
-DUMMY(page_is_ram_type);
-
 /* Other */
 DUMMY(domain_get_maximum_gpfn);
 DUMMY(domain_relinquish_resources);
diff -r f32398f24969 -r dd943de93c88 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Dec 19 14:16:23 2012 +0000
+++ b/xen/arch/arm/mm.c	Wed Dec 19 14:16:23 2012 +0000
@@ -441,6 +441,12 @@ int steal_page(
     return -1;
 }
 
+int page_is_ram_type(unsigned long mfn, unsigned long mem_type)
+{
+    ASSERT(0);
+    return 0;
+}
+
 void share_xen_page_with_guest(struct page_info *page,
                           struct domain *d, int readonly)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiN-00072E-Gi; Thu, 20 Dec 2012 16:11:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-00071N-CU
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Received: from [193.109.254.147:12339] by server-12.bemta-14.messagelabs.com
	id AA/50-06523-5A833D05; Thu, 20 Dec 2012 16:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1356019874!1009521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10373 invoked from network); 20 Dec 2012 16:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiI-0005fY-NY
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiI-0006AI-MD
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:14 +0000
Message-Id: <E1TliiI-0006AI-MD@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: stub page_is_ram_type.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926583 0
# Node ID dd943de93c88ced67733e7b087055b26c1f55ed8
# Parent  f32398f24969563375ec0db253ef4cbc92ccf346
xen: arm: stub page_is_ram_type.

Callers are VT-d (so x86 specific) and various bits of page offlining
support, which although it looks generic (and is in xen/common) does
things like diving into page_info->count_info which is not generic.

In any case on this is only reachable via XEN_SYSCTL_page_offline_op,
which clearly shouldn't be called on ARM just yet.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r f32398f24969 -r dd943de93c88 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:23 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:23 2012 +0000
@@ -9,9 +9,6 @@ x:	mov pc, lr
 /* PIRQ support */
 DUMMY(nr_irqs_gsi);
 
-/* Page Offlining */
-DUMMY(page_is_ram_type);
-
 /* Other */
 DUMMY(domain_get_maximum_gpfn);
 DUMMY(domain_relinquish_resources);
diff -r f32398f24969 -r dd943de93c88 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Dec 19 14:16:23 2012 +0000
+++ b/xen/arch/arm/mm.c	Wed Dec 19 14:16:23 2012 +0000
@@ -441,6 +441,12 @@ int steal_page(
     return -1;
 }
 
+int page_is_ram_type(unsigned long mfn, unsigned long mem_type)
+{
+    ASSERT(0);
+    return 0;
+}
+
 void share_xen_page_with_guest(struct page_info *page,
                           struct domain *d, int readonly)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiR-00076l-Nz; Thu, 20 Dec 2012 16:11:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiQ-00075o-Ae
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:22 +0000
Received: from [193.109.254.147:12524] by server-1.bemta-14.messagelabs.com id
	7B/8C-15901-9A833D05; Thu, 20 Dec 2012 16:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1356019877!9404498!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10881 invoked from network); 20 Dec 2012 16:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-0005fn-AY
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-0006BV-9F
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Message-Id: <E1TliiL-0006BV-9F@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: implement
	share_xen_page_with_privileged_guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926587 0
# Node ID 519ae882d3ff0458450f693ec2427c348227fd22
# Parent  b56a5aae2f5be3b4c7dbf6ea6c763998f20823b3
xen: arm: implement share_xen_page_with_privileged_guests

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b56a5aae2f5b -r 519ae882d3ff xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:26 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:27 2012 +0000
@@ -8,6 +8,3 @@ x:	mov pc, lr
 	
 /* PIRQ support */
 DUMMY(nr_irqs_gsi);
-
-/* Other */
-DUMMY(share_xen_page_with_privileged_guests);
diff -r b56a5aae2f5b -r 519ae882d3ff xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Dec 19 14:16:26 2012 +0000
+++ b/xen/arch/arm/mm.c	Wed Dec 19 14:16:27 2012 +0000
@@ -506,6 +506,12 @@ void share_xen_page_with_guest(struct pa
     spin_unlock(&d->page_alloc_lock);
 }
 
+void share_xen_page_with_privileged_guests(
+    struct page_info *page, int readonly)
+{
+    share_xen_page_with_guest(page, dom_xen, readonly);
+}
+
 static int xenmem_add_to_physmap_one(
     struct domain *d,
     uint16_t space,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiR-00076l-Nz; Thu, 20 Dec 2012 16:11:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiQ-00075o-Ae
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:22 +0000
Received: from [193.109.254.147:12524] by server-1.bemta-14.messagelabs.com id
	7B/8C-15901-9A833D05; Thu, 20 Dec 2012 16:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1356019877!9404498!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10881 invoked from network); 20 Dec 2012 16:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-0005fn-AY
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-0006BV-9F
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Message-Id: <E1TliiL-0006BV-9F@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: implement
	share_xen_page_with_privileged_guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926587 0
# Node ID 519ae882d3ff0458450f693ec2427c348227fd22
# Parent  b56a5aae2f5be3b4c7dbf6ea6c763998f20823b3
xen: arm: implement share_xen_page_with_privileged_guests

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b56a5aae2f5b -r 519ae882d3ff xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:26 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:27 2012 +0000
@@ -8,6 +8,3 @@ x:	mov pc, lr
 	
 /* PIRQ support */
 DUMMY(nr_irqs_gsi);
-
-/* Other */
-DUMMY(share_xen_page_with_privileged_guests);
diff -r b56a5aae2f5b -r 519ae882d3ff xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Dec 19 14:16:26 2012 +0000
+++ b/xen/arch/arm/mm.c	Wed Dec 19 14:16:27 2012 +0000
@@ -506,6 +506,12 @@ void share_xen_page_with_guest(struct pa
     spin_unlock(&d->page_alloc_lock);
 }
 
+void share_xen_page_with_privileged_guests(
+    struct page_info *page, int readonly)
+{
+    share_xen_page_with_guest(page, dom_xen, readonly);
+}
+
 static int xenmem_add_to_physmap_one(
     struct domain *d,
     uint16_t space,

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiR-00076u-Qj; Thu, 20 Dec 2012 16:11:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiQ-00073o-7O
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:22 +0000
Received: from [85.158.143.99:6760] by server-3.bemta-4.messagelabs.com id
	15/F0-18211-9A833D05; Thu, 20 Dec 2012 16:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1356019878!25171341!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3427 invoked from network); 20 Dec 2012 16:11:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-0005ft-Ca
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-0006Bz-Ax
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Message-Id: <E1TliiM-0006Bz-Ax@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: remove hard tabs from asm
	code.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926588 0
# Node ID fe36080ff85f727fd0de87a8fd264892d41b8c9c
# Parent  32db97a8db862a89519495ef8f1f1c5eb48d48a2
xen: arm: remove hard tabs from asm code.

Run expand(1) over xen/arch/arm/.../*.S

Add emacs local vars block.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ijc -- stripped trailing whitespace caught by git apply]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 32db97a8db86 -r fe36080ff85f xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S	Wed Dec 19 14:16:27 2012 +0000
+++ b/xen/arch/arm/entry.S	Wed Dec 19 14:16:28 2012 +0000
@@ -2,79 +2,79 @@
 #include <asm/asm_defns.h>
 #include <public/xen.h>
 
-#define SAVE_ONE_BANKED(reg)	mrs r11, reg; str r11, [sp, #UREGS_##reg]
-#define RESTORE_ONE_BANKED(reg)	ldr r11, [sp, #UREGS_##reg]; msr reg, r11
+#define SAVE_ONE_BANKED(reg)    mrs r11, reg; str r11, [sp, #UREGS_##reg]
+#define RESTORE_ONE_BANKED(reg) ldr r11, [sp, #UREGS_##reg]; msr reg, r11
 
 #define SAVE_BANKED(mode) \
-	SAVE_ONE_BANKED(SP_##mode) ; SAVE_ONE_BANKED(LR_##mode) ; SAVE_ONE_BANKED(SPSR_##mode)
+        SAVE_ONE_BANKED(SP_##mode) ; SAVE_ONE_BANKED(LR_##mode) ; SAVE_ONE_BANKED(SPSR_##mode)
 
 #define RESTORE_BANKED(mode) \
-	RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
+        RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
 
-#define SAVE_ALL							\
-	sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */	\
-	push {r0-r12}; /* Save R0-R12 */				\
-									\
-	mrs r11, ELR_hyp;		/* ELR_hyp is return address. */\
-	str r11, [sp, #UREGS_pc];					\
-									\
-	str lr, [sp, #UREGS_lr];					\
-									\
-	add r11, sp, #UREGS_kernel_sizeof+4;				\
-	str r11, [sp, #UREGS_sp];					\
-									\
-	mrs r11, SPSR_hyp;						\
-	str r11, [sp, #UREGS_cpsr];					\
-	and r11, #PSR_MODE_MASK;					\
-	cmp r11, #PSR_MODE_HYP;						\
-	blne save_guest_regs
+#define SAVE_ALL                                                        \
+        sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */      \
+        push {r0-r12}; /* Save R0-R12 */                                \
+                                                                        \
+        mrs r11, ELR_hyp;               /* ELR_hyp is return address. */\
+        str r11, [sp, #UREGS_pc];                                       \
+                                                                        \
+        str lr, [sp, #UREGS_lr];                                        \
+                                                                        \
+        add r11, sp, #UREGS_kernel_sizeof+4;                            \
+        str r11, [sp, #UREGS_sp];                                       \
+                                                                        \
+        mrs r11, SPSR_hyp;                                              \
+        str r11, [sp, #UREGS_cpsr];                                     \
+        and r11, #PSR_MODE_MASK;                                        \
+        cmp r11, #PSR_MODE_HYP;                                         \
+        blne save_guest_regs
 
 save_guest_regs:
-	ldr r11, =0xffffffff  /* Clobber SP which is only valid for hypervisor frames. */
-	str r11, [sp, #UREGS_sp]
-	SAVE_ONE_BANKED(SP_usr)
-	/* LR_usr is the same physical register as lr and is saved in SAVE_ALL */
-	SAVE_BANKED(svc)
-	SAVE_BANKED(abt)
-	SAVE_BANKED(und)
-	SAVE_BANKED(irq)
-	SAVE_BANKED(fiq)
-	SAVE_ONE_BANKED(R8_fiq); SAVE_ONE_BANKED(R9_fiq); SAVE_ONE_BANKED(R10_fiq)
-	SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
-	mov pc, lr
+        ldr r11, =0xffffffff  /* Clobber SP which is only valid for hypervisor frames. */
+        str r11, [sp, #UREGS_sp]
+        SAVE_ONE_BANKED(SP_usr)
+        /* LR_usr is the same physical register as lr and is saved in SAVE_ALL */
+        SAVE_BANKED(svc)
+        SAVE_BANKED(abt)
+        SAVE_BANKED(und)
+        SAVE_BANKED(irq)
+        SAVE_BANKED(fiq)
+        SAVE_ONE_BANKED(R8_fiq); SAVE_ONE_BANKED(R9_fiq); SAVE_ONE_BANKED(R10_fiq)
+        SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
+        mov pc, lr
 
-#define DEFINE_TRAP_ENTRY(trap)						\
-	ALIGN;								\
-trap_##trap:								\
-	SAVE_ALL;							\
-	cpsie i; 	/* local_irq_enable */				\
-	adr lr, return_from_trap;					\
-	mov r0, sp;							\
-	mov r11, sp;							\
-	bic sp, #7; /* Align the stack pointer (noop on guest trap) */	\
-	b do_trap_##trap
+#define DEFINE_TRAP_ENTRY(trap)                                         \
+        ALIGN;                                                          \
+trap_##trap:                                                            \
+        SAVE_ALL;                                                       \
+        cpsie i;        /* local_irq_enable */                          \
+        adr lr, return_from_trap;                                       \
+        mov r0, sp;                                                     \
+        mov r11, sp;                                                    \
+        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
+        b do_trap_##trap
 
-#define DEFINE_TRAP_ENTRY_NOIRQ(trap)					\
-	ALIGN;								\
-trap_##trap:								\
-	SAVE_ALL;							\
-	adr lr, return_from_trap;					\
-	mov r0, sp;							\
-	mov r11, sp;							\
-	bic sp, #7; /* Align the stack pointer (noop on guest trap) */	\
-	b do_trap_##trap
+#define DEFINE_TRAP_ENTRY_NOIRQ(trap)                                   \
+        ALIGN;                                                          \
+trap_##trap:                                                            \
+        SAVE_ALL;                                                       \
+        adr lr, return_from_trap;                                       \
+        mov r0, sp;                                                     \
+        mov r11, sp;                                                    \
+        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
+        b do_trap_##trap
 
 .globl hyp_traps_vector
-	.align 5
+        .align 5
 hyp_traps_vector:
-	.word 0				/* 0x00 - Reset */
-	b trap_undefined_instruction	/* 0x04 - Undefined Instruction */
-	b trap_supervisor_call		/* 0x08 - Supervisor Call */
-	b trap_prefetch_abort		/* 0x0c - Prefetch Abort */
-	b trap_data_abort		/* 0x10 - Data Abort */
-	b trap_hypervisor		/* 0x14 - Hypervisor */
-	b trap_irq			/* 0x18 - IRQ */
-	b trap_fiq			/* 0x1c - FIQ */
+        .word 0                         /* 0x00 - Reset */
+        b trap_undefined_instruction    /* 0x04 - Undefined Instruction */
+        b trap_supervisor_call          /* 0x08 - Supervisor Call */
+        b trap_prefetch_abort           /* 0x0c - Prefetch Abort */
+        b trap_data_abort               /* 0x10 - Data Abort */
+        b trap_hypervisor               /* 0x14 - Hypervisor */
+        b trap_irq                      /* 0x18 - IRQ */
+        b trap_fiq                      /* 0x1c - FIQ */
 
 DEFINE_TRAP_ENTRY(undefined_instruction)
 DEFINE_TRAP_ENTRY(supervisor_call)
@@ -85,38 +85,38 @@ DEFINE_TRAP_ENTRY_NOIRQ(irq)
 DEFINE_TRAP_ENTRY_NOIRQ(fiq)
 
 return_from_trap:
-	mov sp, r11
+        mov sp, r11
 ENTRY(return_to_new_vcpu)
-	ldr r11, [sp, #UREGS_cpsr]
-	and r11, #PSR_MODE_MASK
-	cmp r11, #PSR_MODE_HYP
-	beq return_to_hypervisor
-	/* Fall thru */
+        ldr r11, [sp, #UREGS_cpsr]
+        and r11, #PSR_MODE_MASK
+        cmp r11, #PSR_MODE_HYP
+        beq return_to_hypervisor
+        /* Fall thru */
 ENTRY(return_to_guest)
-	mov r11, sp
-	bic sp, #7 /* Align the stack pointer */
-	bl leave_hypervisor_tail /* Disables interrupts on return */
-	mov sp, r11
-	RESTORE_ONE_BANKED(SP_usr)
-	/* LR_usr is the same physical register as lr and is restored below */
-	RESTORE_BANKED(svc)
-	RESTORE_BANKED(abt)
-	RESTORE_BANKED(und)
-	RESTORE_BANKED(irq)
-	RESTORE_BANKED(fiq)
-	RESTORE_ONE_BANKED(R8_fiq); RESTORE_ONE_BANKED(R9_fiq); RESTORE_ONE_BANKED(R10_fiq)
-	RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq);
-	/* Fall thru */
+        mov r11, sp
+        bic sp, #7 /* Align the stack pointer */
+        bl leave_hypervisor_tail /* Disables interrupts on return */
+        mov sp, r11
+        RESTORE_ONE_BANKED(SP_usr)
+        /* LR_usr is the same physical register as lr and is restored below */
+        RESTORE_BANKED(svc)
+        RESTORE_BANKED(abt)
+        RESTORE_BANKED(und)
+        RESTORE_BANKED(irq)
+        RESTORE_BANKED(fiq)
+        RESTORE_ONE_BANKED(R8_fiq); RESTORE_ONE_BANKED(R9_fiq); RESTORE_ONE_BANKED(R10_fiq)
+        RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq);
+        /* Fall thru */
 ENTRY(return_to_hypervisor)
-	cpsid i
-	ldr lr, [sp, #UREGS_lr]
-	ldr r11, [sp, #UREGS_pc]
-	msr ELR_hyp, r11
-	ldr r11, [sp, #UREGS_cpsr]
-	msr SPSR_hyp, r11
-	pop {r0-r12}
-	add sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */
-	eret
+        cpsid i
+        ldr lr, [sp, #UREGS_lr]
+        ldr r11, [sp, #UREGS_pc]
+        msr ELR_hyp, r11
+        ldr r11, [sp, #UREGS_cpsr]
+        msr SPSR_hyp, r11
+        pop {r0-r12}
+        add sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */
+        eret
 
 /*
  * struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next)
@@ -127,9 +127,15 @@ ENTRY(return_to_hypervisor)
  * Returns prev in r0
  */
 ENTRY(__context_switch)
-	add     ip, r0, #VCPU_arch_saved_context
-	stmia   ip!, {r4 - sl, fp, sp, lr}      /* Save register state */
+        add     ip, r0, #VCPU_arch_saved_context
+        stmia   ip!, {r4 - sl, fp, sp, lr}      /* Save register state */
 
-	add     r4, r1, #VCPU_arch_saved_context
-	ldmia   r4, {r4 - sl, fp, sp, pc}       /* Load registers and return */
+        add     r4, r1, #VCPU_arch_saved_context
+        ldmia   r4, {r4 - sl, fp, sp, pc}       /* Load registers and return */
 
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 32db97a8db86 -r fe36080ff85f xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Wed Dec 19 14:16:27 2012 +0000
+++ b/xen/arch/arm/head.S	Wed Dec 19 14:16:28 2012 +0000
@@ -36,366 +36,366 @@
  * Clobbers r0-r3. */
 #ifdef EARLY_UART_ADDRESS
 #define PRINT(_s)       \
-	adr   r0, 98f ; \
-	bl    puts    ; \
-	b     99f     ; \
-98:	.asciz _s     ; \
-	.align 2      ; \
+        adr   r0, 98f ; \
+        bl    puts    ; \
+        b     99f     ; \
+98:     .asciz _s     ; \
+        .align 2      ; \
 99:
 #else
 #define PRINT(s)
 #endif
 
-	.arm
+        .arm
 
-	/* This must be the very first address in the loaded image.
-	 * It should be linked at XEN_VIRT_START, and loaded at any
-	 * 2MB-aligned address.  All of text+data+bss must fit in 2MB,
-	 * or the initial pagetable code below will need adjustment. */
-	.global start
+        /* This must be the very first address in the loaded image.
+         * It should be linked at XEN_VIRT_START, and loaded at any
+         * 2MB-aligned address.  All of text+data+bss must fit in 2MB,
+         * or the initial pagetable code below will need adjustment. */
+        .global start
 start:
 
-	/* zImage magic header, see:
-	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
-	 */
-	.rept 8
-	mov   r0, r0
-	.endr
-	b     past_zImage
+        /* zImage magic header, see:
+         * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+         */
+        .rept 8
+        mov   r0, r0
+        .endr
+        b     past_zImage
 
-	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
-	.word 0x00000000             /* absolute load/run zImage address or
-	                              * 0 for PiC */
-	.word (_end - start)         /* zImage end address */
+        .word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+        .word 0x00000000             /* absolute load/run zImage address or
+                                      * 0 for PiC */
+        .word (_end - start)         /* zImage end address */
 
 past_zImage:
-	cpsid aif                    /* Disable all interrupts */
+        cpsid aif                    /* Disable all interrupts */
 
-	/* Save the bootloader arguments in less-clobberable registers */
-	mov   r7, r1                 /* r7 := ARM-linux machine type */
-	mov   r8, r2                 /* r8 := ATAG base address */
+        /* Save the bootloader arguments in less-clobberable registers */
+        mov   r7, r1                 /* r7 := ARM-linux machine type */
+        mov   r8, r2                 /* r8 := ATAG base address */
 
-	/* Find out where we are */
-	ldr   r0, =start
-	adr   r9, start              /* r9  := paddr (start) */
-	sub   r10, r9, r0            /* r10 := phys-offset */
+        /* Find out where we are */
+        ldr   r0, =start
+        adr   r9, start              /* r9  := paddr (start) */
+        sub   r10, r9, r0            /* r10 := phys-offset */
 
-	/* Using the DTB in the .dtb section? */
+        /* Using the DTB in the .dtb section? */
 #ifdef CONFIG_DTB_FILE
-	ldr   r8, =_sdtb
-	add   r8, r10                /* r8 := paddr(DTB) */
+        ldr   r8, =_sdtb
+        add   r8, r10                /* r8 := paddr(DTB) */
 #endif
 
-	/* Are we the boot CPU? */
-	mov   r12, #0                /* r12 := CPU ID */
-	mrc   CP32(r0, MPIDR)
-	tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
-	beq   boot_cpu
-	tst   r0, #(1<<30)           /* Uniprocessor system? */
-	bne   boot_cpu
-	bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
-	beq   boot_cpu               /* If we're CPU 0, boot now */
+        /* Are we the boot CPU? */
+        mov   r12, #0                /* r12 := CPU ID */
+        mrc   CP32(r0, MPIDR)
+        tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
+        beq   boot_cpu
+        tst   r0, #(1<<30)           /* Uniprocessor system? */
+        bne   boot_cpu
+        bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
+        beq   boot_cpu               /* If we're CPU 0, boot now */
 
-	/* Non-boot CPUs wait here to be woken up one at a time. */
-1:	dsb
-	ldr   r0, =smp_up_cpu        /* VA of gate */
-	add   r0, r0, r10            /* PA of gate */
-	ldr   r1, [r0]               /* Which CPU is being booted? */
-	teq   r1, r12                /* Is it us? */
-	wfene
-	bne   1b
+        /* Non-boot CPUs wait here to be woken up one at a time. */
+1:      dsb
+        ldr   r0, =smp_up_cpu        /* VA of gate */
+        add   r0, r0, r10            /* PA of gate */
+        ldr   r1, [r0]               /* Which CPU is being booted? */
+        teq   r1, r12                /* Is it us? */
+        wfene
+        bne   1b
 
 boot_cpu:
 #ifdef EARLY_UART_ADDRESS
-	ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
-	teq   r12, #0                   /* CPU 0 sets up the UART too */
-	bleq  init_uart
-	PRINT("- CPU ")
-	mov   r0, r12
-	bl    putn
-	PRINT(" booting -\r\n")
+        ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
+        teq   r12, #0                   /* CPU 0 sets up the UART too */
+        bleq  init_uart
+        PRINT("- CPU ")
+        mov   r0, r12
+        bl    putn
+        PRINT(" booting -\r\n")
 #endif
 
-	/* Wake up secondary cpus */
-	teq   r12, #0
-	bleq  kick_cpus
+        /* Wake up secondary cpus */
+        teq   r12, #0
+        bleq  kick_cpus
 
-	/* Check that this CPU has Hyp mode */
-	mrc   CP32(r0, ID_PFR1)
-	and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
-	teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
-	beq   1f
-	PRINT("- CPU doesn't support the virtualization extensions -\r\n")
-	b     fail
+        /* Check that this CPU has Hyp mode */
+        mrc   CP32(r0, ID_PFR1)
+        and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
+        teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
+        beq   1f
+        PRINT("- CPU doesn't support the virtualization extensions -\r\n")
+        b     fail
 1:
-	/* Check if we're already in it */
-	mrs   r0, cpsr
-	and   r0, r0, #0x1f          /* Mode is in the low 5 bits of CPSR */
-	teq   r0, #0x1a              /* Hyp Mode? */
-	bne   1f
-	PRINT("- Started in Hyp mode -\r\n")
-	b     hyp
+        /* Check if we're already in it */
+        mrs   r0, cpsr
+        and   r0, r0, #0x1f          /* Mode is in the low 5 bits of CPSR */
+        teq   r0, #0x1a              /* Hyp Mode? */
+        bne   1f
+        PRINT("- Started in Hyp mode -\r\n")
+        b     hyp
 1:
-	/* Otherwise, it must have been Secure Supervisor mode */
-	mrc   CP32(r0, SCR)
-	tst   r0, #0x1               /* Not-Secure bit set? */
-	beq   1f
-	PRINT("- CPU is not in Hyp mode or Secure state -\r\n")
-	b     fail
+        /* Otherwise, it must have been Secure Supervisor mode */
+        mrc   CP32(r0, SCR)
+        tst   r0, #0x1               /* Not-Secure bit set? */
+        beq   1f
+        PRINT("- CPU is not in Hyp mode or Secure state -\r\n")
+        b     fail
 1:
-	/* OK, we're in Secure state. */
-	PRINT("- Started in Secure state -\r\n- Entering Hyp mode -\r\n")
-	ldr   r0, =enter_hyp_mode    /* VA of function */
-	adr   lr, hyp                /* Set return address for call */
-	add   pc, r0, r10            /* Call PA of function */
+        /* OK, we're in Secure state. */
+        PRINT("- Started in Secure state -\r\n- Entering Hyp mode -\r\n")
+        ldr   r0, =enter_hyp_mode    /* VA of function */
+        adr   lr, hyp                /* Set return address for call */
+        add   pc, r0, r10            /* Call PA of function */
 
 hyp:
 
-	/* Zero BSS On the boot CPU to avoid nasty surprises */
-	teq   r12, #0
-	bne   skip_bss
+        /* Zero BSS On the boot CPU to avoid nasty surprises */
+        teq   r12, #0
+        bne   skip_bss
 
-	PRINT("- Zero BSS -\r\n")
-	ldr   r0, =__bss_start       /* Load start & end of bss */
-	ldr   r1, =__bss_end
-	add   r0, r0, r10            /* Apply physical offset */
-	add   r1, r1, r10
-	
-	mov   r2, #0
-1:	str   r2, [r0], #4
-	cmp   r0, r1
-	blo   1b
+        PRINT("- Zero BSS -\r\n")
+        ldr   r0, =__bss_start       /* Load start & end of bss */
+        ldr   r1, =__bss_end
+        add   r0, r0, r10            /* Apply physical offset */
+        add   r1, r1, r10
 
-skip_bss:	
+        mov   r2, #0
+1:      str   r2, [r0], #4
+        cmp   r0, r1
+        blo   1b
 
-	PRINT("- Setting up control registers -\r\n")
-	
-	/* Read CPU ID */
-	mrc   CP32(r0, MIDR)
-	ldr   r1, =(MIDR_MASK)
-	and   r0, r0, r1
-	/* Is this a Cortex A15? */
-	ldr   r1, =(CORTEX_A15_ID)
-	teq   r0, r1
-	bleq  cortex_a15_init
+skip_bss:
 
-	/* Set up memory attribute type tables */
-	ldr   r0, =MAIR0VAL
-	ldr   r1, =MAIR1VAL
-	mcr   CP32(r0, MAIR0)
-	mcr   CP32(r1, MAIR1)
-	mcr   CP32(r0, HMAIR0)
-	mcr   CP32(r1, HMAIR1)
+        PRINT("- Setting up control registers -\r\n")
 
-	/* Set up the HTCR:
-	 * PT walks use Outer-Shareable accesses,
-	 * PT walks are write-back, no-write-allocate in both cache levels,
-	 * Full 32-bit address space goes through this table. */
-	ldr   r0, =0x80002500
-	mcr   CP32(r0, HTCR)
+        /* Read CPU ID */
+        mrc   CP32(r0, MIDR)
+        ldr   r1, =(MIDR_MASK)
+        and   r0, r0, r1
+        /* Is this a Cortex A15? */
+        ldr   r1, =(CORTEX_A15_ID)
+        teq   r0, r1
+        bleq  cortex_a15_init
 
-	/* Set up the HSCTLR:
-	 * Exceptions in LE ARM,
-	 * Low-latency IRQs disabled,
-	 * Write-implies-XN disabled (for now),
-	 * D-cache disabled (for now),
-	 * I-cache enabled,
-	 * Alignment checking enabled,
-	 * MMU translation disabled (for now). */
-	ldr   r0, =(HSCTLR_BASE|SCTLR_A)
-	mcr   CP32(r0, HSCTLR)
+        /* Set up memory attribute type tables */
+        ldr   r0, =MAIR0VAL
+        ldr   r1, =MAIR1VAL
+        mcr   CP32(r0, MAIR0)
+        mcr   CP32(r1, MAIR1)
+        mcr   CP32(r0, HMAIR0)
+        mcr   CP32(r1, HMAIR1)
 
-	/* Write Xen's PT's paddr into the HTTBR */
-	ldr   r4, =xen_pgtable
-	add   r4, r4, r10            /* r4 := paddr (xen_pagetable) */
-	mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
-	mcrr  CP64(r4, r5, HTTBR)
+        /* Set up the HTCR:
+         * PT walks use Outer-Shareable accesses,
+         * PT walks are write-back, no-write-allocate in both cache levels,
+         * Full 32-bit address space goes through this table. */
+        ldr   r0, =0x80002500
+        mcr   CP32(r0, HTCR)
 
-	/* Non-boot CPUs don't need to rebuild the pagetable */
-	teq   r12, #0
-	bne   pt_ready
-	
-	/* console fixmap */
+        /* Set up the HSCTLR:
+         * Exceptions in LE ARM,
+         * Low-latency IRQs disabled,
+         * Write-implies-XN disabled (for now),
+         * D-cache disabled (for now),
+         * I-cache enabled,
+         * Alignment checking enabled,
+         * MMU translation disabled (for now). */
+        ldr   r0, =(HSCTLR_BASE|SCTLR_A)
+        mcr   CP32(r0, HSCTLR)
+
+        /* Write Xen's PT's paddr into the HTTBR */
+        ldr   r4, =xen_pgtable
+        add   r4, r4, r10            /* r4 := paddr (xen_pagetable) */
+        mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
+        mcrr  CP64(r4, r5, HTTBR)
+
+        /* Non-boot CPUs don't need to rebuild the pagetable */
+        teq   r12, #0
+        bne   pt_ready
+
+        /* console fixmap */
 #ifdef EARLY_UART_ADDRESS
-	ldr   r1, =xen_fixmap
-	add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
-	mov   r3, #0
-	lsr   r2, r11, #12
-	lsl   r2, r2, #12            /* 4K aligned paddr of UART */
-	orr   r2, r2, #PT_UPPER(DEV_L3)
-	orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
-	strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
+        ldr   r1, =xen_fixmap
+        add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
+        mov   r3, #0
+        lsr   r2, r11, #12
+        lsl   r2, r2, #12            /* 4K aligned paddr of UART */
+        orr   r2, r2, #PT_UPPER(DEV_L3)
+        orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
+        strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
 #endif
 
-	/* Build the baseline idle pagetable's first-level entries */
-	ldr   r1, =xen_second
-	add   r1, r1, r10            /* r1 := paddr (xen_second) */
-	mov   r3, #0x0
-	orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 := table map of xen_second */
-	orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
-	strd  r2, r3, [r4, #0]       /* Map it in slot 0 */
-	add   r2, r2, #0x1000
-	strd  r2, r3, [r4, #8]       /* Map 2nd page in slot 1 */
-	add   r2, r2, #0x1000
-	strd  r2, r3, [r4, #16]      /* Map 3rd page in slot 2 */
-	add   r2, r2, #0x1000
-	strd  r2, r3, [r4, #24]      /* Map 4th page in slot 3 */
+        /* Build the baseline idle pagetable's first-level entries */
+        ldr   r1, =xen_second
+        add   r1, r1, r10            /* r1 := paddr (xen_second) */
+        mov   r3, #0x0
+        orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 := table map of xen_second */
+        orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
+        strd  r2, r3, [r4, #0]       /* Map it in slot 0 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #8]       /* Map 2nd page in slot 1 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #16]      /* Map 3rd page in slot 2 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #24]      /* Map 4th page in slot 3 */
 
-	/* Now set up the second-level entries */
-	orr   r2, r9, #PT_UPPER(MEM)
-	orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB normal map of Xen */
-	mov   r4, r9, lsr #18        /* Slot for paddr(start) */
-	strd  r2, r3, [r1, r4]       /* Map Xen there */
-	ldr   r4, =start
-	lsr   r4, #18                /* Slot for vaddr(start) */
-	strd  r2, r3, [r1, r4]       /* Map Xen there too */
+        /* Now set up the second-level entries */
+        orr   r2, r9, #PT_UPPER(MEM)
+        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB normal map of Xen */
+        mov   r4, r9, lsr #18        /* Slot for paddr(start) */
+        strd  r2, r3, [r1, r4]       /* Map Xen there */
+        ldr   r4, =start
+        lsr   r4, #18                /* Slot for vaddr(start) */
+        strd  r2, r3, [r1, r4]       /* Map Xen there too */
 
-	/* xen_fixmap pagetable */
-	ldr   r2, =xen_fixmap
-	add   r2, r2, r10            /* r2 := paddr (xen_fixmap) */
-	orr   r2, r2, #PT_UPPER(PT)
-	orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 := table map of xen_fixmap */
-	add   r4, r4, #8
-	strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
+        /* xen_fixmap pagetable */
+        ldr   r2, =xen_fixmap
+        add   r2, r2, r10            /* r2 := paddr (xen_fixmap) */
+        orr   r2, r2, #PT_UPPER(PT)
+        orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 := table map of xen_fixmap */
+        add   r4, r4, #8
+        strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
 
-	mov   r3, #0x0
-	lsr   r2, r8, #21
-	lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
-	orr   r2, r2, #PT_UPPER(MEM)
-	orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB RAM incl. DTB */
-	add   r4, r4, #8
-	strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
+        mov   r3, #0x0
+        lsr   r2, r8, #21
+        lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
+        orr   r2, r2, #PT_UPPER(MEM)
+        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB RAM incl. DTB */
+        add   r4, r4, #8
+        strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
 
 pt_ready:
-	PRINT("- Turning on paging -\r\n")
+        PRINT("- Turning on paging -\r\n")
 
-	ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
-	mrc   CP32(r0, HSCTLR)
-	orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
-	dsb                          /* Flush PTE writes and finish reads */
-	mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
-	isb                          /* Now, flush the icache */
-	mov   pc, r1                 /* Get a proper vaddr into PC */
+        ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
+        mrc   CP32(r0, HSCTLR)
+        orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
+        dsb                          /* Flush PTE writes and finish reads */
+        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
+        isb                          /* Now, flush the icache */
+        mov   pc, r1                 /* Get a proper vaddr into PC */
 paging:
 
 
 #ifdef EARLY_UART_ADDRESS
-	/* Use a virtual address to access the UART. */
-	ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+        /* Use a virtual address to access the UART. */
+        ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
 #endif
 
-	PRINT("- Ready -\r\n")
+        PRINT("- Ready -\r\n")
 
-	/* The boot CPU should go straight into C now */
-	teq   r12, #0
-	beq   launch
+        /* The boot CPU should go straight into C now */
+        teq   r12, #0
+        beq   launch
 
-	/* Non-boot CPUs need to move on to the relocated pagetables */
-	mov   r0, #0
-	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
-	add   r4, r4, r10            /* PA of it */
-	ldrd  r4, r5, [r4]           /* Actual value */
-	dsb
-	mcrr  CP64(r4, r5, HTTBR)
-	dsb
-	isb
-	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
-	mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
-	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
-	dsb                          /* Ensure completion of TLB+BP flush */
-	isb
+        /* Non-boot CPUs need to move on to the relocated pagetables */
+        mov   r0, #0
+        ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
+        add   r4, r4, r10            /* PA of it */
+        ldrd  r4, r5, [r4]           /* Actual value */
+        dsb
+        mcrr  CP64(r4, r5, HTTBR)
+        dsb
+        isb
+        mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+        mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
+        mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
+        dsb                          /* Ensure completion of TLB+BP flush */
+        isb
 
-	/* Non-boot CPUs report that they've got this far */
-	ldr   r0, =ready_cpus
-1:	ldrex r1, [r0]               /*            { read # of ready CPUs } */
-	add   r1, r1, #1             /* Atomically { ++                   } */
-	strex r2, r1, [r0]           /*            { writeback            } */
-	teq   r2, #0
-	bne   1b
-	dsb
-	mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
-	dsb
+        /* Non-boot CPUs report that they've got this far */
+        ldr   r0, =ready_cpus
+1:      ldrex r1, [r0]               /*            { read # of ready CPUs } */
+        add   r1, r1, #1             /* Atomically { ++                   } */
+        strex r2, r1, [r0]           /*            { writeback            } */
+        teq   r2, #0
+        bne   1b
+        dsb
+        mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
+        dsb
 
-	/* Here, the non-boot CPUs must wait again -- they're now running on
-	 * the boot CPU's pagetables so it's safe for the boot CPU to
-	 * overwrite the non-relocated copy of Xen.  Once it's done that,
-	 * and brought up the memory allocator, non-boot CPUs can get their
-	 * own stacks and enter C. */
-1:	wfe
-	dsb
-	ldr   r0, =smp_up_cpu
-	ldr   r1, [r0]               /* Which CPU is being booted? */
-	teq   r1, r12                /* Is it us? */
-	bne   1b
+        /* Here, the non-boot CPUs must wait again -- they're now running on
+         * the boot CPU's pagetables so it's safe for the boot CPU to
+         * overwrite the non-relocated copy of Xen.  Once it's done that,
+         * and brought up the memory allocator, non-boot CPUs can get their
+         * own stacks and enter C. */
+1:      wfe
+        dsb
+        ldr   r0, =smp_up_cpu
+        ldr   r1, [r0]               /* Which CPU is being booted? */
+        teq   r1, r12                /* Is it us? */
+        bne   1b
 
-launch:	
-	ldr   r0, =init_stack        /* Find the boot-time stack */
-	ldr   sp, [r0]
-	add   sp, #STACK_SIZE        /* (which grows down from the top). */
-	sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
-	mov   r0, r10                /* Marshal args: - phys_offset */
-	mov   r1, r7                 /*               - machine type */
-	mov   r2, r8                 /*               - ATAG address */
-	movs  r3, r12                /*               - CPU ID */
-	beq   start_xen              /* and disappear into the land of C */
-	b     start_secondary        /* (to the appropriate entry point) */
+launch:
+        ldr   r0, =init_stack        /* Find the boot-time stack */
+        ldr   sp, [r0]
+        add   sp, #STACK_SIZE        /* (which grows down from the top). */
+        sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
+        mov   r0, r10                /* Marshal args: - phys_offset */
+        mov   r1, r7                 /*               - machine type */
+        mov   r2, r8                 /*               - ATAG address */
+        movs  r3, r12                /*               - CPU ID */
+        beq   start_xen              /* and disappear into the land of C */
+        b     start_secondary        /* (to the appropriate entry point) */
 
 /* Fail-stop
  * r0: string explaining why */
-fail:	PRINT("- Boot failed -\r\n")
-1:	wfe
-	b     1b
+fail:   PRINT("- Boot failed -\r\n")
+1:      wfe
+        b     1b
 
 #ifdef EARLY_UART_ADDRESS
 
 /* Bring up the UART. Specific to the PL011 UART.
  * Clobbers r0-r2 */
 init_uart:
-	mov   r1, #0x0
-	str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor fraction) */
-	mov   r1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
-	str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor integer) */
-	mov   r1, #0x60              /* 8n1 */
-	str   r1, [r11, #0x24]       /* -> UARTLCR_H (Line control) */
-	ldr   r1, =0x00000301        /* RXE | TXE | UARTEN */
-	str   r1, [r11, #0x30]       /* -> UARTCR (Control Register) */
-	adr   r0, 1f
-	b     puts
-1:	.asciz "- UART enabled -\r\n"
-	.align 4
+        mov   r1, #0x0
+        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor fraction) */
+        mov   r1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
+        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor integer) */
+        mov   r1, #0x60              /* 8n1 */
+        str   r1, [r11, #0x24]       /* -> UARTLCR_H (Line control) */
+        ldr   r1, =0x00000301        /* RXE | TXE | UARTEN */
+        str   r1, [r11, #0x30]       /* -> UARTCR (Control Register) */
+        adr   r0, 1f
+        b     puts
+1:      .asciz "- UART enabled -\r\n"
+        .align 4
 
 /* Print early debug messages.  Specific to the PL011 UART.
  * r0: Nul-terminated string to print.
  * Clobbers r0-r2 */
 puts:
-	ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
-	tst   r2, #0x8               /* Check BUSY bit */
-	bne   puts                   /* Wait for the UART to be ready */
-	ldrb  r2, [r0], #1           /* Load next char */
-	teq   r2, #0                 /* Exit on nul */
-	moveq pc, lr
-	str   r2, [r11]              /* -> UARTDR (Data Register) */
-	b     puts
+        ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
+        tst   r2, #0x8               /* Check BUSY bit */
+        bne   puts                   /* Wait for the UART to be ready */
+        ldrb  r2, [r0], #1           /* Load next char */
+        teq   r2, #0                 /* Exit on nul */
+        moveq pc, lr
+        str   r2, [r11]              /* -> UARTDR (Data Register) */
+        b     puts
 
 /* Print a 32-bit number in hex.  Specific to the PL011 UART.
  * r0: Number to print.
  * clobbers r0-r3 */
 putn:
-	adr   r1, hex
-	mov   r3, #8
-1:	ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
-	tst   r2, #0x8               /* Check BUSY bit */
-	bne   1b                     /* Wait for the UART to be ready */
-	and   r2, r0, #0xf0000000    /* Mask off the top nybble */
-	ldrb  r2, [r1, r2, lsr #28]  /* Convert to a char */
-	str   r2, [r11]              /* -> UARTDR (Data Register) */
-	lsl   r0, #4                 /* Roll it through one nybble at a time */
-	subs  r3, r3, #1
-	bne   1b
-	mov   pc, lr
+        adr   r1, hex
+        mov   r3, #8
+1:      ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
+        tst   r2, #0x8               /* Check BUSY bit */
+        bne   1b                     /* Wait for the UART to be ready */
+        and   r2, r0, #0xf0000000    /* Mask off the top nybble */
+        ldrb  r2, [r1, r2, lsr #28]  /* Convert to a char */
+        str   r2, [r11]              /* -> UARTDR (Data Register) */
+        lsl   r0, #4                 /* Roll it through one nybble at a time */
+        subs  r3, r3, #1
+        bne   1b
+        mov   pc, lr
 
-hex:	.ascii "0123456789abcdef"
-	.align 2
+hex:    .ascii "0123456789abcdef"
+        .align 2
 
 #else  /* EARLY_UART_ADDRESS */
 
@@ -403,6 +403,13 @@ init_uart:
 .global early_puts
 early_puts:
 puts:
-putn:	mov   pc, lr
+putn:   mov   pc, lr
 
 #endif /* EARLY_UART_ADDRESS */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 32db97a8db86 -r fe36080ff85f xen/arch/arm/mode_switch.S
--- a/xen/arch/arm/mode_switch.S	Wed Dec 19 14:16:27 2012 +0000
+++ b/xen/arch/arm/mode_switch.S	Wed Dec 19 14:16:28 2012 +0000
@@ -28,25 +28,25 @@
 /* wake up secondary cpus */
 .globl kick_cpus
 kick_cpus:
-	/* write start paddr to v2m sysreg FLAGSSET register */
-	ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
-	dsb
-	mov   r2, #0xffffffff
-	str   r2, [r0, #(V2M_SYS_FLAGSCLR)]
-	dsb
-	ldr   r2, =start
-	add   r2, r2, r10
-	str   r2, [r0, #(V2M_SYS_FLAGSSET)]
-	dsb
-	/* send an interrupt */
-	ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
-	mov   r2, #0x1
-	str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
-	mov   r2, #0xfe0000
-	str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
-	dsb
-	str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
-	mov   pc, lr
+        /* write start paddr to v2m sysreg FLAGSSET register */
+        ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
+        dsb
+        mov   r2, #0xffffffff
+        str   r2, [r0, #(V2M_SYS_FLAGSCLR)]
+        dsb
+        ldr   r2, =start
+        add   r2, r2, r10
+        str   r2, [r0, #(V2M_SYS_FLAGSSET)]
+        dsb
+        /* send an interrupt */
+        ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
+        mov   r2, #0x1
+        str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
+        mov   r2, #0xfe0000
+        str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
+        dsb
+        str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
+        mov   pc, lr
 
 
 /* Get up a CPU into Hyp mode.  Clobbers r0-r3.
@@ -61,54 +61,61 @@ kick_cpus:
 
 .globl enter_hyp_mode
 enter_hyp_mode:
-	mov   r3, lr                 /* Put return address in non-banked reg */
-	cpsid aif, #0x16             /* Enter Monitor mode */
-	mrc   CP32(r0, SCR)
-	orr   r0, r0, #0x100         /* Set HCE */
-	orr   r0, r0, #0xb1          /* Set SCD, AW, FW and NS */
-	bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
-	mcr   CP32(r0, SCR)
-	/* Ugly: the system timer's frequency register is only
-	 * programmable in Secure state.  Since we don't know where its
-	 * memory-mapped control registers live, we can't find out the
-	 * right frequency.  Use the VE model's default frequency here. */
-	ldr   r0, =0x5f5e100         /* 100 MHz */
-	mcr   CP32(r0, CNTFRQ)
-	ldr   r0, =0x40c00           /* SMP, c11, c10 in non-secure mode */
-	mcr   CP32(r0, NSACR)
-	mov   r0, #GIC_BASE_ADDRESS
-	add   r0, r0, #GIC_DR_OFFSET
-	/* Disable the GIC distributor, on the boot CPU only */
-	mov   r1, #0
-	teq   r12, #0                /* Is this the boot CPU? */
-	streq r1, [r0]
-	/* Continuing ugliness: Set up the GIC so NS state owns interrupts,
-	 * The first 32 interrupts (SGIs & PPIs) must be configured on all
-	 * CPUs while the remainder are SPIs and only need to be done one, on
-	 * the boot CPU. */
-	add   r0, r0, #0x80          /* GICD_IGROUP0 */
-	mov   r2, #0xffffffff        /* All interrupts to group 1 */
-	teq   r12, #0                /* Boot CPU? */
-	str   r2, [r0]               /* Interrupts  0-31 (SGI & PPI) */
-	streq r2, [r0, #4]           /* Interrupts 32-63 (SPI) */
-	streq r2, [r0, #8]           /* Interrupts 64-95 (SPI) */
-	/* Disable the GIC CPU interface on all processors */
-	mov   r0, #GIC_BASE_ADDRESS
-	add   r0, r0, #GIC_CR_OFFSET
-	mov   r1, #0
-	str   r1, [r0]
-	/* Must drop priority mask below 0x80 before entering NS state */
-	ldr   r1, =0xff
-	str   r1, [r0, #0x4]         /* -> GICC_PMR */
-	/* Reset a few config registers */
-	mov   r0, #0
-	mcr   CP32(r0, FCSEIDR)
-	mcr   CP32(r0, CONTEXTIDR)
-	/* Allow non-secure access to coprocessors, FIQs, VFP and NEON */
-	ldr   r1, =0x3fff            /* 14 CP bits set, all others clear */
-	mcr   CP32(r1, NSACR)
+        mov   r3, lr                 /* Put return address in non-banked reg */
+        cpsid aif, #0x16             /* Enter Monitor mode */
+        mrc   CP32(r0, SCR)
+        orr   r0, r0, #0x100         /* Set HCE */
+        orr   r0, r0, #0xb1          /* Set SCD, AW, FW and NS */
+        bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
+        mcr   CP32(r0, SCR)
+        /* Ugly: the system timer's frequency register is only
+         * programmable in Secure state.  Since we don't know where its
+         * memory-mapped control registers live, we can't find out the
+         * right frequency.  Use the VE model's default frequency here. */
+        ldr   r0, =0x5f5e100         /* 100 MHz */
+        mcr   CP32(r0, CNTFRQ)
+        ldr   r0, =0x40c00           /* SMP, c11, c10 in non-secure mode */
+        mcr   CP32(r0, NSACR)
+        mov   r0, #GIC_BASE_ADDRESS
+        add   r0, r0, #GIC_DR_OFFSET
+        /* Disable the GIC distributor, on the boot CPU only */
+        mov   r1, #0
+        teq   r12, #0                /* Is this the boot CPU? */
+        streq r1, [r0]
+        /* Continuing ugliness: Set up the GIC so NS state owns interrupts,
+         * The first 32 interrupts (SGIs & PPIs) must be configured on all
+         * CPUs while the remainder are SPIs and only need to be done one, on
+         * the boot CPU. */
+        add   r0, r0, #0x80          /* GICD_IGROUP0 */
+        mov   r2, #0xffffffff        /* All interrupts to group 1 */
+        teq   r12, #0                /* Boot CPU? */
+        str   r2, [r0]               /* Interrupts  0-31 (SGI & PPI) */
+        streq r2, [r0, #4]           /* Interrupts 32-63 (SPI) */
+        streq r2, [r0, #8]           /* Interrupts 64-95 (SPI) */
+        /* Disable the GIC CPU interface on all processors */
+        mov   r0, #GIC_BASE_ADDRESS
+        add   r0, r0, #GIC_CR_OFFSET
+        mov   r1, #0
+        str   r1, [r0]
+        /* Must drop priority mask below 0x80 before entering NS state */
+        ldr   r1, =0xff
+        str   r1, [r0, #0x4]         /* -> GICC_PMR */
+        /* Reset a few config registers */
+        mov   r0, #0
+        mcr   CP32(r0, FCSEIDR)
+        mcr   CP32(r0, CONTEXTIDR)
+        /* Allow non-secure access to coprocessors, FIQs, VFP and NEON */
+        ldr   r1, =0x3fff            /* 14 CP bits set, all others clear */
+        mcr   CP32(r1, NSACR)
 
-	mrs   r0, cpsr               /* Copy the CPSR */
-	add   r0, r0, #0x4           /* 0x16 (Monitor) -> 0x1a (Hyp) */
-	msr   spsr_cxsf, r0          /* into the SPSR */
-	movs  pc, r3                 /* Exception-return into Hyp mode */
+        mrs   r0, cpsr               /* Copy the CPSR */
+        add   r0, r0, #0x4           /* 0x16 (Monitor) -> 0x1a (Hyp) */
+        msr   spsr_cxsf, r0          /* into the SPSR */
+        movs  pc, r3                 /* Exception-return into Hyp mode */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 32db97a8db86 -r fe36080ff85f xen/arch/arm/proc-ca15.S
--- a/xen/arch/arm/proc-ca15.S	Wed Dec 19 14:16:27 2012 +0000
+++ b/xen/arch/arm/proc-ca15.S	Wed Dec 19 14:16:28 2012 +0000
@@ -21,8 +21,15 @@
 
 .globl cortex_a15_init
 cortex_a15_init:
-	/* Set up the SMP bit in ACTLR */
-	mrc   CP32(r0, ACTLR)
-	orr   r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit*/
-	mcr   CP32(r0, ACTLR)
-	mov   pc, lr
+        /* Set up the SMP bit in ACTLR */
+        mrc   CP32(r0, ACTLR)
+        orr   r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit */
+        mcr   CP32(r0, ACTLR)
+        mov   pc, lr
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiR-00076u-Qj; Thu, 20 Dec 2012 16:11:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiQ-00073o-7O
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:22 +0000
Received: from [85.158.143.99:6760] by server-3.bemta-4.messagelabs.com id
	15/F0-18211-9A833D05; Thu, 20 Dec 2012 16:11:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1356019878!25171341!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3427 invoked from network); 20 Dec 2012 16:11:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-0005ft-Ca
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-0006Bz-Ax
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Message-Id: <E1TliiM-0006Bz-Ax@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: remove hard tabs from asm
	code.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926588 0
# Node ID fe36080ff85f727fd0de87a8fd264892d41b8c9c
# Parent  32db97a8db862a89519495ef8f1f1c5eb48d48a2
xen: arm: remove hard tabs from asm code.

Run expand(1) over xen/arch/arm/.../*.S

Add emacs local vars block.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ijc -- stripped trailing whitespace caught by git apply]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 32db97a8db86 -r fe36080ff85f xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S	Wed Dec 19 14:16:27 2012 +0000
+++ b/xen/arch/arm/entry.S	Wed Dec 19 14:16:28 2012 +0000
@@ -2,79 +2,79 @@
 #include <asm/asm_defns.h>
 #include <public/xen.h>
 
-#define SAVE_ONE_BANKED(reg)	mrs r11, reg; str r11, [sp, #UREGS_##reg]
-#define RESTORE_ONE_BANKED(reg)	ldr r11, [sp, #UREGS_##reg]; msr reg, r11
+#define SAVE_ONE_BANKED(reg)    mrs r11, reg; str r11, [sp, #UREGS_##reg]
+#define RESTORE_ONE_BANKED(reg) ldr r11, [sp, #UREGS_##reg]; msr reg, r11
 
 #define SAVE_BANKED(mode) \
-	SAVE_ONE_BANKED(SP_##mode) ; SAVE_ONE_BANKED(LR_##mode) ; SAVE_ONE_BANKED(SPSR_##mode)
+        SAVE_ONE_BANKED(SP_##mode) ; SAVE_ONE_BANKED(LR_##mode) ; SAVE_ONE_BANKED(SPSR_##mode)
 
 #define RESTORE_BANKED(mode) \
-	RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
+        RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
 
-#define SAVE_ALL							\
-	sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */	\
-	push {r0-r12}; /* Save R0-R12 */				\
-									\
-	mrs r11, ELR_hyp;		/* ELR_hyp is return address. */\
-	str r11, [sp, #UREGS_pc];					\
-									\
-	str lr, [sp, #UREGS_lr];					\
-									\
-	add r11, sp, #UREGS_kernel_sizeof+4;				\
-	str r11, [sp, #UREGS_sp];					\
-									\
-	mrs r11, SPSR_hyp;						\
-	str r11, [sp, #UREGS_cpsr];					\
-	and r11, #PSR_MODE_MASK;					\
-	cmp r11, #PSR_MODE_HYP;						\
-	blne save_guest_regs
+#define SAVE_ALL                                                        \
+        sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */      \
+        push {r0-r12}; /* Save R0-R12 */                                \
+                                                                        \
+        mrs r11, ELR_hyp;               /* ELR_hyp is return address. */\
+        str r11, [sp, #UREGS_pc];                                       \
+                                                                        \
+        str lr, [sp, #UREGS_lr];                                        \
+                                                                        \
+        add r11, sp, #UREGS_kernel_sizeof+4;                            \
+        str r11, [sp, #UREGS_sp];                                       \
+                                                                        \
+        mrs r11, SPSR_hyp;                                              \
+        str r11, [sp, #UREGS_cpsr];                                     \
+        and r11, #PSR_MODE_MASK;                                        \
+        cmp r11, #PSR_MODE_HYP;                                         \
+        blne save_guest_regs
 
 save_guest_regs:
-	ldr r11, =0xffffffff  /* Clobber SP which is only valid for hypervisor frames. */
-	str r11, [sp, #UREGS_sp]
-	SAVE_ONE_BANKED(SP_usr)
-	/* LR_usr is the same physical register as lr and is saved in SAVE_ALL */
-	SAVE_BANKED(svc)
-	SAVE_BANKED(abt)
-	SAVE_BANKED(und)
-	SAVE_BANKED(irq)
-	SAVE_BANKED(fiq)
-	SAVE_ONE_BANKED(R8_fiq); SAVE_ONE_BANKED(R9_fiq); SAVE_ONE_BANKED(R10_fiq)
-	SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
-	mov pc, lr
+        ldr r11, =0xffffffff  /* Clobber SP which is only valid for hypervisor frames. */
+        str r11, [sp, #UREGS_sp]
+        SAVE_ONE_BANKED(SP_usr)
+        /* LR_usr is the same physical register as lr and is saved in SAVE_ALL */
+        SAVE_BANKED(svc)
+        SAVE_BANKED(abt)
+        SAVE_BANKED(und)
+        SAVE_BANKED(irq)
+        SAVE_BANKED(fiq)
+        SAVE_ONE_BANKED(R8_fiq); SAVE_ONE_BANKED(R9_fiq); SAVE_ONE_BANKED(R10_fiq)
+        SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
+        mov pc, lr
 
-#define DEFINE_TRAP_ENTRY(trap)						\
-	ALIGN;								\
-trap_##trap:								\
-	SAVE_ALL;							\
-	cpsie i; 	/* local_irq_enable */				\
-	adr lr, return_from_trap;					\
-	mov r0, sp;							\
-	mov r11, sp;							\
-	bic sp, #7; /* Align the stack pointer (noop on guest trap) */	\
-	b do_trap_##trap
+#define DEFINE_TRAP_ENTRY(trap)                                         \
+        ALIGN;                                                          \
+trap_##trap:                                                            \
+        SAVE_ALL;                                                       \
+        cpsie i;        /* local_irq_enable */                          \
+        adr lr, return_from_trap;                                       \
+        mov r0, sp;                                                     \
+        mov r11, sp;                                                    \
+        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
+        b do_trap_##trap
 
-#define DEFINE_TRAP_ENTRY_NOIRQ(trap)					\
-	ALIGN;								\
-trap_##trap:								\
-	SAVE_ALL;							\
-	adr lr, return_from_trap;					\
-	mov r0, sp;							\
-	mov r11, sp;							\
-	bic sp, #7; /* Align the stack pointer (noop on guest trap) */	\
-	b do_trap_##trap
+#define DEFINE_TRAP_ENTRY_NOIRQ(trap)                                   \
+        ALIGN;                                                          \
+trap_##trap:                                                            \
+        SAVE_ALL;                                                       \
+        adr lr, return_from_trap;                                       \
+        mov r0, sp;                                                     \
+        mov r11, sp;                                                    \
+        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
+        b do_trap_##trap
 
 .globl hyp_traps_vector
-	.align 5
+        .align 5
 hyp_traps_vector:
-	.word 0				/* 0x00 - Reset */
-	b trap_undefined_instruction	/* 0x04 - Undefined Instruction */
-	b trap_supervisor_call		/* 0x08 - Supervisor Call */
-	b trap_prefetch_abort		/* 0x0c - Prefetch Abort */
-	b trap_data_abort		/* 0x10 - Data Abort */
-	b trap_hypervisor		/* 0x14 - Hypervisor */
-	b trap_irq			/* 0x18 - IRQ */
-	b trap_fiq			/* 0x1c - FIQ */
+        .word 0                         /* 0x00 - Reset */
+        b trap_undefined_instruction    /* 0x04 - Undefined Instruction */
+        b trap_supervisor_call          /* 0x08 - Supervisor Call */
+        b trap_prefetch_abort           /* 0x0c - Prefetch Abort */
+        b trap_data_abort               /* 0x10 - Data Abort */
+        b trap_hypervisor               /* 0x14 - Hypervisor */
+        b trap_irq                      /* 0x18 - IRQ */
+        b trap_fiq                      /* 0x1c - FIQ */
 
 DEFINE_TRAP_ENTRY(undefined_instruction)
 DEFINE_TRAP_ENTRY(supervisor_call)
@@ -85,38 +85,38 @@ DEFINE_TRAP_ENTRY_NOIRQ(irq)
 DEFINE_TRAP_ENTRY_NOIRQ(fiq)
 
 return_from_trap:
-	mov sp, r11
+        mov sp, r11
 ENTRY(return_to_new_vcpu)
-	ldr r11, [sp, #UREGS_cpsr]
-	and r11, #PSR_MODE_MASK
-	cmp r11, #PSR_MODE_HYP
-	beq return_to_hypervisor
-	/* Fall thru */
+        ldr r11, [sp, #UREGS_cpsr]
+        and r11, #PSR_MODE_MASK
+        cmp r11, #PSR_MODE_HYP
+        beq return_to_hypervisor
+        /* Fall thru */
 ENTRY(return_to_guest)
-	mov r11, sp
-	bic sp, #7 /* Align the stack pointer */
-	bl leave_hypervisor_tail /* Disables interrupts on return */
-	mov sp, r11
-	RESTORE_ONE_BANKED(SP_usr)
-	/* LR_usr is the same physical register as lr and is restored below */
-	RESTORE_BANKED(svc)
-	RESTORE_BANKED(abt)
-	RESTORE_BANKED(und)
-	RESTORE_BANKED(irq)
-	RESTORE_BANKED(fiq)
-	RESTORE_ONE_BANKED(R8_fiq); RESTORE_ONE_BANKED(R9_fiq); RESTORE_ONE_BANKED(R10_fiq)
-	RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq);
-	/* Fall thru */
+        mov r11, sp
+        bic sp, #7 /* Align the stack pointer */
+        bl leave_hypervisor_tail /* Disables interrupts on return */
+        mov sp, r11
+        RESTORE_ONE_BANKED(SP_usr)
+        /* LR_usr is the same physical register as lr and is restored below */
+        RESTORE_BANKED(svc)
+        RESTORE_BANKED(abt)
+        RESTORE_BANKED(und)
+        RESTORE_BANKED(irq)
+        RESTORE_BANKED(fiq)
+        RESTORE_ONE_BANKED(R8_fiq); RESTORE_ONE_BANKED(R9_fiq); RESTORE_ONE_BANKED(R10_fiq)
+        RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq);
+        /* Fall thru */
 ENTRY(return_to_hypervisor)
-	cpsid i
-	ldr lr, [sp, #UREGS_lr]
-	ldr r11, [sp, #UREGS_pc]
-	msr ELR_hyp, r11
-	ldr r11, [sp, #UREGS_cpsr]
-	msr SPSR_hyp, r11
-	pop {r0-r12}
-	add sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */
-	eret
+        cpsid i
+        ldr lr, [sp, #UREGS_lr]
+        ldr r11, [sp, #UREGS_pc]
+        msr ELR_hyp, r11
+        ldr r11, [sp, #UREGS_cpsr]
+        msr SPSR_hyp, r11
+        pop {r0-r12}
+        add sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */
+        eret
 
 /*
  * struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next)
@@ -127,9 +127,15 @@ ENTRY(return_to_hypervisor)
  * Returns prev in r0
  */
 ENTRY(__context_switch)
-	add     ip, r0, #VCPU_arch_saved_context
-	stmia   ip!, {r4 - sl, fp, sp, lr}      /* Save register state */
+        add     ip, r0, #VCPU_arch_saved_context
+        stmia   ip!, {r4 - sl, fp, sp, lr}      /* Save register state */
 
-	add     r4, r1, #VCPU_arch_saved_context
-	ldmia   r4, {r4 - sl, fp, sp, pc}       /* Load registers and return */
+        add     r4, r1, #VCPU_arch_saved_context
+        ldmia   r4, {r4 - sl, fp, sp, pc}       /* Load registers and return */
 
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 32db97a8db86 -r fe36080ff85f xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Wed Dec 19 14:16:27 2012 +0000
+++ b/xen/arch/arm/head.S	Wed Dec 19 14:16:28 2012 +0000
@@ -36,366 +36,366 @@
  * Clobbers r0-r3. */
 #ifdef EARLY_UART_ADDRESS
 #define PRINT(_s)       \
-	adr   r0, 98f ; \
-	bl    puts    ; \
-	b     99f     ; \
-98:	.asciz _s     ; \
-	.align 2      ; \
+        adr   r0, 98f ; \
+        bl    puts    ; \
+        b     99f     ; \
+98:     .asciz _s     ; \
+        .align 2      ; \
 99:
 #else
 #define PRINT(s)
 #endif
 
-	.arm
+        .arm
 
-	/* This must be the very first address in the loaded image.
-	 * It should be linked at XEN_VIRT_START, and loaded at any
-	 * 2MB-aligned address.  All of text+data+bss must fit in 2MB,
-	 * or the initial pagetable code below will need adjustment. */
-	.global start
+        /* This must be the very first address in the loaded image.
+         * It should be linked at XEN_VIRT_START, and loaded at any
+         * 2MB-aligned address.  All of text+data+bss must fit in 2MB,
+         * or the initial pagetable code below will need adjustment. */
+        .global start
 start:
 
-	/* zImage magic header, see:
-	 * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
-	 */
-	.rept 8
-	mov   r0, r0
-	.endr
-	b     past_zImage
+        /* zImage magic header, see:
+         * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+         */
+        .rept 8
+        mov   r0, r0
+        .endr
+        b     past_zImage
 
-	.word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
-	.word 0x00000000             /* absolute load/run zImage address or
-	                              * 0 for PiC */
-	.word (_end - start)         /* zImage end address */
+        .word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+        .word 0x00000000             /* absolute load/run zImage address or
+                                      * 0 for PiC */
+        .word (_end - start)         /* zImage end address */
 
 past_zImage:
-	cpsid aif                    /* Disable all interrupts */
+        cpsid aif                    /* Disable all interrupts */
 
-	/* Save the bootloader arguments in less-clobberable registers */
-	mov   r7, r1                 /* r7 := ARM-linux machine type */
-	mov   r8, r2                 /* r8 := ATAG base address */
+        /* Save the bootloader arguments in less-clobberable registers */
+        mov   r7, r1                 /* r7 := ARM-linux machine type */
+        mov   r8, r2                 /* r8 := ATAG base address */
 
-	/* Find out where we are */
-	ldr   r0, =start
-	adr   r9, start              /* r9  := paddr (start) */
-	sub   r10, r9, r0            /* r10 := phys-offset */
+        /* Find out where we are */
+        ldr   r0, =start
+        adr   r9, start              /* r9  := paddr (start) */
+        sub   r10, r9, r0            /* r10 := phys-offset */
 
-	/* Using the DTB in the .dtb section? */
+        /* Using the DTB in the .dtb section? */
 #ifdef CONFIG_DTB_FILE
-	ldr   r8, =_sdtb
-	add   r8, r10                /* r8 := paddr(DTB) */
+        ldr   r8, =_sdtb
+        add   r8, r10                /* r8 := paddr(DTB) */
 #endif
 
-	/* Are we the boot CPU? */
-	mov   r12, #0                /* r12 := CPU ID */
-	mrc   CP32(r0, MPIDR)
-	tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
-	beq   boot_cpu
-	tst   r0, #(1<<30)           /* Uniprocessor system? */
-	bne   boot_cpu
-	bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
-	beq   boot_cpu               /* If we're CPU 0, boot now */
+        /* Are we the boot CPU? */
+        mov   r12, #0                /* r12 := CPU ID */
+        mrc   CP32(r0, MPIDR)
+        tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
+        beq   boot_cpu
+        tst   r0, #(1<<30)           /* Uniprocessor system? */
+        bne   boot_cpu
+        bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
+        beq   boot_cpu               /* If we're CPU 0, boot now */
 
-	/* Non-boot CPUs wait here to be woken up one at a time. */
-1:	dsb
-	ldr   r0, =smp_up_cpu        /* VA of gate */
-	add   r0, r0, r10            /* PA of gate */
-	ldr   r1, [r0]               /* Which CPU is being booted? */
-	teq   r1, r12                /* Is it us? */
-	wfene
-	bne   1b
+        /* Non-boot CPUs wait here to be woken up one at a time. */
+1:      dsb
+        ldr   r0, =smp_up_cpu        /* VA of gate */
+        add   r0, r0, r10            /* PA of gate */
+        ldr   r1, [r0]               /* Which CPU is being booted? */
+        teq   r1, r12                /* Is it us? */
+        wfene
+        bne   1b
 
 boot_cpu:
 #ifdef EARLY_UART_ADDRESS
-	ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
-	teq   r12, #0                   /* CPU 0 sets up the UART too */
-	bleq  init_uart
-	PRINT("- CPU ")
-	mov   r0, r12
-	bl    putn
-	PRINT(" booting -\r\n")
+        ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
+        teq   r12, #0                   /* CPU 0 sets up the UART too */
+        bleq  init_uart
+        PRINT("- CPU ")
+        mov   r0, r12
+        bl    putn
+        PRINT(" booting -\r\n")
 #endif
 
-	/* Wake up secondary cpus */
-	teq   r12, #0
-	bleq  kick_cpus
+        /* Wake up secondary cpus */
+        teq   r12, #0
+        bleq  kick_cpus
 
-	/* Check that this CPU has Hyp mode */
-	mrc   CP32(r0, ID_PFR1)
-	and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
-	teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
-	beq   1f
-	PRINT("- CPU doesn't support the virtualization extensions -\r\n")
-	b     fail
+        /* Check that this CPU has Hyp mode */
+        mrc   CP32(r0, ID_PFR1)
+        and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
+        teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
+        beq   1f
+        PRINT("- CPU doesn't support the virtualization extensions -\r\n")
+        b     fail
 1:
-	/* Check if we're already in it */
-	mrs   r0, cpsr
-	and   r0, r0, #0x1f          /* Mode is in the low 5 bits of CPSR */
-	teq   r0, #0x1a              /* Hyp Mode? */
-	bne   1f
-	PRINT("- Started in Hyp mode -\r\n")
-	b     hyp
+        /* Check if we're already in it */
+        mrs   r0, cpsr
+        and   r0, r0, #0x1f          /* Mode is in the low 5 bits of CPSR */
+        teq   r0, #0x1a              /* Hyp Mode? */
+        bne   1f
+        PRINT("- Started in Hyp mode -\r\n")
+        b     hyp
 1:
-	/* Otherwise, it must have been Secure Supervisor mode */
-	mrc   CP32(r0, SCR)
-	tst   r0, #0x1               /* Not-Secure bit set? */
-	beq   1f
-	PRINT("- CPU is not in Hyp mode or Secure state -\r\n")
-	b     fail
+        /* Otherwise, it must have been Secure Supervisor mode */
+        mrc   CP32(r0, SCR)
+        tst   r0, #0x1               /* Not-Secure bit set? */
+        beq   1f
+        PRINT("- CPU is not in Hyp mode or Secure state -\r\n")
+        b     fail
 1:
-	/* OK, we're in Secure state. */
-	PRINT("- Started in Secure state -\r\n- Entering Hyp mode -\r\n")
-	ldr   r0, =enter_hyp_mode    /* VA of function */
-	adr   lr, hyp                /* Set return address for call */
-	add   pc, r0, r10            /* Call PA of function */
+        /* OK, we're in Secure state. */
+        PRINT("- Started in Secure state -\r\n- Entering Hyp mode -\r\n")
+        ldr   r0, =enter_hyp_mode    /* VA of function */
+        adr   lr, hyp                /* Set return address for call */
+        add   pc, r0, r10            /* Call PA of function */
 
 hyp:
 
-	/* Zero BSS On the boot CPU to avoid nasty surprises */
-	teq   r12, #0
-	bne   skip_bss
+        /* Zero BSS On the boot CPU to avoid nasty surprises */
+        teq   r12, #0
+        bne   skip_bss
 
-	PRINT("- Zero BSS -\r\n")
-	ldr   r0, =__bss_start       /* Load start & end of bss */
-	ldr   r1, =__bss_end
-	add   r0, r0, r10            /* Apply physical offset */
-	add   r1, r1, r10
-	
-	mov   r2, #0
-1:	str   r2, [r0], #4
-	cmp   r0, r1
-	blo   1b
+        PRINT("- Zero BSS -\r\n")
+        ldr   r0, =__bss_start       /* Load start & end of bss */
+        ldr   r1, =__bss_end
+        add   r0, r0, r10            /* Apply physical offset */
+        add   r1, r1, r10
 
-skip_bss:	
+        mov   r2, #0
+1:      str   r2, [r0], #4
+        cmp   r0, r1
+        blo   1b
 
-	PRINT("- Setting up control registers -\r\n")
-	
-	/* Read CPU ID */
-	mrc   CP32(r0, MIDR)
-	ldr   r1, =(MIDR_MASK)
-	and   r0, r0, r1
-	/* Is this a Cortex A15? */
-	ldr   r1, =(CORTEX_A15_ID)
-	teq   r0, r1
-	bleq  cortex_a15_init
+skip_bss:
 
-	/* Set up memory attribute type tables */
-	ldr   r0, =MAIR0VAL
-	ldr   r1, =MAIR1VAL
-	mcr   CP32(r0, MAIR0)
-	mcr   CP32(r1, MAIR1)
-	mcr   CP32(r0, HMAIR0)
-	mcr   CP32(r1, HMAIR1)
+        PRINT("- Setting up control registers -\r\n")
 
-	/* Set up the HTCR:
-	 * PT walks use Outer-Shareable accesses,
-	 * PT walks are write-back, no-write-allocate in both cache levels,
-	 * Full 32-bit address space goes through this table. */
-	ldr   r0, =0x80002500
-	mcr   CP32(r0, HTCR)
+        /* Read CPU ID */
+        mrc   CP32(r0, MIDR)
+        ldr   r1, =(MIDR_MASK)
+        and   r0, r0, r1
+        /* Is this a Cortex A15? */
+        ldr   r1, =(CORTEX_A15_ID)
+        teq   r0, r1
+        bleq  cortex_a15_init
 
-	/* Set up the HSCTLR:
-	 * Exceptions in LE ARM,
-	 * Low-latency IRQs disabled,
-	 * Write-implies-XN disabled (for now),
-	 * D-cache disabled (for now),
-	 * I-cache enabled,
-	 * Alignment checking enabled,
-	 * MMU translation disabled (for now). */
-	ldr   r0, =(HSCTLR_BASE|SCTLR_A)
-	mcr   CP32(r0, HSCTLR)
+        /* Set up memory attribute type tables */
+        ldr   r0, =MAIR0VAL
+        ldr   r1, =MAIR1VAL
+        mcr   CP32(r0, MAIR0)
+        mcr   CP32(r1, MAIR1)
+        mcr   CP32(r0, HMAIR0)
+        mcr   CP32(r1, HMAIR1)
 
-	/* Write Xen's PT's paddr into the HTTBR */
-	ldr   r4, =xen_pgtable
-	add   r4, r4, r10            /* r4 := paddr (xen_pagetable) */
-	mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
-	mcrr  CP64(r4, r5, HTTBR)
+        /* Set up the HTCR:
+         * PT walks use Outer-Shareable accesses,
+         * PT walks are write-back, no-write-allocate in both cache levels,
+         * Full 32-bit address space goes through this table. */
+        ldr   r0, =0x80002500
+        mcr   CP32(r0, HTCR)
 
-	/* Non-boot CPUs don't need to rebuild the pagetable */
-	teq   r12, #0
-	bne   pt_ready
-	
-	/* console fixmap */
+        /* Set up the HSCTLR:
+         * Exceptions in LE ARM,
+         * Low-latency IRQs disabled,
+         * Write-implies-XN disabled (for now),
+         * D-cache disabled (for now),
+         * I-cache enabled,
+         * Alignment checking enabled,
+         * MMU translation disabled (for now). */
+        ldr   r0, =(HSCTLR_BASE|SCTLR_A)
+        mcr   CP32(r0, HSCTLR)
+
+        /* Write Xen's PT's paddr into the HTTBR */
+        ldr   r4, =xen_pgtable
+        add   r4, r4, r10            /* r4 := paddr (xen_pagetable) */
+        mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
+        mcrr  CP64(r4, r5, HTTBR)
+
+        /* Non-boot CPUs don't need to rebuild the pagetable */
+        teq   r12, #0
+        bne   pt_ready
+
+        /* console fixmap */
 #ifdef EARLY_UART_ADDRESS
-	ldr   r1, =xen_fixmap
-	add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
-	mov   r3, #0
-	lsr   r2, r11, #12
-	lsl   r2, r2, #12            /* 4K aligned paddr of UART */
-	orr   r2, r2, #PT_UPPER(DEV_L3)
-	orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
-	strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
+        ldr   r1, =xen_fixmap
+        add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
+        mov   r3, #0
+        lsr   r2, r11, #12
+        lsl   r2, r2, #12            /* 4K aligned paddr of UART */
+        orr   r2, r2, #PT_UPPER(DEV_L3)
+        orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
+        strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
 #endif
 
-	/* Build the baseline idle pagetable's first-level entries */
-	ldr   r1, =xen_second
-	add   r1, r1, r10            /* r1 := paddr (xen_second) */
-	mov   r3, #0x0
-	orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 := table map of xen_second */
-	orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
-	strd  r2, r3, [r4, #0]       /* Map it in slot 0 */
-	add   r2, r2, #0x1000
-	strd  r2, r3, [r4, #8]       /* Map 2nd page in slot 1 */
-	add   r2, r2, #0x1000
-	strd  r2, r3, [r4, #16]      /* Map 3rd page in slot 2 */
-	add   r2, r2, #0x1000
-	strd  r2, r3, [r4, #24]      /* Map 4th page in slot 3 */
+        /* Build the baseline idle pagetable's first-level entries */
+        ldr   r1, =xen_second
+        add   r1, r1, r10            /* r1 := paddr (xen_second) */
+        mov   r3, #0x0
+        orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 := table map of xen_second */
+        orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
+        strd  r2, r3, [r4, #0]       /* Map it in slot 0 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #8]       /* Map 2nd page in slot 1 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #16]      /* Map 3rd page in slot 2 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #24]      /* Map 4th page in slot 3 */
 
-	/* Now set up the second-level entries */
-	orr   r2, r9, #PT_UPPER(MEM)
-	orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB normal map of Xen */
-	mov   r4, r9, lsr #18        /* Slot for paddr(start) */
-	strd  r2, r3, [r1, r4]       /* Map Xen there */
-	ldr   r4, =start
-	lsr   r4, #18                /* Slot for vaddr(start) */
-	strd  r2, r3, [r1, r4]       /* Map Xen there too */
+        /* Now set up the second-level entries */
+        orr   r2, r9, #PT_UPPER(MEM)
+        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB normal map of Xen */
+        mov   r4, r9, lsr #18        /* Slot for paddr(start) */
+        strd  r2, r3, [r1, r4]       /* Map Xen there */
+        ldr   r4, =start
+        lsr   r4, #18                /* Slot for vaddr(start) */
+        strd  r2, r3, [r1, r4]       /* Map Xen there too */
 
-	/* xen_fixmap pagetable */
-	ldr   r2, =xen_fixmap
-	add   r2, r2, r10            /* r2 := paddr (xen_fixmap) */
-	orr   r2, r2, #PT_UPPER(PT)
-	orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 := table map of xen_fixmap */
-	add   r4, r4, #8
-	strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
+        /* xen_fixmap pagetable */
+        ldr   r2, =xen_fixmap
+        add   r2, r2, r10            /* r2 := paddr (xen_fixmap) */
+        orr   r2, r2, #PT_UPPER(PT)
+        orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 := table map of xen_fixmap */
+        add   r4, r4, #8
+        strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
 
-	mov   r3, #0x0
-	lsr   r2, r8, #21
-	lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
-	orr   r2, r2, #PT_UPPER(MEM)
-	orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB RAM incl. DTB */
-	add   r4, r4, #8
-	strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
+        mov   r3, #0x0
+        lsr   r2, r8, #21
+        lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
+        orr   r2, r2, #PT_UPPER(MEM)
+        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB RAM incl. DTB */
+        add   r4, r4, #8
+        strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
 
 pt_ready:
-	PRINT("- Turning on paging -\r\n")
+        PRINT("- Turning on paging -\r\n")
 
-	ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
-	mrc   CP32(r0, HSCTLR)
-	orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
-	dsb                          /* Flush PTE writes and finish reads */
-	mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
-	isb                          /* Now, flush the icache */
-	mov   pc, r1                 /* Get a proper vaddr into PC */
+        ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
+        mrc   CP32(r0, HSCTLR)
+        orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
+        dsb                          /* Flush PTE writes and finish reads */
+        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
+        isb                          /* Now, flush the icache */
+        mov   pc, r1                 /* Get a proper vaddr into PC */
 paging:
 
 
 #ifdef EARLY_UART_ADDRESS
-	/* Use a virtual address to access the UART. */
-	ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+        /* Use a virtual address to access the UART. */
+        ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
 #endif
 
-	PRINT("- Ready -\r\n")
+        PRINT("- Ready -\r\n")
 
-	/* The boot CPU should go straight into C now */
-	teq   r12, #0
-	beq   launch
+        /* The boot CPU should go straight into C now */
+        teq   r12, #0
+        beq   launch
 
-	/* Non-boot CPUs need to move on to the relocated pagetables */
-	mov   r0, #0
-	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
-	add   r4, r4, r10            /* PA of it */
-	ldrd  r4, r5, [r4]           /* Actual value */
-	dsb
-	mcrr  CP64(r4, r5, HTTBR)
-	dsb
-	isb
-	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
-	mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
-	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
-	dsb                          /* Ensure completion of TLB+BP flush */
-	isb
+        /* Non-boot CPUs need to move on to the relocated pagetables */
+        mov   r0, #0
+        ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
+        add   r4, r4, r10            /* PA of it */
+        ldrd  r4, r5, [r4]           /* Actual value */
+        dsb
+        mcrr  CP64(r4, r5, HTTBR)
+        dsb
+        isb
+        mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+        mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
+        mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
+        dsb                          /* Ensure completion of TLB+BP flush */
+        isb
 
-	/* Non-boot CPUs report that they've got this far */
-	ldr   r0, =ready_cpus
-1:	ldrex r1, [r0]               /*            { read # of ready CPUs } */
-	add   r1, r1, #1             /* Atomically { ++                   } */
-	strex r2, r1, [r0]           /*            { writeback            } */
-	teq   r2, #0
-	bne   1b
-	dsb
-	mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
-	dsb
+        /* Non-boot CPUs report that they've got this far */
+        ldr   r0, =ready_cpus
+1:      ldrex r1, [r0]               /*            { read # of ready CPUs } */
+        add   r1, r1, #1             /* Atomically { ++                   } */
+        strex r2, r1, [r0]           /*            { writeback            } */
+        teq   r2, #0
+        bne   1b
+        dsb
+        mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
+        dsb
 
-	/* Here, the non-boot CPUs must wait again -- they're now running on
-	 * the boot CPU's pagetables so it's safe for the boot CPU to
-	 * overwrite the non-relocated copy of Xen.  Once it's done that,
-	 * and brought up the memory allocator, non-boot CPUs can get their
-	 * own stacks and enter C. */
-1:	wfe
-	dsb
-	ldr   r0, =smp_up_cpu
-	ldr   r1, [r0]               /* Which CPU is being booted? */
-	teq   r1, r12                /* Is it us? */
-	bne   1b
+        /* Here, the non-boot CPUs must wait again -- they're now running on
+         * the boot CPU's pagetables so it's safe for the boot CPU to
+         * overwrite the non-relocated copy of Xen.  Once it's done that,
+         * and brought up the memory allocator, non-boot CPUs can get their
+         * own stacks and enter C. */
+1:      wfe
+        dsb
+        ldr   r0, =smp_up_cpu
+        ldr   r1, [r0]               /* Which CPU is being booted? */
+        teq   r1, r12                /* Is it us? */
+        bne   1b
 
-launch:	
-	ldr   r0, =init_stack        /* Find the boot-time stack */
-	ldr   sp, [r0]
-	add   sp, #STACK_SIZE        /* (which grows down from the top). */
-	sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
-	mov   r0, r10                /* Marshal args: - phys_offset */
-	mov   r1, r7                 /*               - machine type */
-	mov   r2, r8                 /*               - ATAG address */
-	movs  r3, r12                /*               - CPU ID */
-	beq   start_xen              /* and disappear into the land of C */
-	b     start_secondary        /* (to the appropriate entry point) */
+launch:
+        ldr   r0, =init_stack        /* Find the boot-time stack */
+        ldr   sp, [r0]
+        add   sp, #STACK_SIZE        /* (which grows down from the top). */
+        sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
+        mov   r0, r10                /* Marshal args: - phys_offset */
+        mov   r1, r7                 /*               - machine type */
+        mov   r2, r8                 /*               - ATAG address */
+        movs  r3, r12                /*               - CPU ID */
+        beq   start_xen              /* and disappear into the land of C */
+        b     start_secondary        /* (to the appropriate entry point) */
 
 /* Fail-stop
  * r0: string explaining why */
-fail:	PRINT("- Boot failed -\r\n")
-1:	wfe
-	b     1b
+fail:   PRINT("- Boot failed -\r\n")
+1:      wfe
+        b     1b
 
 #ifdef EARLY_UART_ADDRESS
 
 /* Bring up the UART. Specific to the PL011 UART.
  * Clobbers r0-r2 */
 init_uart:
-	mov   r1, #0x0
-	str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor fraction) */
-	mov   r1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
-	str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor integer) */
-	mov   r1, #0x60              /* 8n1 */
-	str   r1, [r11, #0x24]       /* -> UARTLCR_H (Line control) */
-	ldr   r1, =0x00000301        /* RXE | TXE | UARTEN */
-	str   r1, [r11, #0x30]       /* -> UARTCR (Control Register) */
-	adr   r0, 1f
-	b     puts
-1:	.asciz "- UART enabled -\r\n"
-	.align 4
+        mov   r1, #0x0
+        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor fraction) */
+        mov   r1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
+        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor integer) */
+        mov   r1, #0x60              /* 8n1 */
+        str   r1, [r11, #0x24]       /* -> UARTLCR_H (Line control) */
+        ldr   r1, =0x00000301        /* RXE | TXE | UARTEN */
+        str   r1, [r11, #0x30]       /* -> UARTCR (Control Register) */
+        adr   r0, 1f
+        b     puts
+1:      .asciz "- UART enabled -\r\n"
+        .align 4
 
 /* Print early debug messages.  Specific to the PL011 UART.
  * r0: Nul-terminated string to print.
  * Clobbers r0-r2 */
 puts:
-	ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
-	tst   r2, #0x8               /* Check BUSY bit */
-	bne   puts                   /* Wait for the UART to be ready */
-	ldrb  r2, [r0], #1           /* Load next char */
-	teq   r2, #0                 /* Exit on nul */
-	moveq pc, lr
-	str   r2, [r11]              /* -> UARTDR (Data Register) */
-	b     puts
+        ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
+        tst   r2, #0x8               /* Check BUSY bit */
+        bne   puts                   /* Wait for the UART to be ready */
+        ldrb  r2, [r0], #1           /* Load next char */
+        teq   r2, #0                 /* Exit on nul */
+        moveq pc, lr
+        str   r2, [r11]              /* -> UARTDR (Data Register) */
+        b     puts
 
 /* Print a 32-bit number in hex.  Specific to the PL011 UART.
  * r0: Number to print.
  * clobbers r0-r3 */
 putn:
-	adr   r1, hex
-	mov   r3, #8
-1:	ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
-	tst   r2, #0x8               /* Check BUSY bit */
-	bne   1b                     /* Wait for the UART to be ready */
-	and   r2, r0, #0xf0000000    /* Mask off the top nybble */
-	ldrb  r2, [r1, r2, lsr #28]  /* Convert to a char */
-	str   r2, [r11]              /* -> UARTDR (Data Register) */
-	lsl   r0, #4                 /* Roll it through one nybble at a time */
-	subs  r3, r3, #1
-	bne   1b
-	mov   pc, lr
+        adr   r1, hex
+        mov   r3, #8
+1:      ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
+        tst   r2, #0x8               /* Check BUSY bit */
+        bne   1b                     /* Wait for the UART to be ready */
+        and   r2, r0, #0xf0000000    /* Mask off the top nybble */
+        ldrb  r2, [r1, r2, lsr #28]  /* Convert to a char */
+        str   r2, [r11]              /* -> UARTDR (Data Register) */
+        lsl   r0, #4                 /* Roll it through one nybble at a time */
+        subs  r3, r3, #1
+        bne   1b
+        mov   pc, lr
 
-hex:	.ascii "0123456789abcdef"
-	.align 2
+hex:    .ascii "0123456789abcdef"
+        .align 2
 
 #else  /* EARLY_UART_ADDRESS */
 
@@ -403,6 +403,13 @@ init_uart:
 .global early_puts
 early_puts:
 puts:
-putn:	mov   pc, lr
+putn:   mov   pc, lr
 
 #endif /* EARLY_UART_ADDRESS */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 32db97a8db86 -r fe36080ff85f xen/arch/arm/mode_switch.S
--- a/xen/arch/arm/mode_switch.S	Wed Dec 19 14:16:27 2012 +0000
+++ b/xen/arch/arm/mode_switch.S	Wed Dec 19 14:16:28 2012 +0000
@@ -28,25 +28,25 @@
 /* wake up secondary cpus */
 .globl kick_cpus
 kick_cpus:
-	/* write start paddr to v2m sysreg FLAGSSET register */
-	ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
-	dsb
-	mov   r2, #0xffffffff
-	str   r2, [r0, #(V2M_SYS_FLAGSCLR)]
-	dsb
-	ldr   r2, =start
-	add   r2, r2, r10
-	str   r2, [r0, #(V2M_SYS_FLAGSSET)]
-	dsb
-	/* send an interrupt */
-	ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
-	mov   r2, #0x1
-	str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
-	mov   r2, #0xfe0000
-	str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
-	dsb
-	str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
-	mov   pc, lr
+        /* write start paddr to v2m sysreg FLAGSSET register */
+        ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
+        dsb
+        mov   r2, #0xffffffff
+        str   r2, [r0, #(V2M_SYS_FLAGSCLR)]
+        dsb
+        ldr   r2, =start
+        add   r2, r2, r10
+        str   r2, [r0, #(V2M_SYS_FLAGSSET)]
+        dsb
+        /* send an interrupt */
+        ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
+        mov   r2, #0x1
+        str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
+        mov   r2, #0xfe0000
+        str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
+        dsb
+        str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
+        mov   pc, lr
 
 
 /* Get up a CPU into Hyp mode.  Clobbers r0-r3.
@@ -61,54 +61,61 @@ kick_cpus:
 
 .globl enter_hyp_mode
 enter_hyp_mode:
-	mov   r3, lr                 /* Put return address in non-banked reg */
-	cpsid aif, #0x16             /* Enter Monitor mode */
-	mrc   CP32(r0, SCR)
-	orr   r0, r0, #0x100         /* Set HCE */
-	orr   r0, r0, #0xb1          /* Set SCD, AW, FW and NS */
-	bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
-	mcr   CP32(r0, SCR)
-	/* Ugly: the system timer's frequency register is only
-	 * programmable in Secure state.  Since we don't know where its
-	 * memory-mapped control registers live, we can't find out the
-	 * right frequency.  Use the VE model's default frequency here. */
-	ldr   r0, =0x5f5e100         /* 100 MHz */
-	mcr   CP32(r0, CNTFRQ)
-	ldr   r0, =0x40c00           /* SMP, c11, c10 in non-secure mode */
-	mcr   CP32(r0, NSACR)
-	mov   r0, #GIC_BASE_ADDRESS
-	add   r0, r0, #GIC_DR_OFFSET
-	/* Disable the GIC distributor, on the boot CPU only */
-	mov   r1, #0
-	teq   r12, #0                /* Is this the boot CPU? */
-	streq r1, [r0]
-	/* Continuing ugliness: Set up the GIC so NS state owns interrupts,
-	 * The first 32 interrupts (SGIs & PPIs) must be configured on all
-	 * CPUs while the remainder are SPIs and only need to be done one, on
-	 * the boot CPU. */
-	add   r0, r0, #0x80          /* GICD_IGROUP0 */
-	mov   r2, #0xffffffff        /* All interrupts to group 1 */
-	teq   r12, #0                /* Boot CPU? */
-	str   r2, [r0]               /* Interrupts  0-31 (SGI & PPI) */
-	streq r2, [r0, #4]           /* Interrupts 32-63 (SPI) */
-	streq r2, [r0, #8]           /* Interrupts 64-95 (SPI) */
-	/* Disable the GIC CPU interface on all processors */
-	mov   r0, #GIC_BASE_ADDRESS
-	add   r0, r0, #GIC_CR_OFFSET
-	mov   r1, #0
-	str   r1, [r0]
-	/* Must drop priority mask below 0x80 before entering NS state */
-	ldr   r1, =0xff
-	str   r1, [r0, #0x4]         /* -> GICC_PMR */
-	/* Reset a few config registers */
-	mov   r0, #0
-	mcr   CP32(r0, FCSEIDR)
-	mcr   CP32(r0, CONTEXTIDR)
-	/* Allow non-secure access to coprocessors, FIQs, VFP and NEON */
-	ldr   r1, =0x3fff            /* 14 CP bits set, all others clear */
-	mcr   CP32(r1, NSACR)
+        mov   r3, lr                 /* Put return address in non-banked reg */
+        cpsid aif, #0x16             /* Enter Monitor mode */
+        mrc   CP32(r0, SCR)
+        orr   r0, r0, #0x100         /* Set HCE */
+        orr   r0, r0, #0xb1          /* Set SCD, AW, FW and NS */
+        bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
+        mcr   CP32(r0, SCR)
+        /* Ugly: the system timer's frequency register is only
+         * programmable in Secure state.  Since we don't know where its
+         * memory-mapped control registers live, we can't find out the
+         * right frequency.  Use the VE model's default frequency here. */
+        ldr   r0, =0x5f5e100         /* 100 MHz */
+        mcr   CP32(r0, CNTFRQ)
+        ldr   r0, =0x40c00           /* SMP, c11, c10 in non-secure mode */
+        mcr   CP32(r0, NSACR)
+        mov   r0, #GIC_BASE_ADDRESS
+        add   r0, r0, #GIC_DR_OFFSET
+        /* Disable the GIC distributor, on the boot CPU only */
+        mov   r1, #0
+        teq   r12, #0                /* Is this the boot CPU? */
+        streq r1, [r0]
+        /* Continuing ugliness: Set up the GIC so NS state owns interrupts,
+         * The first 32 interrupts (SGIs & PPIs) must be configured on all
+         * CPUs while the remainder are SPIs and only need to be done one, on
+         * the boot CPU. */
+        add   r0, r0, #0x80          /* GICD_IGROUP0 */
+        mov   r2, #0xffffffff        /* All interrupts to group 1 */
+        teq   r12, #0                /* Boot CPU? */
+        str   r2, [r0]               /* Interrupts  0-31 (SGI & PPI) */
+        streq r2, [r0, #4]           /* Interrupts 32-63 (SPI) */
+        streq r2, [r0, #8]           /* Interrupts 64-95 (SPI) */
+        /* Disable the GIC CPU interface on all processors */
+        mov   r0, #GIC_BASE_ADDRESS
+        add   r0, r0, #GIC_CR_OFFSET
+        mov   r1, #0
+        str   r1, [r0]
+        /* Must drop priority mask below 0x80 before entering NS state */
+        ldr   r1, =0xff
+        str   r1, [r0, #0x4]         /* -> GICC_PMR */
+        /* Reset a few config registers */
+        mov   r0, #0
+        mcr   CP32(r0, FCSEIDR)
+        mcr   CP32(r0, CONTEXTIDR)
+        /* Allow non-secure access to coprocessors, FIQs, VFP and NEON */
+        ldr   r1, =0x3fff            /* 14 CP bits set, all others clear */
+        mcr   CP32(r1, NSACR)
 
-	mrs   r0, cpsr               /* Copy the CPSR */
-	add   r0, r0, #0x4           /* 0x16 (Monitor) -> 0x1a (Hyp) */
-	msr   spsr_cxsf, r0          /* into the SPSR */
-	movs  pc, r3                 /* Exception-return into Hyp mode */
+        mrs   r0, cpsr               /* Copy the CPSR */
+        add   r0, r0, #0x4           /* 0x16 (Monitor) -> 0x1a (Hyp) */
+        msr   spsr_cxsf, r0          /* into the SPSR */
+        movs  pc, r3                 /* Exception-return into Hyp mode */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 32db97a8db86 -r fe36080ff85f xen/arch/arm/proc-ca15.S
--- a/xen/arch/arm/proc-ca15.S	Wed Dec 19 14:16:27 2012 +0000
+++ b/xen/arch/arm/proc-ca15.S	Wed Dec 19 14:16:28 2012 +0000
@@ -21,8 +21,15 @@
 
 .globl cortex_a15_init
 cortex_a15_init:
-	/* Set up the SMP bit in ACTLR */
-	mrc   CP32(r0, ACTLR)
-	orr   r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit*/
-	mcr   CP32(r0, ACTLR)
-	mov   pc, lr
+        /* Set up the SMP bit in ACTLR */
+        mrc   CP32(r0, ACTLR)
+        orr   r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit */
+        mcr   CP32(r0, ACTLR)
+        mov   pc, lr
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiR-00076g-LP; Thu, 20 Dec 2012 16:11:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiP-00073o-LJ
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:21 +0000
Received: from [85.158.143.99:6692] by server-3.bemta-4.messagelabs.com id
	CE/E0-18211-8A833D05; Thu, 20 Dec 2012 16:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1356019879!22846862!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31101 invoked from network); 20 Dec 2012 16:11:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-0005gD-Sr
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-0006CE-RZ
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Message-Id: <E1TliiM-0006CE-RZ@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: reorder registers in
	struct cpu_user_regs.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926589 0
# Node ID 984086ca8ca0de17b5cd3253bc9579d072ec43bc
# Parent  fe36080ff85f727fd0de87a8fd264892d41b8c9c
xen: arm: reorder registers in struct cpu_user_regs.

Primarily this is so that they are ordered in the same way as the
mapping from arm64 x0..x31 registers to the arm32 registers, which is
just less confusing for everyone going forward.

It also makes the implementation of select_user_regs in the next patch
slightly simpler.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r fe36080ff85f -r 984086ca8ca0 xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S	Wed Dec 19 14:16:28 2012 +0000
+++ b/xen/arch/arm/entry.S	Wed Dec 19 14:16:29 2012 +0000
@@ -12,7 +12,7 @@
         RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
 
 #define SAVE_ALL                                                        \
-        sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */      \
+        sub sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */      \
         push {r0-r12}; /* Save R0-R12 */                                \
                                                                         \
         mrs r11, ELR_hyp;               /* ELR_hyp is return address. */\
@@ -115,7 +115,7 @@ ENTRY(return_to_hypervisor)
         ldr r11, [sp, #UREGS_cpsr]
         msr SPSR_hyp, r11
         pop {r0-r12}
-        add sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */
+        add sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */
         eret
 
 /*
diff -r fe36080ff85f -r 984086ca8ca0 xen/arch/arm/io.h
--- a/xen/arch/arm/io.h	Wed Dec 19 14:16:28 2012 +0000
+++ b/xen/arch/arm/io.h	Wed Dec 19 14:16:29 2012 +0000
@@ -21,6 +21,7 @@
 
 #include <xen/lib.h>
 #include <asm/processor.h>
+#include <asm/regs.h>
 
 typedef struct
 {
diff -r fe36080ff85f -r 984086ca8ca0 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Wed Dec 19 14:16:28 2012 +0000
+++ b/xen/arch/arm/traps.c	Wed Dec 19 14:16:29 2012 +0000
@@ -43,7 +43,7 @@
  * stack) must be doubleword-aligned in size.  */
 static inline void check_stack_alignment_constraints(void) {
     BUILD_BUG_ON((sizeof (struct cpu_user_regs)) & 0x7);
-    BUILD_BUG_ON((offsetof(struct cpu_user_regs, r8_fiq)) & 0x7);
+    BUILD_BUG_ON((offsetof(struct cpu_user_regs, sp_usr)) & 0x7);
     BUILD_BUG_ON((sizeof (struct cpu_info)) & 0x7);
 }
 
diff -r fe36080ff85f -r 984086ca8ca0 xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Wed Dec 19 14:16:28 2012 +0000
+++ b/xen/include/public/arch-arm.h	Wed Dec 19 14:16:29 2012 +0000
@@ -119,12 +119,15 @@ struct cpu_user_regs
 
     /* Outer guest frame only from here on... */
 
-    uint32_t r8_fiq, r9_fiq, r10_fiq, r11_fiq, r12_fiq;
-
     uint32_t sp_usr; /* LR_usr is the same register as LR, see above */
 
-    uint32_t sp_svc, sp_abt, sp_und, sp_irq, sp_fiq;
-    uint32_t lr_svc, lr_abt, lr_und, lr_irq, lr_fiq;
+    uint32_t sp_irq, lr_irq;
+    uint32_t sp_svc, lr_svc;
+    uint32_t sp_abt, lr_abt;
+    uint32_t sp_und, lr_und;
+
+    uint32_t r8_fiq, r9_fiq, r10_fiq, r11_fiq, r12_fiq;
+    uint32_t sp_fiq, lr_fiq;
 
     uint32_t spsr_svc, spsr_abt, spsr_und, spsr_irq, spsr_fiq;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiR-00076g-LP; Thu, 20 Dec 2012 16:11:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiP-00073o-LJ
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:21 +0000
Received: from [85.158.143.99:6692] by server-3.bemta-4.messagelabs.com id
	CE/E0-18211-8A833D05; Thu, 20 Dec 2012 16:11:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1356019879!22846862!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31101 invoked from network); 20 Dec 2012 16:11:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-0005gD-Sr
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiM-0006CE-RZ
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:18 +0000
Message-Id: <E1TliiM-0006CE-RZ@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: reorder registers in
	struct cpu_user_regs.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926589 0
# Node ID 984086ca8ca0de17b5cd3253bc9579d072ec43bc
# Parent  fe36080ff85f727fd0de87a8fd264892d41b8c9c
xen: arm: reorder registers in struct cpu_user_regs.

Primarily this is so that they are ordered in the same way as the
mapping from arm64 x0..x31 registers to the arm32 registers, which is
just less confusing for everyone going forward.

It also makes the implementation of select_user_regs in the next patch
slightly simpler.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r fe36080ff85f -r 984086ca8ca0 xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S	Wed Dec 19 14:16:28 2012 +0000
+++ b/xen/arch/arm/entry.S	Wed Dec 19 14:16:29 2012 +0000
@@ -12,7 +12,7 @@
         RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
 
 #define SAVE_ALL                                                        \
-        sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */      \
+        sub sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */      \
         push {r0-r12}; /* Save R0-R12 */                                \
                                                                         \
         mrs r11, ELR_hyp;               /* ELR_hyp is return address. */\
@@ -115,7 +115,7 @@ ENTRY(return_to_hypervisor)
         ldr r11, [sp, #UREGS_cpsr]
         msr SPSR_hyp, r11
         pop {r0-r12}
-        add sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */
+        add sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */
         eret
 
 /*
diff -r fe36080ff85f -r 984086ca8ca0 xen/arch/arm/io.h
--- a/xen/arch/arm/io.h	Wed Dec 19 14:16:28 2012 +0000
+++ b/xen/arch/arm/io.h	Wed Dec 19 14:16:29 2012 +0000
@@ -21,6 +21,7 @@
 
 #include <xen/lib.h>
 #include <asm/processor.h>
+#include <asm/regs.h>
 
 typedef struct
 {
diff -r fe36080ff85f -r 984086ca8ca0 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Wed Dec 19 14:16:28 2012 +0000
+++ b/xen/arch/arm/traps.c	Wed Dec 19 14:16:29 2012 +0000
@@ -43,7 +43,7 @@
  * stack) must be doubleword-aligned in size.  */
 static inline void check_stack_alignment_constraints(void) {
     BUILD_BUG_ON((sizeof (struct cpu_user_regs)) & 0x7);
-    BUILD_BUG_ON((offsetof(struct cpu_user_regs, r8_fiq)) & 0x7);
+    BUILD_BUG_ON((offsetof(struct cpu_user_regs, sp_usr)) & 0x7);
     BUILD_BUG_ON((sizeof (struct cpu_info)) & 0x7);
 }
 
diff -r fe36080ff85f -r 984086ca8ca0 xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Wed Dec 19 14:16:28 2012 +0000
+++ b/xen/include/public/arch-arm.h	Wed Dec 19 14:16:29 2012 +0000
@@ -119,12 +119,15 @@ struct cpu_user_regs
 
     /* Outer guest frame only from here on... */
 
-    uint32_t r8_fiq, r9_fiq, r10_fiq, r11_fiq, r12_fiq;
-
     uint32_t sp_usr; /* LR_usr is the same register as LR, see above */
 
-    uint32_t sp_svc, sp_abt, sp_und, sp_irq, sp_fiq;
-    uint32_t lr_svc, lr_abt, lr_und, lr_irq, lr_fiq;
+    uint32_t sp_irq, lr_irq;
+    uint32_t sp_svc, lr_svc;
+    uint32_t sp_abt, lr_abt;
+    uint32_t sp_und, lr_und;
+
+    uint32_t r8_fiq, r9_fiq, r10_fiq, r11_fiq, r12_fiq;
+    uint32_t sp_fiq, lr_fiq;
 
     uint32_t spsr_svc, spsr_abt, spsr_und, spsr_irq, spsr_fiq;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiT-00077k-0G; Thu, 20 Dec 2012 16:11:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiR-00076K-44
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:23 +0000
Received: from [85.158.143.35:3948] by server-2.bemta-4.messagelabs.com id
	E6/2F-30861-AA833D05; Thu, 20 Dec 2012 16:11:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1356019880!14500972!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23676 invoked from network); 20 Dec 2012 16:11:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiO-0005gJ-8M
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiO-0006Ci-3n
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:20 +0000
Message-Id: <E1TliiO-0006Ci-3n@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: mark early_panic as a
	noreturn function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926590 0
# Node ID f9a0e9b4829d6a841a7393532dc5fff25ba3a750
# Parent  b094ba4bf9853e408a710664cb2995b4737cf165
xen: arm: mark early_panic as a noreturn function

Otherwise gcc complains about variables being used when not
initialised when in fact that point is never reached.

There aren't any instances of this in tree right now, I noticed this
while developing another patch.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b094ba4bf985 -r f9a0e9b4829d xen/include/asm-arm/early_printk.h
--- a/xen/include/asm-arm/early_printk.h	Wed Dec 19 14:16:30 2012 +0000
+++ b/xen/include/asm-arm/early_printk.h	Wed Dec 19 14:16:30 2012 +0000
@@ -15,7 +15,7 @@
 #ifdef EARLY_UART_ADDRESS
 
 void early_printk(const char *fmt, ...);
-void early_panic(const char *fmt, ...);
+void early_panic(const char *fmt, ...) __attribute__((noreturn));
 
 #else
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiT-00077k-0G; Thu, 20 Dec 2012 16:11:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiR-00076K-44
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:23 +0000
Received: from [85.158.143.35:3948] by server-2.bemta-4.messagelabs.com id
	E6/2F-30861-AA833D05; Thu, 20 Dec 2012 16:11:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1356019880!14500972!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23676 invoked from network); 20 Dec 2012 16:11:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiO-0005gJ-8M
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiO-0006Ci-3n
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:20 +0000
Message-Id: <E1TliiO-0006Ci-3n@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: mark early_panic as a
	noreturn function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926590 0
# Node ID f9a0e9b4829d6a841a7393532dc5fff25ba3a750
# Parent  b094ba4bf9853e408a710664cb2995b4737cf165
xen: arm: mark early_panic as a noreturn function

Otherwise gcc complains about variables being used when not
initialised when in fact that point is never reached.

There aren't any instances of this in tree right now, I noticed this
while developing another patch.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b094ba4bf985 -r f9a0e9b4829d xen/include/asm-arm/early_printk.h
--- a/xen/include/asm-arm/early_printk.h	Wed Dec 19 14:16:30 2012 +0000
+++ b/xen/include/asm-arm/early_printk.h	Wed Dec 19 14:16:30 2012 +0000
@@ -15,7 +15,7 @@
 #ifdef EARLY_UART_ADDRESS
 
 void early_printk(const char *fmt, ...);
-void early_panic(const char *fmt, ...);
+void early_panic(const char *fmt, ...) __attribute__((noreturn));
 
 #else
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiT-00077r-3A; Thu, 20 Dec 2012 16:11:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiS-000774-IT
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:24 +0000
Received: from [85.158.139.83:31970] by server-4.bemta-5.messagelabs.com id
	75/8C-14693-BA833D05; Thu, 20 Dec 2012 16:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1356019881!23399164!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29237 invoked from network); 20 Dec 2012 16:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiP-0005gP-7A
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiP-0006DC-5f
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:21 +0000
Message-Id: <E1TliiP-0006DC-5f@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: remove nr_irqs_gsi from generic
	code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355933089 0
# Node ID 581215737128936dcf92eb23efa02d2859946751
# Parent  613d9705544416f80ade81a773aa25b581348a00
xen: remove nr_irqs_gsi from generic code

The concept is X86 specific.

AFAICT the generic concept here is the number of static physical IRQs
which the current hardware has, so call this nr_static_irqs.

Also using "defined NR_IRQS" as a standin for x86 might have made
sense at one point but its just cleaner to push the necessary
definitions into asm/irq.h.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 613d97055444 -r 581215737128 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 16:04:49 2012 +0000
@@ -6,5 +6,3 @@ x:	.word 0xe7f000f0 /* Undefined instruc
 	.globl x; \
 x:	mov pc, lr
 	
-/* PIRQ support */
-DUMMY(nr_irqs_gsi);
diff -r 613d97055444 -r 581215737128 xen/common/domain.c
--- a/xen/common/domain.c	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/common/domain.c	Wed Dec 19 16:04:49 2012 +0000
@@ -259,9 +259,9 @@ struct domain *domain_create(
         atomic_inc(&d->pause_count);
 
         if ( domid )
-            d->nr_pirqs = nr_irqs_gsi + extra_domU_irqs;
+            d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
         else
-            d->nr_pirqs = nr_irqs_gsi + extra_dom0_irqs;
+            d->nr_pirqs = nr_static_irqs + extra_dom0_irqs;
         if ( d->nr_pirqs > nr_irqs )
             d->nr_pirqs = nr_irqs;
 
diff -r 613d97055444 -r 581215737128 xen/include/asm-arm/irq.h
--- a/xen/include/asm-arm/irq.h	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/include/asm-arm/irq.h	Wed Dec 19 16:04:49 2012 +0000
@@ -21,6 +21,9 @@ struct irq_cfg {
 #define NR_IRQS		1024
 #define nr_irqs NR_IRQS
 
+#define nr_irqs NR_IRQS
+#define nr_static_irqs NR_IRQS
+
 struct irq_desc;
 
 struct irq_desc *__irq_to_desc(int irq);
diff -r 613d97055444 -r 581215737128 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/include/asm-x86/irq.h	Wed Dec 19 16:04:49 2012 +0000
@@ -11,6 +11,10 @@
 #include <irq_vectors.h>
 #include <asm/percpu.h>
 
+extern unsigned int nr_irqs_gsi;
+extern unsigned int nr_irqs;
+#define nr_static_irqs nr_irqs_gsi
+
 #define IO_APIC_IRQ(irq)    (platform_legacy_irq(irq) ?    \
 			     (1 << (irq)) & io_apic_irqs : \
 			     (irq) < nr_irqs_gsi)
diff -r 613d97055444 -r 581215737128 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/include/xen/irq.h	Wed Dec 19 16:04:49 2012 +0000
@@ -58,14 +58,6 @@ typedef const struct hw_interrupt_type h
 
 #include <asm/irq.h>
 
-#ifdef NR_IRQS
-# define nr_irqs NR_IRQS
-# define nr_irqs_gsi NR_IRQS
-#else
-extern unsigned int nr_irqs_gsi;
-extern unsigned int nr_irqs;
-#endif
-
 struct msi_desc;
 /*
  * This is the "IRQ descriptor", which contains various information
diff -r 613d97055444 -r 581215737128 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/xsm/flask/hooks.c	Wed Dec 19 16:04:49 2012 +0000
@@ -72,7 +72,7 @@ static int get_irq_sid(int irq, u32 *sid
     struct irq_desc *desc = irq_to_desc(irq);
     if ( irq >= nr_irqs || irq < 0 )
         return -EINVAL;
-    if ( irq < nr_irqs_gsi ) {
+    if ( irq < nr_static_irqs ) {
         if (ad) {
             AVC_AUDIT_DATA_INIT(ad, IRQ);
             ad->irq = irq;
@@ -699,7 +699,7 @@ static int flask_map_domain_pirq (struct
     if ( rc )
         return rc;
 
-    if ( irq >= nr_irqs_gsi && msi ) {
+    if ( irq >= nr_static_irqs && msi ) {
         u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
         AVC_AUDIT_DATA_INIT(&ad, DEV);
         ad.device = machine_bdf;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiT-00077r-3A; Thu, 20 Dec 2012 16:11:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiS-000774-IT
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:24 +0000
Received: from [85.158.139.83:31970] by server-4.bemta-5.messagelabs.com id
	75/8C-14693-BA833D05; Thu, 20 Dec 2012 16:11:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1356019881!23399164!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29237 invoked from network); 20 Dec 2012 16:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiP-0005gP-7A
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiP-0006DC-5f
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:21 +0000
Message-Id: <E1TliiP-0006DC-5f@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: remove nr_irqs_gsi from generic
	code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355933089 0
# Node ID 581215737128936dcf92eb23efa02d2859946751
# Parent  613d9705544416f80ade81a773aa25b581348a00
xen: remove nr_irqs_gsi from generic code

The concept is X86 specific.

AFAICT the generic concept here is the number of static physical IRQs
which the current hardware has, so call this nr_static_irqs.

Also using "defined NR_IRQS" as a standin for x86 might have made
sense at one point but its just cleaner to push the necessary
definitions into asm/irq.h.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 613d97055444 -r 581215737128 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 16:04:49 2012 +0000
@@ -6,5 +6,3 @@ x:	.word 0xe7f000f0 /* Undefined instruc
 	.globl x; \
 x:	mov pc, lr
 	
-/* PIRQ support */
-DUMMY(nr_irqs_gsi);
diff -r 613d97055444 -r 581215737128 xen/common/domain.c
--- a/xen/common/domain.c	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/common/domain.c	Wed Dec 19 16:04:49 2012 +0000
@@ -259,9 +259,9 @@ struct domain *domain_create(
         atomic_inc(&d->pause_count);
 
         if ( domid )
-            d->nr_pirqs = nr_irqs_gsi + extra_domU_irqs;
+            d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
         else
-            d->nr_pirqs = nr_irqs_gsi + extra_dom0_irqs;
+            d->nr_pirqs = nr_static_irqs + extra_dom0_irqs;
         if ( d->nr_pirqs > nr_irqs )
             d->nr_pirqs = nr_irqs;
 
diff -r 613d97055444 -r 581215737128 xen/include/asm-arm/irq.h
--- a/xen/include/asm-arm/irq.h	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/include/asm-arm/irq.h	Wed Dec 19 16:04:49 2012 +0000
@@ -21,6 +21,9 @@ struct irq_cfg {
 #define NR_IRQS		1024
 #define nr_irqs NR_IRQS
 
+#define nr_irqs NR_IRQS
+#define nr_static_irqs NR_IRQS
+
 struct irq_desc;
 
 struct irq_desc *__irq_to_desc(int irq);
diff -r 613d97055444 -r 581215737128 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/include/asm-x86/irq.h	Wed Dec 19 16:04:49 2012 +0000
@@ -11,6 +11,10 @@
 #include <irq_vectors.h>
 #include <asm/percpu.h>
 
+extern unsigned int nr_irqs_gsi;
+extern unsigned int nr_irqs;
+#define nr_static_irqs nr_irqs_gsi
+
 #define IO_APIC_IRQ(irq)    (platform_legacy_irq(irq) ?    \
 			     (1 << (irq)) & io_apic_irqs : \
 			     (irq) < nr_irqs_gsi)
diff -r 613d97055444 -r 581215737128 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/include/xen/irq.h	Wed Dec 19 16:04:49 2012 +0000
@@ -58,14 +58,6 @@ typedef const struct hw_interrupt_type h
 
 #include <asm/irq.h>
 
-#ifdef NR_IRQS
-# define nr_irqs NR_IRQS
-# define nr_irqs_gsi NR_IRQS
-#else
-extern unsigned int nr_irqs_gsi;
-extern unsigned int nr_irqs;
-#endif
-
 struct msi_desc;
 /*
  * This is the "IRQ descriptor", which contains various information
diff -r 613d97055444 -r 581215737128 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Wed Dec 19 14:33:24 2012 +0000
+++ b/xen/xsm/flask/hooks.c	Wed Dec 19 16:04:49 2012 +0000
@@ -72,7 +72,7 @@ static int get_irq_sid(int irq, u32 *sid
     struct irq_desc *desc = irq_to_desc(irq);
     if ( irq >= nr_irqs || irq < 0 )
         return -EINVAL;
-    if ( irq < nr_irqs_gsi ) {
+    if ( irq < nr_static_irqs ) {
         if (ad) {
             AVC_AUDIT_DATA_INIT(ad, IRQ);
             ad->irq = irq;
@@ -699,7 +699,7 @@ static int flask_map_domain_pirq (struct
     if ( rc )
         return rc;
 
-    if ( irq >= nr_irqs_gsi && msi ) {
+    if ( irq >= nr_static_irqs && msi ) {
         u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
         AVC_AUDIT_DATA_INIT(&ad, DEV);
         ad.device = machine_bdf;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiU-00079A-63; Thu, 20 Dec 2012 16:11:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiT-00077J-84
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:25 +0000
Received: from [193.109.254.147:56422] by server-15.bemta-14.messagelabs.com
	id FF/05-05116-CA833D05; Thu, 20 Dec 2012 16:11:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1356019881!1009540!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11077 invoked from network); 20 Dec 2012 16:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiP-0005gS-Nm
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiP-0006DR-MT
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:21 +0000
Message-Id: <E1TliiP-0006DR-MT@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: remove now empty dummy.S
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355933090 0
# Node ID 090cc3e20d3e7eda0b496797e03be6b57c2b54fd
# Parent  581215737128936dcf92eb23efa02d2859946751
xen: arm: remove now empty dummy.S

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 581215737128 -r 090cc3e20d3e xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Wed Dec 19 16:04:49 2012 +0000
+++ b/xen/arch/arm/Makefile	Wed Dec 19 16:04:50 2012 +0000
@@ -1,6 +1,5 @@
 subdir-$(arm32) += arm32
 
-obj-y += dummy.o
 obj-y += early_printk.o
 obj-y += domain.o
 obj-y += domctl.o
diff -r 581215737128 -r 090cc3e20d3e xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 16:04:49 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#define DUMMY(x) \
-	.globl x; \
-x:	.word 0xe7f000f0 /* Undefined instruction */
-
-#define  NOP(x) \
-	.globl x; \
-x:	mov pc, lr
-	

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiU-00079I-8D; Thu, 20 Dec 2012 16:11:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiT-00077D-8J
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:25 +0000
Received: from [85.158.137.99:47486] by server-15.bemta-3.messagelabs.com id
	CB/BB-07921-CA833D05; Thu, 20 Dec 2012 16:11:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1356019872!17247322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16153 invoked from network); 20 Dec 2012 16:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiG-0005fJ-7F
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiG-000695-2W
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:12 +0000
Message-Id: <E1TliiG-000695-2W@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: implement
	arch_get_info_guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926580 0
# Node ID d72be2fc7e755fbc9471a1e801d0b88b02971ce4
# Parent  41bf7e2d5e8b9606f279ef9d1530f62d12d38ce3
xen: arm: implement arch_get_info_guest

Untested, but basically the inverse of arch_set_info_guest.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 41bf7e2d5e8b -r d72be2fc7e75 xen/arch/arm/domctl.c
--- a/xen/arch/arm/domctl.c	Wed Dec 19 14:16:19 2012 +0000
+++ b/xen/arch/arm/domctl.c	Wed Dec 19 14:16:20 2012 +0000
@@ -8,6 +8,7 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
+#include <xen/sched.h>
 #include <public/domctl.h>
 
 long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
@@ -16,6 +17,22 @@ long arch_do_domctl(struct xen_domctl *d
     return -ENOSYS;
 }
 
+void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
+{
+    struct vcpu_guest_context *ctxt = c.nat;
+    struct cpu_user_regs *regs = &c.nat->user_regs;
+
+    *regs = v->arch.cpu_info->guest_cpu_user_regs;
+
+    ctxt->sctlr = v->arch.sctlr;
+    ctxt->ttbr0 = v->arch.ttbr0;
+    ctxt->ttbr1 = v->arch.ttbr1;
+    ctxt->ttbcr = v->arch.ttbcr;
+
+    if ( !test_bit(_VPF_down, &v->pause_flags) )
+        ctxt->flags |= VGCF_online;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 41bf7e2d5e8b -r d72be2fc7e75 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:19 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:20 2012 +0000
@@ -14,7 +14,6 @@ DUMMY(pirq_guest_unbind);
 DUMMY(pirq_set_affinity);
 
 /* VCPU */
-DUMMY(arch_get_info_guest);
 DUMMY(arch_vcpu_reset);
 NOP(update_vcpu_system_time);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiU-00079A-63; Thu, 20 Dec 2012 16:11:26 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiT-00077J-84
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:25 +0000
Received: from [193.109.254.147:56422] by server-15.bemta-14.messagelabs.com
	id FF/05-05116-CA833D05; Thu, 20 Dec 2012 16:11:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1356019881!1009540!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11077 invoked from network); 20 Dec 2012 16:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiP-0005gS-Nm
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiP-0006DR-MT
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:21 +0000
Message-Id: <E1TliiP-0006DR-MT@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: remove now empty dummy.S
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355933090 0
# Node ID 090cc3e20d3e7eda0b496797e03be6b57c2b54fd
# Parent  581215737128936dcf92eb23efa02d2859946751
xen: arm: remove now empty dummy.S

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 581215737128 -r 090cc3e20d3e xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Wed Dec 19 16:04:49 2012 +0000
+++ b/xen/arch/arm/Makefile	Wed Dec 19 16:04:50 2012 +0000
@@ -1,6 +1,5 @@
 subdir-$(arm32) += arm32
 
-obj-y += dummy.o
 obj-y += early_printk.o
 obj-y += domain.o
 obj-y += domctl.o
diff -r 581215737128 -r 090cc3e20d3e xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 16:04:49 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#define DUMMY(x) \
-	.globl x; \
-x:	.word 0xe7f000f0 /* Undefined instruction */
-
-#define  NOP(x) \
-	.globl x; \
-x:	mov pc, lr
-	

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiU-00079I-8D; Thu, 20 Dec 2012 16:11:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiT-00077D-8J
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:25 +0000
Received: from [85.158.137.99:47486] by server-15.bemta-3.messagelabs.com id
	CB/BB-07921-CA833D05; Thu, 20 Dec 2012 16:11:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1356019872!17247322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16153 invoked from network); 20 Dec 2012 16:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiG-0005fJ-7F
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiG-000695-2W
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:12 +0000
Message-Id: <E1TliiG-000695-2W@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: implement
	arch_get_info_guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926580 0
# Node ID d72be2fc7e755fbc9471a1e801d0b88b02971ce4
# Parent  41bf7e2d5e8b9606f279ef9d1530f62d12d38ce3
xen: arm: implement arch_get_info_guest

Untested, but basically the inverse of arch_set_info_guest.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 41bf7e2d5e8b -r d72be2fc7e75 xen/arch/arm/domctl.c
--- a/xen/arch/arm/domctl.c	Wed Dec 19 14:16:19 2012 +0000
+++ b/xen/arch/arm/domctl.c	Wed Dec 19 14:16:20 2012 +0000
@@ -8,6 +8,7 @@
 #include <xen/types.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
+#include <xen/sched.h>
 #include <public/domctl.h>
 
 long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
@@ -16,6 +17,22 @@ long arch_do_domctl(struct xen_domctl *d
     return -ENOSYS;
 }
 
+void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
+{
+    struct vcpu_guest_context *ctxt = c.nat;
+    struct cpu_user_regs *regs = &c.nat->user_regs;
+
+    *regs = v->arch.cpu_info->guest_cpu_user_regs;
+
+    ctxt->sctlr = v->arch.sctlr;
+    ctxt->ttbr0 = v->arch.ttbr0;
+    ctxt->ttbr1 = v->arch.ttbr1;
+    ctxt->ttbcr = v->arch.ttbcr;
+
+    if ( !test_bit(_VPF_down, &v->pause_flags) )
+        ctxt->flags |= VGCF_online;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 41bf7e2d5e8b -r d72be2fc7e75 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:19 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:20 2012 +0000
@@ -14,7 +14,6 @@ DUMMY(pirq_guest_unbind);
 DUMMY(pirq_set_affinity);
 
 /* VCPU */
-DUMMY(arch_get_info_guest);
 DUMMY(arch_vcpu_reset);
 NOP(update_vcpu_system_time);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiY-0007Br-Ej; Thu, 20 Dec 2012 16:11:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiX-0007B0-HM
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:29 +0000
Received: from [85.158.137.99:47858] by server-10.bemta-3.messagelabs.com id
	17/B7-07616-0B833D05; Thu, 20 Dec 2012 16:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1356019877!17247337!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16739 invoked from network); 20 Dec 2012 16:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiK-0005fk-Qh
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiK-0006BG-P4
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:16 +0000
Message-Id: <E1TliiK-0006BG-P4@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: implement send_timer_event.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926586 0
# Node ID b56a5aae2f5be3b4c7dbf6ea6c763998f20823b3
# Parent  c5f7a894c6695ce6bb45a889b489ae6b84184ae6
xen: arm: implement send_timer_event.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c5f7a894c669 -r b56a5aae2f5b xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:26 2012 +0000
@@ -10,5 +10,4 @@ x:	mov pc, lr
 DUMMY(nr_irqs_gsi);
 
 /* Other */
-DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
diff -r c5f7a894c669 -r b56a5aae2f5b xen/arch/arm/time.c
--- a/xen/arch/arm/time.c	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/arch/arm/time.c	Wed Dec 19 14:16:26 2012 +0000
@@ -26,6 +26,7 @@
 #include <xen/softirq.h>
 #include <xen/time.h>
 #include <xen/sched.h>
+#include <xen/event.h>
 #include <asm/system.h>
 
 /*
@@ -186,6 +187,12 @@ void udelay(unsigned long usecs)
     isb();
 }
 
+/* VCPU PV timers. */
+void send_timer_event(struct vcpu *v)
+{
+    send_guest_vcpu_virq(v, VIRQ_TIMER);
+}
+
 /* VCPU PV clock. */
 void update_vcpu_system_time(struct vcpu *v)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiY-0007Br-Ej; Thu, 20 Dec 2012 16:11:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiX-0007B0-HM
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:29 +0000
Received: from [85.158.137.99:47858] by server-10.bemta-3.messagelabs.com id
	17/B7-07616-0B833D05; Thu, 20 Dec 2012 16:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-217.messagelabs.com!1356019877!17247337!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16739 invoked from network); 20 Dec 2012 16:11:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiK-0005fk-Qh
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiK-0006BG-P4
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:16 +0000
Message-Id: <E1TliiK-0006BG-P4@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: implement send_timer_event.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926586 0
# Node ID b56a5aae2f5be3b4c7dbf6ea6c763998f20823b3
# Parent  c5f7a894c6695ce6bb45a889b489ae6b84184ae6
xen: arm: implement send_timer_event.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c5f7a894c669 -r b56a5aae2f5b xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:26 2012 +0000
@@ -10,5 +10,4 @@ x:	mov pc, lr
 DUMMY(nr_irqs_gsi);
 
 /* Other */
-DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
diff -r c5f7a894c669 -r b56a5aae2f5b xen/arch/arm/time.c
--- a/xen/arch/arm/time.c	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/arch/arm/time.c	Wed Dec 19 14:16:26 2012 +0000
@@ -26,6 +26,7 @@
 #include <xen/softirq.h>
 #include <xen/time.h>
 #include <xen/sched.h>
+#include <xen/event.h>
 #include <asm/system.h>
 
 /*
@@ -186,6 +187,12 @@ void udelay(unsigned long usecs)
     isb();
 }
 
+/* VCPU PV timers. */
+void send_timer_event(struct vcpu *v)
+{
+    send_guest_vcpu_virq(v, VIRQ_TIMER);
+}
+
 /* VCPU PV clock. */
 void update_vcpu_system_time(struct vcpu *v)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiY-0007Be-BC; Thu, 20 Dec 2012 16:11:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiX-0007Ar-12
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:29 +0000
Received: from [193.109.254.147:56682] by server-10.bemta-14.messagelabs.com
	id 30/D4-13263-0B833D05; Thu, 20 Dec 2012 16:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1356019871!10720072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6234 invoked from network); 20 Dec 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiF-0005fD-97
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiF-00068b-1R
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:11 +0000
Message-Id: <E1TliiF-00068b-1R@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: define node_online_map.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926579 0
# Node ID 73895827e5e00536a28bb31a74306cff571f9b17
# Parent  102e2894e12a45898db69887f923a1338dfb7c9c
xen: arm: define node_online_map.

For now just initialise it as a single online node, which is what
asm-arm/numa.h assumes anyway.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 102e2894e12a -r 73895827e5e0 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:18 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:19 2012 +0000
@@ -7,7 +7,6 @@ x:	.word 0xe7f000f0 /* Undefined instruc
 x:	mov pc, lr
 	
 /* SMP support */
-DUMMY(node_online_map);
 DUMMY(smp_send_state_dump);
 
 /* PIRQ support */
diff -r 102e2894e12a -r 73895827e5e0 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Wed Dec 19 14:16:18 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Wed Dec 19 14:16:19 2012 +0000
@@ -38,6 +38,9 @@ EXPORT_SYMBOL(cpu_online_map);
 cpumask_t cpu_possible_map;
 EXPORT_SYMBOL(cpu_possible_map);
 
+/* Fake one node for now. See also include/asm-arm/numa.h */
+nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
+
 /* Xen stack for bringing up the first CPU. */
 static unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
        __attribute__((__aligned__(STACK_SIZE)));
diff -r 102e2894e12a -r 73895827e5e0 xen/include/asm-arm/numa.h
--- a/xen/include/asm-arm/numa.h	Wed Dec 19 14:16:18 2012 +0000
+++ b/xen/include/asm-arm/numa.h	Wed Dec 19 14:16:19 2012 +0000
@@ -1,7 +1,7 @@
 #ifndef __ARCH_ARM_NUMA_H
 #define __ARCH_ARM_NUMA_H
 
-/* Fake one node for now... */
+/* Fake one node for now. See also node_online_map. */
 #define cpu_to_node(cpu) 0
 #define node_to_cpumask(node)   (cpu_online_map)
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiY-0007Be-BC; Thu, 20 Dec 2012 16:11:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiX-0007Ar-12
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:29 +0000
Received: from [193.109.254.147:56682] by server-10.bemta-14.messagelabs.com
	id 30/D4-13263-0B833D05; Thu, 20 Dec 2012 16:11:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1356019871!10720072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6234 invoked from network); 20 Dec 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiF-0005fD-97
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiF-00068b-1R
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:11 +0000
Message-Id: <E1TliiF-00068b-1R@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: define node_online_map.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926579 0
# Node ID 73895827e5e00536a28bb31a74306cff571f9b17
# Parent  102e2894e12a45898db69887f923a1338dfb7c9c
xen: arm: define node_online_map.

For now just initialise it as a single online node, which is what
asm-arm/numa.h assumes anyway.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 102e2894e12a -r 73895827e5e0 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:18 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:19 2012 +0000
@@ -7,7 +7,6 @@ x:	.word 0xe7f000f0 /* Undefined instruc
 x:	mov pc, lr
 	
 /* SMP support */
-DUMMY(node_online_map);
 DUMMY(smp_send_state_dump);
 
 /* PIRQ support */
diff -r 102e2894e12a -r 73895827e5e0 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Wed Dec 19 14:16:18 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Wed Dec 19 14:16:19 2012 +0000
@@ -38,6 +38,9 @@ EXPORT_SYMBOL(cpu_online_map);
 cpumask_t cpu_possible_map;
 EXPORT_SYMBOL(cpu_possible_map);
 
+/* Fake one node for now. See also include/asm-arm/numa.h */
+nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
+
 /* Xen stack for bringing up the first CPU. */
 static unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
        __attribute__((__aligned__(STACK_SIZE)));
diff -r 102e2894e12a -r 73895827e5e0 xen/include/asm-arm/numa.h
--- a/xen/include/asm-arm/numa.h	Wed Dec 19 14:16:18 2012 +0000
+++ b/xen/include/asm-arm/numa.h	Wed Dec 19 14:16:19 2012 +0000
@@ -1,7 +1,7 @@
 #ifndef __ARCH_ARM_NUMA_H
 #define __ARCH_ARM_NUMA_H
 
-/* Fake one node for now... */
+/* Fake one node for now. See also node_online_map. */
 #define cpu_to_node(cpu) 0
 #define node_to_cpumask(node)   (cpu_online_map)
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiZ-0007DK-Hm; Thu, 20 Dec 2012 16:11:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiY-0007BX-AT
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:30 +0000
Received: from [85.158.143.35:6775] by server-1.bemta-4.messagelabs.com id
	38/AD-28401-1B833D05; Thu, 20 Dec 2012 16:11:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1356019880!13251492!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12984 invoked from network); 20 Dec 2012 16:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiO-0005gM-MG
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiO-0006Cx-Kw
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:20 +0000
Message-Id: <E1TliiO-0006Cx-Kw@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: move definition of
	libxl_domain_config into the IDL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355927604 0
# Node ID 613d9705544416f80ade81a773aa25b581348a00
# Parent  f9a0e9b4829d6a841a7393532dc5fff25ba3a750
libxl: move definition of libxl_domain_config into the IDL

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r f9a0e9b4829d -r 613d97055444 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Wed Dec 19 14:16:30 2012 +0000
+++ b/tools/libxl/libxl.h	Wed Dec 19 14:33:24 2012 +0000
@@ -474,26 +474,6 @@ typedef struct {
 
 #define LIBXL_VERSION 0
 
-typedef struct {
-    libxl_domain_create_info c_info;
-    libxl_domain_build_info b_info;
-
-    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs, num_vtpms;
-
-    libxl_device_disk *disks;
-    libxl_device_nic *nics;
-    libxl_device_pci *pcidevs;
-    libxl_device_vfb *vfbs;
-    libxl_device_vkb *vkbs;
-    libxl_device_vtpm *vtpms;
-
-    libxl_action_on_shutdown on_poweroff;
-    libxl_action_on_shutdown on_reboot;
-    libxl_action_on_shutdown on_watchdog;
-    libxl_action_on_shutdown on_crash;
-} libxl_domain_config;
-char *libxl_domain_config_to_json(libxl_ctx *ctx, libxl_domain_config *p);
-
 /* context functions */
 int libxl_ctx_alloc(libxl_ctx **pctx, int version,
                     unsigned flags /* none currently defined */,
diff -r f9a0e9b4829d -r 613d97055444 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Wed Dec 19 14:16:30 2012 +0000
+++ b/tools/libxl/libxl_create.c	Wed Dec 19 14:33:24 2012 +0000
@@ -24,43 +24,6 @@
 #include <xenguest.h>
 #include <xen/hvm/hvm_info_table.h>
 
-void libxl_domain_config_init(libxl_domain_config *d_config)
-{
-    memset(d_config, 0, sizeof(*d_config));
-    libxl_domain_create_info_init(&d_config->c_info);
-    libxl_domain_build_info_init(&d_config->b_info);
-}
-
-void libxl_domain_config_dispose(libxl_domain_config *d_config)
-{
-    int i;
-
-    for (i=0; i<d_config->num_disks; i++)
-        libxl_device_disk_dispose(&d_config->disks[i]);
-    free(d_config->disks);
-
-    for (i=0; i<d_config->num_nics; i++)
-        libxl_device_nic_dispose(&d_config->nics[i]);
-    free(d_config->nics);
-
-    for (i=0; i<d_config->num_pcidevs; i++)
-        libxl_device_pci_dispose(&d_config->pcidevs[i]);
-    free(d_config->pcidevs);
-
-    for (i=0; i<d_config->num_vfbs; i++)
-        libxl_device_vfb_dispose(&d_config->vfbs[i]);
-    free(d_config->vfbs);
-
-    for (i=0; i<d_config->num_vkbs; i++)
-        libxl_device_vkb_dispose(&d_config->vkbs[i]);
-    free(d_config->vkbs);
-
-    libxl_device_vtpm_list_free(d_config->vtpms, d_config->num_vtpms);
-
-    libxl_domain_create_info_dispose(&d_config->c_info);
-    libxl_domain_build_info_dispose(&d_config->b_info);
-}
-
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                          libxl_domain_create_info *c_info)
 {
diff -r f9a0e9b4829d -r 613d97055444 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Wed Dec 19 14:16:30 2012 +0000
+++ b/tools/libxl/libxl_json.c	Wed Dec 19 14:33:24 2012 +0000
@@ -786,158 +786,6 @@ out:
     return ret;
 }
 
-yajl_gen_status libxl_domain_config_gen_json(yajl_gen hand,
-                                             libxl_domain_config *p)
-{
-    yajl_gen_status s;
-    int i;
-
-    s = yajl_gen_map_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"c_info",
-                        sizeof("c_info")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_domain_create_info_gen_json(hand, &p->c_info);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"b_info",
-                        sizeof("b_info")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_domain_build_info_gen_json(hand, &p->b_info);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"disks",
-                        sizeof("disks")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_disks; i++) {
-        s = libxl_device_disk_gen_json(hand, &p->disks[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"nics",
-                        sizeof("nics")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_nics; i++) {
-        s = libxl_device_nic_gen_json(hand, &p->nics[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"pcidevs",
-                        sizeof("pcidevs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_pcidevs; i++) {
-        s = libxl_device_pci_gen_json(hand, &p->pcidevs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"vfbs",
-                        sizeof("vfbs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_vfbs; i++) {
-        s = libxl_device_vfb_gen_json(hand, &p->vfbs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"vkbs",
-                        sizeof("vkbs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_vkbs; i++) {
-        s = libxl_device_vkb_gen_json(hand, &p->vkbs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_poweroff",
-                        sizeof("on_poweroff")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_poweroff);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_reboot",
-                        sizeof("on_reboot")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_reboot);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_watchdog",
-                        sizeof("on_watchdog")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_watchdog);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_crash",
-                        sizeof("on_crash")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_crash);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_map_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    out:
-    return s;
-}
-
-char *libxl_domain_config_to_json(libxl_ctx *ctx, libxl_domain_config *p)
-{
-    return libxl__object_to_json(ctx, "libxl_domain_config",
-                        (libxl__gen_json_callback)&libxl_domain_config_gen_json,
-                        (void *)p);
-}
-
 /*
  * Local variables:
  * mode: C
diff -r f9a0e9b4829d -r 613d97055444 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Dec 19 14:16:30 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Wed Dec 19 14:33:24 2012 +0000
@@ -402,6 +402,23 @@ libxl_device_vtpm = Struct("device_vtpm"
     ("uuid",             libxl_uuid),
 ])
 
+libxl_domain_config = Struct("domain_config", [
+    ("c_info", libxl_domain_create_info),
+    ("b_info", libxl_domain_build_info),
+
+    ("disks", Array(libxl_device_disk, "num_disks")),
+    ("nics", Array(libxl_device_nic, "num_nics")),
+    ("pcidevs", Array(libxl_device_pci, "num_pcidevs")),
+    ("vfbs", Array(libxl_device_vfb, "num_vfbs")),
+    ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
+    ("vtpms", Array(libxl_device_vtpm, "num_vtpms")),
+
+    ("on_poweroff", libxl_action_on_shutdown),
+    ("on_reboot", libxl_action_on_shutdown),
+    ("on_watchdog", libxl_action_on_shutdown),
+    ("on_crash", libxl_action_on_shutdown),
+    ])
+
 libxl_diskinfo = Struct("diskinfo", [
     ("backend", string),
     ("backend_id", uint32),
diff -r f9a0e9b4829d -r 613d97055444 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Wed Dec 19 14:16:30 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Wed Dec 19 14:33:24 2012 +0000
@@ -283,6 +283,7 @@ if __name__ == '__main__':
         "cpupoolinfo",
         "domain_create_info",
         "domain_build_info",
+        "domain_config",
         "vcpuinfo",
         "event",
         ]

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TliiZ-0007DK-Hm; Thu, 20 Dec 2012 16:11:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiY-0007BX-AT
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:30 +0000
Received: from [85.158.143.35:6775] by server-1.bemta-4.messagelabs.com id
	38/AD-28401-1B833D05; Thu, 20 Dec 2012 16:11:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1356019880!13251492!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12984 invoked from network); 20 Dec 2012 16:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiO-0005gM-MG
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiO-0006Cx-Kw
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:20 +0000
Message-Id: <E1TliiO-0006Cx-Kw@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: move definition of
	libxl_domain_config into the IDL
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355927604 0
# Node ID 613d9705544416f80ade81a773aa25b581348a00
# Parent  f9a0e9b4829d6a841a7393532dc5fff25ba3a750
libxl: move definition of libxl_domain_config into the IDL

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r f9a0e9b4829d -r 613d97055444 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Wed Dec 19 14:16:30 2012 +0000
+++ b/tools/libxl/libxl.h	Wed Dec 19 14:33:24 2012 +0000
@@ -474,26 +474,6 @@ typedef struct {
 
 #define LIBXL_VERSION 0
 
-typedef struct {
-    libxl_domain_create_info c_info;
-    libxl_domain_build_info b_info;
-
-    int num_disks, num_nics, num_pcidevs, num_vfbs, num_vkbs, num_vtpms;
-
-    libxl_device_disk *disks;
-    libxl_device_nic *nics;
-    libxl_device_pci *pcidevs;
-    libxl_device_vfb *vfbs;
-    libxl_device_vkb *vkbs;
-    libxl_device_vtpm *vtpms;
-
-    libxl_action_on_shutdown on_poweroff;
-    libxl_action_on_shutdown on_reboot;
-    libxl_action_on_shutdown on_watchdog;
-    libxl_action_on_shutdown on_crash;
-} libxl_domain_config;
-char *libxl_domain_config_to_json(libxl_ctx *ctx, libxl_domain_config *p);
-
 /* context functions */
 int libxl_ctx_alloc(libxl_ctx **pctx, int version,
                     unsigned flags /* none currently defined */,
diff -r f9a0e9b4829d -r 613d97055444 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Wed Dec 19 14:16:30 2012 +0000
+++ b/tools/libxl/libxl_create.c	Wed Dec 19 14:33:24 2012 +0000
@@ -24,43 +24,6 @@
 #include <xenguest.h>
 #include <xen/hvm/hvm_info_table.h>
 
-void libxl_domain_config_init(libxl_domain_config *d_config)
-{
-    memset(d_config, 0, sizeof(*d_config));
-    libxl_domain_create_info_init(&d_config->c_info);
-    libxl_domain_build_info_init(&d_config->b_info);
-}
-
-void libxl_domain_config_dispose(libxl_domain_config *d_config)
-{
-    int i;
-
-    for (i=0; i<d_config->num_disks; i++)
-        libxl_device_disk_dispose(&d_config->disks[i]);
-    free(d_config->disks);
-
-    for (i=0; i<d_config->num_nics; i++)
-        libxl_device_nic_dispose(&d_config->nics[i]);
-    free(d_config->nics);
-
-    for (i=0; i<d_config->num_pcidevs; i++)
-        libxl_device_pci_dispose(&d_config->pcidevs[i]);
-    free(d_config->pcidevs);
-
-    for (i=0; i<d_config->num_vfbs; i++)
-        libxl_device_vfb_dispose(&d_config->vfbs[i]);
-    free(d_config->vfbs);
-
-    for (i=0; i<d_config->num_vkbs; i++)
-        libxl_device_vkb_dispose(&d_config->vkbs[i]);
-    free(d_config->vkbs);
-
-    libxl_device_vtpm_list_free(d_config->vtpms, d_config->num_vtpms);
-
-    libxl_domain_create_info_dispose(&d_config->c_info);
-    libxl_domain_build_info_dispose(&d_config->b_info);
-}
-
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                          libxl_domain_create_info *c_info)
 {
diff -r f9a0e9b4829d -r 613d97055444 tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Wed Dec 19 14:16:30 2012 +0000
+++ b/tools/libxl/libxl_json.c	Wed Dec 19 14:33:24 2012 +0000
@@ -786,158 +786,6 @@ out:
     return ret;
 }
 
-yajl_gen_status libxl_domain_config_gen_json(yajl_gen hand,
-                                             libxl_domain_config *p)
-{
-    yajl_gen_status s;
-    int i;
-
-    s = yajl_gen_map_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"c_info",
-                        sizeof("c_info")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_domain_create_info_gen_json(hand, &p->c_info);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"b_info",
-                        sizeof("b_info")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_domain_build_info_gen_json(hand, &p->b_info);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"disks",
-                        sizeof("disks")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_disks; i++) {
-        s = libxl_device_disk_gen_json(hand, &p->disks[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"nics",
-                        sizeof("nics")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_nics; i++) {
-        s = libxl_device_nic_gen_json(hand, &p->nics[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"pcidevs",
-                        sizeof("pcidevs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_pcidevs; i++) {
-        s = libxl_device_pci_gen_json(hand, &p->pcidevs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"vfbs",
-                        sizeof("vfbs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_vfbs; i++) {
-        s = libxl_device_vfb_gen_json(hand, &p->vfbs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"vkbs",
-                        sizeof("vkbs")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = yajl_gen_array_open(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    for (i = 0; i < p->num_vkbs; i++) {
-        s = libxl_device_vkb_gen_json(hand, &p->vkbs[i]);
-        if (s != yajl_gen_status_ok)
-            goto out;
-    }
-    s = yajl_gen_array_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_poweroff",
-                        sizeof("on_poweroff")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_poweroff);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_reboot",
-                        sizeof("on_reboot")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_reboot);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_watchdog",
-                        sizeof("on_watchdog")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_watchdog);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_string(hand, (const unsigned char *)"on_crash",
-                        sizeof("on_crash")-1);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    s = libxl_action_on_shutdown_gen_json(hand, &p->on_crash);
-    if (s != yajl_gen_status_ok)
-        goto out;
-
-    s = yajl_gen_map_close(hand);
-    if (s != yajl_gen_status_ok)
-        goto out;
-    out:
-    return s;
-}
-
-char *libxl_domain_config_to_json(libxl_ctx *ctx, libxl_domain_config *p)
-{
-    return libxl__object_to_json(ctx, "libxl_domain_config",
-                        (libxl__gen_json_callback)&libxl_domain_config_gen_json,
-                        (void *)p);
-}
-
 /*
  * Local variables:
  * mode: C
diff -r f9a0e9b4829d -r 613d97055444 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Dec 19 14:16:30 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Wed Dec 19 14:33:24 2012 +0000
@@ -402,6 +402,23 @@ libxl_device_vtpm = Struct("device_vtpm"
     ("uuid",             libxl_uuid),
 ])
 
+libxl_domain_config = Struct("domain_config", [
+    ("c_info", libxl_domain_create_info),
+    ("b_info", libxl_domain_build_info),
+
+    ("disks", Array(libxl_device_disk, "num_disks")),
+    ("nics", Array(libxl_device_nic, "num_nics")),
+    ("pcidevs", Array(libxl_device_pci, "num_pcidevs")),
+    ("vfbs", Array(libxl_device_vfb, "num_vfbs")),
+    ("vkbs", Array(libxl_device_vkb, "num_vkbs")),
+    ("vtpms", Array(libxl_device_vtpm, "num_vtpms")),
+
+    ("on_poweroff", libxl_action_on_shutdown),
+    ("on_reboot", libxl_action_on_shutdown),
+    ("on_watchdog", libxl_action_on_shutdown),
+    ("on_crash", libxl_action_on_shutdown),
+    ])
+
 libxl_diskinfo = Struct("diskinfo", [
     ("backend", string),
     ("backend_id", uint32),
diff -r f9a0e9b4829d -r 613d97055444 tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Wed Dec 19 14:16:30 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Wed Dec 19 14:33:24 2012 +0000
@@ -283,6 +283,7 @@ if __name__ == '__main__':
         "cpupoolinfo",
         "domain_create_info",
         "domain_build_info",
+        "domain_config",
         "vcpuinfo",
         "event",
         ]

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tliie-0007HH-NE; Thu, 20 Dec 2012 16:11:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tliid-0007Fc-7L
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:35 +0000
Received: from [85.158.143.35:7021] by server-2.bemta-4.messagelabs.com id
	B3/7F-30861-6B833D05; Thu, 20 Dec 2012 16:11:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1356019876!3943194!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19444 invoked from network); 20 Dec 2012 16:11:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiK-0005fh-9v
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiK-0006B1-8d
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:16 +0000
Message-Id: <E1TliiK-0006B1-8d@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: initialise dom_{xen, io,
	cow}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926585 0
# Node ID c5f7a894c6695ce6bb45a889b489ae6b84184ae6
# Parent  8dad184a8e2a9c539c4c359f4cab165f5eac29e0
xen: arm: initialise dom_{xen,io,cow}

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 8dad184a8e2a -r c5f7a894c669 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:25 2012 +0000
@@ -10,6 +10,5 @@ x:	mov pc, lr
 DUMMY(nr_irqs_gsi);
 
 /* Other */
-DUMMY(dom_cow);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
diff -r 8dad184a8e2a -r c5f7a894c669 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/arch/arm/mm.c	Wed Dec 19 14:16:25 2012 +0000
@@ -30,12 +30,13 @@
 #include <xen/event.h>
 #include <xen/guest_access.h>
 #include <xen/domain_page.h>
+#include <xen/err.h>
 #include <asm/page.h>
 #include <asm/current.h>
 #include <public/memory.h>
 #include <xen/sched.h>
 
-struct domain *dom_xen, *dom_io;
+struct domain *dom_xen, *dom_io, *dom_cow;
 
 /* Static start-of-day pagetables that we use before the allocators are up */
 lpae_t xen_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
@@ -206,6 +207,31 @@ void unmap_domain_page(const void *va)
     local_irq_restore(flags);
 }
 
+void __init arch_init_memory(void)
+{
+    /*
+     * Initialise our DOMID_XEN domain.
+     * Any Xen-heap pages that we will allow to be mapped will have
+     * their domain field set to dom_xen.
+     */
+    dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
+    BUG_ON(IS_ERR(dom_xen));
+
+    /*
+     * Initialise our DOMID_IO domain.
+     * This domain owns I/O pages that are within the range of the page_info
+     * array. Mappings occur at the priv of the caller.
+     */
+    dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0);
+    BUG_ON(IS_ERR(dom_io));
+
+    /*
+     * Initialise our COW domain.
+     * This domain owns sharable pages.
+     */
+    dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
+    BUG_ON(IS_ERR(dom_cow));
+}
 
 /* Boot-time pagetable setup.
  * Changes here may need matching changes in head.S */
diff -r 8dad184a8e2a -r c5f7a894c669 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/arch/arm/setup.c	Wed Dec 19 14:16:25 2012 +0000
@@ -265,6 +265,8 @@ void __init start_xen(unsigned long boot
 
     rcu_init();
 
+    arch_init_memory();
+
     local_irq_enable();
 
     smp_prepare_cpus(cpus);
diff -r 8dad184a8e2a -r c5f7a894c669 xen/include/asm-arm/setup.h
--- a/xen/include/asm-arm/setup.h	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/include/asm-arm/setup.h	Wed Dec 19 14:16:25 2012 +0000
@@ -3,6 +3,8 @@
 
 #include <public/version.h>
 
+void arch_init_memory(void);
+
 void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx);
 
 void arch_get_xen_caps(xen_capabilities_info_t *info);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:37 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tliie-0007HH-NE; Thu, 20 Dec 2012 16:11:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tliid-0007Fc-7L
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:35 +0000
Received: from [85.158.143.35:7021] by server-2.bemta-4.messagelabs.com id
	B3/7F-30861-6B833D05; Thu, 20 Dec 2012 16:11:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1356019876!3943194!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19444 invoked from network); 20 Dec 2012 16:11:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiK-0005fh-9v
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiK-0006B1-8d
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:16 +0000
Message-Id: <E1TliiK-0006B1-8d@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: initialise dom_{xen, io,
	cow}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926585 0
# Node ID c5f7a894c6695ce6bb45a889b489ae6b84184ae6
# Parent  8dad184a8e2a9c539c4c359f4cab165f5eac29e0
xen: arm: initialise dom_{xen,io,cow}

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 8dad184a8e2a -r c5f7a894c669 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/arch/arm/dummy.S	Wed Dec 19 14:16:25 2012 +0000
@@ -10,6 +10,5 @@ x:	mov pc, lr
 DUMMY(nr_irqs_gsi);
 
 /* Other */
-DUMMY(dom_cow);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
diff -r 8dad184a8e2a -r c5f7a894c669 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/arch/arm/mm.c	Wed Dec 19 14:16:25 2012 +0000
@@ -30,12 +30,13 @@
 #include <xen/event.h>
 #include <xen/guest_access.h>
 #include <xen/domain_page.h>
+#include <xen/err.h>
 #include <asm/page.h>
 #include <asm/current.h>
 #include <public/memory.h>
 #include <xen/sched.h>
 
-struct domain *dom_xen, *dom_io;
+struct domain *dom_xen, *dom_io, *dom_cow;
 
 /* Static start-of-day pagetables that we use before the allocators are up */
 lpae_t xen_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
@@ -206,6 +207,31 @@ void unmap_domain_page(const void *va)
     local_irq_restore(flags);
 }
 
+void __init arch_init_memory(void)
+{
+    /*
+     * Initialise our DOMID_XEN domain.
+     * Any Xen-heap pages that we will allow to be mapped will have
+     * their domain field set to dom_xen.
+     */
+    dom_xen = domain_create(DOMID_XEN, DOMCRF_dummy, 0);
+    BUG_ON(IS_ERR(dom_xen));
+
+    /*
+     * Initialise our DOMID_IO domain.
+     * This domain owns I/O pages that are within the range of the page_info
+     * array. Mappings occur at the priv of the caller.
+     */
+    dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0);
+    BUG_ON(IS_ERR(dom_io));
+
+    /*
+     * Initialise our COW domain.
+     * This domain owns sharable pages.
+     */
+    dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
+    BUG_ON(IS_ERR(dom_cow));
+}
 
 /* Boot-time pagetable setup.
  * Changes here may need matching changes in head.S */
diff -r 8dad184a8e2a -r c5f7a894c669 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/arch/arm/setup.c	Wed Dec 19 14:16:25 2012 +0000
@@ -265,6 +265,8 @@ void __init start_xen(unsigned long boot
 
     rcu_init();
 
+    arch_init_memory();
+
     local_irq_enable();
 
     smp_prepare_cpus(cpus);
diff -r 8dad184a8e2a -r c5f7a894c669 xen/include/asm-arm/setup.h
--- a/xen/include/asm-arm/setup.h	Wed Dec 19 14:16:25 2012 +0000
+++ b/xen/include/asm-arm/setup.h	Wed Dec 19 14:16:25 2012 +0000
@@ -3,6 +3,8 @@
 
 #include <public/version.h>
 
+void arch_init_memory(void);
+
 void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx);
 
 void arch_get_xen_caps(xen_capabilities_info_t *info);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tliin-0007NW-QV; Thu, 20 Dec 2012 16:11:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tliim-0007Mb-Bo
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:44 +0000
Received: from [85.158.138.51:38709] by server-10.bemta-3.messagelabs.com id
	AB/38-07616-FB833D05; Thu, 20 Dec 2012 16:11:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1356019870!29773015!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27688 invoked from network); 20 Dec 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiD-0005f4-Ro
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiD-000677-9i
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:09 +0000
Message-Id: <E1TliiD-000677-9i@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86,
	amd: Disable way access filter on Piledriver CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andre Przywara <osp@andrep.de>
# Date 1355913729 -3600
# Node ID 5fb0b8b838dab0b331abfa675fd2b2214ac90760
# Parent  b04de677de31f26ba4b8f2f382ca4dfffcff9a79
x86, amd: Disable way access filter on Piledriver CPUs

The Way Access Filter in recent AMD CPUs may hurt the performance of
some workloads, caused by aliasing issues in the L1 cache.
This patch disables it on the affected CPUs.

The issue is similar to that one of last year:
http://lkml.indiana.edu/hypermail/linux/kernel/1107.3/00041.html
This new patch does not replace the old one, we just need another
quirk for newer CPUs.

The performance penalty without the patch depends on the
circumstances, but is a bit less than the last year's 3%.

The workloads affected would be those that access code from the same
physical page under different virtual addresses, so different
processes using the same libraries with ASLR or multiple instances of
PIE-binaries. The code needs to be accessed simultaneously from both
cores of the same compute unit.

More details can be found here:
http://developer.amd.com/Assets/SharedL1InstructionCacheonAMD15hCPU.pdf

CPUs affected are anything with the core known as Piledriver.
That includes the new parts of the AMD A-Series (aka Trinity) and the
just released new CPUs of the FX-Series (aka Vishera).
The model numbering is a bit odd here: FX CPUs have model 2,
A-Series has model 10h, with possible extensions to 1Fh. Hence the
range of model ids.

Signed-off-by: Andre Przywara <osp@andrep.de>

Add and use MSR_AMD64_IC_CFG. Update the value whenever it is found to
not have all bits set, rather than just when it's zero.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r b04de677de31 -r 5fb0b8b838da xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Tue Dec 18 18:16:52 2012 +0000
+++ b/xen/arch/x86/cpu/amd.c	Wed Dec 19 11:42:09 2012 +0100
@@ -448,6 +448,14 @@ static void __devinit init_amd(struct cp
 		}
 	}
 
+	/*
+	 * The way access filter has a performance penalty on some workloads.
+	 * Disable it on the affected CPUs.
+	 */
+	if (c->x86 == 0x15 && c->x86_model >= 0x02 && c->x86_model < 0x20 &&
+	    !rdmsr_safe(MSR_AMD64_IC_CFG, value) && (value & 0x1e) != 0x1e)
+		wrmsr_safe(MSR_AMD64_IC_CFG, value | 0x1e);
+
         amd_get_topology(c);
 
 	/* Pointless to use MWAIT on Family10 as it does not deep sleep. */
diff -r b04de677de31 -r 5fb0b8b838da xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Tue Dec 18 18:16:52 2012 +0000
+++ b/xen/include/asm-x86/msr-index.h	Wed Dec 19 11:42:09 2012 +0100
@@ -211,6 +211,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:46 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tliin-0007NW-QV; Thu, 20 Dec 2012 16:11:45 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tliim-0007Mb-Bo
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:44 +0000
Received: from [85.158.138.51:38709] by server-10.bemta-3.messagelabs.com id
	AB/38-07616-FB833D05; Thu, 20 Dec 2012 16:11:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1356019870!29773015!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27688 invoked from network); 20 Dec 2012 16:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiD-0005f4-Ro
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiD-000677-9i
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:09 +0000
Message-Id: <E1TliiD-000677-9i@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86,
	amd: Disable way access filter on Piledriver CPUs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Andre Przywara <osp@andrep.de>
# Date 1355913729 -3600
# Node ID 5fb0b8b838dab0b331abfa675fd2b2214ac90760
# Parent  b04de677de31f26ba4b8f2f382ca4dfffcff9a79
x86, amd: Disable way access filter on Piledriver CPUs

The Way Access Filter in recent AMD CPUs may hurt the performance of
some workloads, caused by aliasing issues in the L1 cache.
This patch disables it on the affected CPUs.

The issue is similar to that one of last year:
http://lkml.indiana.edu/hypermail/linux/kernel/1107.3/00041.html
This new patch does not replace the old one, we just need another
quirk for newer CPUs.

The performance penalty without the patch depends on the
circumstances, but is a bit less than the last year's 3%.

The workloads affected would be those that access code from the same
physical page under different virtual addresses, so different
processes using the same libraries with ASLR or multiple instances of
PIE-binaries. The code needs to be accessed simultaneously from both
cores of the same compute unit.

More details can be found here:
http://developer.amd.com/Assets/SharedL1InstructionCacheonAMD15hCPU.pdf

CPUs affected are anything with the core known as Piledriver.
That includes the new parts of the AMD A-Series (aka Trinity) and the
just released new CPUs of the FX-Series (aka Vishera).
The model numbering is a bit odd here: FX CPUs have model 2,
A-Series has model 10h, with possible extensions to 1Fh. Hence the
range of model ids.

Signed-off-by: Andre Przywara <osp@andrep.de>

Add and use MSR_AMD64_IC_CFG. Update the value whenever it is found to
not have all bits set, rather than just when it's zero.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r b04de677de31 -r 5fb0b8b838da xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Tue Dec 18 18:16:52 2012 +0000
+++ b/xen/arch/x86/cpu/amd.c	Wed Dec 19 11:42:09 2012 +0100
@@ -448,6 +448,14 @@ static void __devinit init_amd(struct cp
 		}
 	}
 
+	/*
+	 * The way access filter has a performance penalty on some workloads.
+	 * Disable it on the affected CPUs.
+	 */
+	if (c->x86 == 0x15 && c->x86_model >= 0x02 && c->x86_model < 0x20 &&
+	    !rdmsr_safe(MSR_AMD64_IC_CFG, value) && (value & 0x1e) != 0x1e)
+		wrmsr_safe(MSR_AMD64_IC_CFG, value | 0x1e);
+
         amd_get_topology(c);
 
 	/* Pointless to use MWAIT on Family10 as it does not deep sleep. */
diff -r b04de677de31 -r 5fb0b8b838da xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Tue Dec 18 18:16:52 2012 +0000
+++ b/xen/include/asm-x86/msr-index.h	Wed Dec 19 11:42:09 2012 +0100
@@ -211,6 +211,7 @@
 
 /* AMD64 MSRs */
 #define MSR_AMD64_NB_CFG		0xc001001f
+#define MSR_AMD64_IC_CFG		0xc0011021
 #define MSR_AMD64_DC_CFG		0xc0011022
 #define AMD64_NB_CFG_CF8_EXT_ENABLE_BIT	46
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:57 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tliiy-0007Qc-To; Thu, 20 Dec 2012 16:11:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tliix-0007Q2-Lf
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:55 +0000
Received: from [85.158.137.99:26577] by server-4.bemta-3.messagelabs.com id
	B8/BA-31835-AC833D05; Thu, 20 Dec 2012 16:11:54 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1356019878!17128969!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23307 invoked from network); 20 Dec 2012 16:11:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-0005fq-Rk
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-0006Bk-Pd
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Message-Id: <E1TliiL-0006Bk-Pd@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: fix long lines in entry.S
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926587 0
# Node ID 32db97a8db862a89519495ef8f1f1c5eb48d48a2
# Parent  519ae882d3ff0458450f693ec2427c348227fd22
xen: arm: fix long lines in entry.S

This is a purely whitespace change.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 519ae882d3ff -r 32db97a8db86 xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S	Wed Dec 19 14:16:27 2012 +0000
+++ b/xen/arch/arm/entry.S	Wed Dec 19 14:16:27 2012 +0000
@@ -11,22 +11,22 @@
 #define RESTORE_BANKED(mode) \
 	RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
 
-#define SAVE_ALL											\
-	sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */					\
-	push {r0-r12}; /* Save R0-R12 */								\
-													\
-	mrs r11, ELR_hyp;		/* ELR_hyp is return address. */				\
-	str r11, [sp, #UREGS_pc];									\
-													\
-	str lr, [sp, #UREGS_lr];									\
-													\
-	add r11, sp, #UREGS_kernel_sizeof+4;								\
-	str r11, [sp, #UREGS_sp];									\
-													\
-	mrs r11, SPSR_hyp;										\
-	str r11, [sp, #UREGS_cpsr];									\
-	and r11, #PSR_MODE_MASK;									\
-	cmp r11, #PSR_MODE_HYP;										\
+#define SAVE_ALL							\
+	sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */	\
+	push {r0-r12}; /* Save R0-R12 */				\
+									\
+	mrs r11, ELR_hyp;		/* ELR_hyp is return address. */\
+	str r11, [sp, #UREGS_pc];					\
+									\
+	str lr, [sp, #UREGS_lr];					\
+									\
+	add r11, sp, #UREGS_kernel_sizeof+4;				\
+	str r11, [sp, #UREGS_sp];					\
+									\
+	mrs r11, SPSR_hyp;						\
+	str r11, [sp, #UREGS_cpsr];					\
+	and r11, #PSR_MODE_MASK;					\
+	cmp r11, #PSR_MODE_HYP;						\
 	blne save_guest_regs
 
 save_guest_regs:
@@ -43,25 +43,25 @@ save_guest_regs:
 	SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
 	mov pc, lr
 
-#define DEFINE_TRAP_ENTRY(trap)										\
-	ALIGN;												\
-trap_##trap:												\
-	SAVE_ALL;											\
-	cpsie i; 	/* local_irq_enable */								\
-	adr lr, return_from_trap;									\
-	mov r0, sp;											\
-	mov r11, sp;											\
-	bic sp, #7; /* Align the stack pointer (noop on guest trap) */					\
+#define DEFINE_TRAP_ENTRY(trap)						\
+	ALIGN;								\
+trap_##trap:								\
+	SAVE_ALL;							\
+	cpsie i; 	/* local_irq_enable */				\
+	adr lr, return_from_trap;					\
+	mov r0, sp;							\
+	mov r11, sp;							\
+	bic sp, #7; /* Align the stack pointer (noop on guest trap) */	\
 	b do_trap_##trap
 
-#define DEFINE_TRAP_ENTRY_NOIRQ(trap)									\
-	ALIGN;												\
-trap_##trap:												\
-	SAVE_ALL;											\
-	adr lr, return_from_trap;									\
-	mov r0, sp;											\
-	mov r11, sp;											\
-	bic sp, #7; /* Align the stack pointer (noop on guest trap) */					\
+#define DEFINE_TRAP_ENTRY_NOIRQ(trap)					\
+	ALIGN;								\
+trap_##trap:								\
+	SAVE_ALL;							\
+	adr lr, return_from_trap;					\
+	mov r0, sp;							\
+	mov r11, sp;							\
+	bic sp, #7; /* Align the stack pointer (noop on guest trap) */	\
 	b do_trap_##trap
 
 .globl hyp_traps_vector

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:11:57 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:11:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tliiy-0007Qc-To; Thu, 20 Dec 2012 16:11:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tliix-0007Q2-Lf
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:55 +0000
Received: from [85.158.137.99:26577] by server-4.bemta-3.messagelabs.com id
	B8/BA-31835-AC833D05; Thu, 20 Dec 2012 16:11:54 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-217.messagelabs.com!1356019878!17128969!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23307 invoked from network); 20 Dec 2012 16:11:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-0005fq-Rk
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiL-0006Bk-Pd
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:17 +0000
Message-Id: <E1TliiL-0006Bk-Pd@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: fix long lines in entry.S
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926587 0
# Node ID 32db97a8db862a89519495ef8f1f1c5eb48d48a2
# Parent  519ae882d3ff0458450f693ec2427c348227fd22
xen: arm: fix long lines in entry.S

This is a purely whitespace change.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 519ae882d3ff -r 32db97a8db86 xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S	Wed Dec 19 14:16:27 2012 +0000
+++ b/xen/arch/arm/entry.S	Wed Dec 19 14:16:27 2012 +0000
@@ -11,22 +11,22 @@
 #define RESTORE_BANKED(mode) \
 	RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
 
-#define SAVE_ALL											\
-	sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */					\
-	push {r0-r12}; /* Save R0-R12 */								\
-													\
-	mrs r11, ELR_hyp;		/* ELR_hyp is return address. */				\
-	str r11, [sp, #UREGS_pc];									\
-													\
-	str lr, [sp, #UREGS_lr];									\
-													\
-	add r11, sp, #UREGS_kernel_sizeof+4;								\
-	str r11, [sp, #UREGS_sp];									\
-													\
-	mrs r11, SPSR_hyp;										\
-	str r11, [sp, #UREGS_cpsr];									\
-	and r11, #PSR_MODE_MASK;									\
-	cmp r11, #PSR_MODE_HYP;										\
+#define SAVE_ALL							\
+	sub sp, #(UREGS_R8_fiq - UREGS_sp); /* SP, LR, SPSR, PC */	\
+	push {r0-r12}; /* Save R0-R12 */				\
+									\
+	mrs r11, ELR_hyp;		/* ELR_hyp is return address. */\
+	str r11, [sp, #UREGS_pc];					\
+									\
+	str lr, [sp, #UREGS_lr];					\
+									\
+	add r11, sp, #UREGS_kernel_sizeof+4;				\
+	str r11, [sp, #UREGS_sp];					\
+									\
+	mrs r11, SPSR_hyp;						\
+	str r11, [sp, #UREGS_cpsr];					\
+	and r11, #PSR_MODE_MASK;					\
+	cmp r11, #PSR_MODE_HYP;						\
 	blne save_guest_regs
 
 save_guest_regs:
@@ -43,25 +43,25 @@ save_guest_regs:
 	SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
 	mov pc, lr
 
-#define DEFINE_TRAP_ENTRY(trap)										\
-	ALIGN;												\
-trap_##trap:												\
-	SAVE_ALL;											\
-	cpsie i; 	/* local_irq_enable */								\
-	adr lr, return_from_trap;									\
-	mov r0, sp;											\
-	mov r11, sp;											\
-	bic sp, #7; /* Align the stack pointer (noop on guest trap) */					\
+#define DEFINE_TRAP_ENTRY(trap)						\
+	ALIGN;								\
+trap_##trap:								\
+	SAVE_ALL;							\
+	cpsie i; 	/* local_irq_enable */				\
+	adr lr, return_from_trap;					\
+	mov r0, sp;							\
+	mov r11, sp;							\
+	bic sp, #7; /* Align the stack pointer (noop on guest trap) */	\
 	b do_trap_##trap
 
-#define DEFINE_TRAP_ENTRY_NOIRQ(trap)									\
-	ALIGN;												\
-trap_##trap:												\
-	SAVE_ALL;											\
-	adr lr, return_from_trap;									\
-	mov r0, sp;											\
-	mov r11, sp;											\
-	bic sp, #7; /* Align the stack pointer (noop on guest trap) */					\
+#define DEFINE_TRAP_ENTRY_NOIRQ(trap)					\
+	ALIGN;								\
+trap_##trap:								\
+	SAVE_ALL;							\
+	adr lr, return_from_trap;					\
+	mov r0, sp;							\
+	mov r11, sp;							\
+	bic sp, #7; /* Align the stack pointer (noop on guest trap) */	\
 	b do_trap_##trap
 
 .globl hyp_traps_vector

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:12:01 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:12:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tlij3-0007TP-EN; Thu, 20 Dec 2012 16:12:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tlij0-0007Rc-H5
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:59 +0000
Received: from [85.158.137.99:53895] by server-2.bemta-3.messagelabs.com id
	9C/CC-11239-DC833D05; Thu, 20 Dec 2012 16:11:57 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1356019879!17973448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24843 invoked from network); 20 Dec 2012 16:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiN-0005gG-L5
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiN-0006CT-If
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:19 +0000
Message-Id: <E1TliiN-0006CT-If@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: introduce arm32 as a
	subarch of arm.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926590 0
# Node ID b094ba4bf9853e408a710664cb2995b4737cf165
# Parent  984086ca8ca0de17b5cd3253bc9579d072ec43bc
xen: arm: introduce arm32 as a subarch of arm.

- move 32-bit specific files into subarch specific arm32 subdirectory.
- move gic.h to xen/include/asm-arm (it is needed from both subarch
  and generic code).
- make the appropriate build and config file changes to support
  XEN_TARGET_ARCH=arm32.

This prepares us for an eventual 64-bit subarch.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 984086ca8ca0 -r b094ba4bf985 Config.mk
--- a/Config.mk	Wed Dec 19 14:16:29 2012 +0000
+++ b/Config.mk	Wed Dec 19 14:16:30 2012 +0000
@@ -14,7 +14,9 @@ debug ?= y
 debug_symbols ?= $(debug)
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
-                         -e s/i86pc/x86_32/ -e s/amd64/x86_64/ -e s/arm.*/arm/)
+                         -e s/i86pc/x86_32/ -e s/amd64/x86_64/ \
+                         -e s/armv7.*/arm32/)
+
 XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
 XEN_OS              ?= $(shell uname -s)
 
diff -r 984086ca8ca0 -r b094ba4bf985 config/arm.mk
--- a/config/arm.mk	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-CONFIG_ARM := y
-CONFIG_ARM_32 := y
-CONFIG_ARM_$(XEN_OS) := y
-
-# -march= -mcpu=
-
-# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
-CFLAGS += -marm
-
-HAS_PL011 := y
-
-# Use only if calling $(LD) directly.
-#LDFLAGS_DIRECT_OpenBSD = _obsd
-#LDFLAGS_DIRECT_FreeBSD = _fbsd
-LDFLAGS_DIRECT_Linux = _linux
-LDFLAGS_DIRECT += -marmelf$(LDFLAGS_DIRECT_$(XEN_OS))_eabi
-
-CONFIG_LOAD_ADDRESS ?= 0x80000000
diff -r 984086ca8ca0 -r b094ba4bf985 config/arm32.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/arm32.mk	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+CONFIG_ARM := y
+CONFIG_ARM_32 := y
+CONFIG_ARM_$(XEN_OS) := y
+
+# -march= -mcpu=
+
+# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
+CFLAGS += -marm
+
+HAS_PL011 := y
+
+# Use only if calling $(LD) directly.
+#LDFLAGS_DIRECT_OpenBSD = _obsd
+#LDFLAGS_DIRECT_FreeBSD = _fbsd
+LDFLAGS_DIRECT_Linux = _linux
+LDFLAGS_DIRECT += -marmelf$(LDFLAGS_DIRECT_$(XEN_OS))_eabi
+
+CONFIG_LOAD_ADDRESS ?= 0x80000000
diff -r 984086ca8ca0 -r b094ba4bf985 xen/Rules.mk
--- a/xen/Rules.mk	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/Rules.mk	Wed Dec 19 14:16:30 2012 +0000
@@ -28,7 +28,7 @@ endif
 # Set ARCH/SUBARCH appropriately.
 override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
 override TARGET_ARCH     := $(shell echo $(XEN_TARGET_ARCH) | \
-                              sed -e 's/x86.*/x86/')
+                              sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
 
 TARGET := $(BASEDIR)/xen
 
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/Makefile	Wed Dec 19 14:16:30 2012 +0000
@@ -1,8 +1,7 @@
-subdir-y += lib
+subdir-$(arm32) += arm32
 
 obj-y += dummy.o
 obj-y += early_printk.o
-obj-y += entry.o
 obj-y += domain.o
 obj-y += domctl.o
 obj-y += sysctl.o
@@ -12,8 +11,6 @@ obj-y += io.o
 obj-y += irq.o
 obj-y += kernel.o
 obj-y += mm.o
-obj-y += mode_switch.o
-obj-y += proc-ca15.o
 obj-y += p2m.o
 obj-y += percpu.o
 obj-y += guestcopy.o
@@ -36,7 +33,7 @@ obj-y += dtb.o
 AFLAGS += -DCONFIG_DTB_FILE=\"$(CONFIG_DTB_FILE)\"
 endif
 
-ALL_OBJS := head.o $(ALL_OBJS)
+ALL_OBJS := $(TARGET_SUBARCH)/head.o $(ALL_OBJS)
 
 $(TARGET): $(TARGET)-syms $(TARGET).bin
 	# XXX: VE model loads by VMA so instead of
@@ -81,7 +78,7 @@ endif
 	    $(@D)/.$(@F).1.o -o $@
 	rm -f $(@D)/.$(@F).[0-9]*
 
-asm-offsets.s: asm-offsets.c
+asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c
 	$(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $<
 
 xen.lds: xen.lds.S
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/Rules.mk
--- a/xen/arch/arm/Rules.mk	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/Rules.mk	Wed Dec 19 14:16:30 2012 +0000
@@ -12,16 +12,19 @@ CFLAGS += -fno-builtin -fno-common -Wred
 CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
 CFLAGS += -I$(BASEDIR)/include
 
-# Prevent floating-point variables from creeping into Xen.
-CFLAGS += -msoft-float
-
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 
 arm := y
 
+ifeq ($(TARGET_SUBARCH),arm32)
+# Prevent floating-point variables from creeping into Xen.
+CFLAGS += -msoft-float
+CFLAGS += -mcpu=cortex-a15 -mfpu=vfpv3 -mfloat-abi=softfp
+arm32 := y
+arm64 := n
+endif
+
 ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
-
-CFLAGS += -mcpu=cortex-a15 -mfpu=vfpv3 -mfloat-abi=softfp
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/Makefile	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,5 @@
+subdir-y += lib
+
+obj-y += entry.o
+obj-y += mode_switch.o
+obj-y += proc-ca15.o
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/asm-offsets.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/asm-offsets.c	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,80 @@
+/*
+ * Generate definitions needed by assembly language modules.
+ * This code generates raw asm output which is post-processed
+ * to extract and format the required data.
+ */
+#define COMPILE_OFFSETS
+
+#include <xen/config.h>
+#include <xen/types.h>
+#include <xen/sched.h>
+#include <public/xen.h>
+#include <asm/current.h>
+
+#define DEFINE(_sym, _val) \
+    __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
+#define BLANK() \
+    __asm__ __volatile__ ( "\n->" : : )
+#define OFFSET(_sym, _str, _mem) \
+    DEFINE(_sym, offsetof(_str, _mem));
+
+/* base-2 logarithm */
+#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
+#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
+#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
+#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
+#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
+
+void __dummy__(void)
+{
+   OFFSET(UREGS_sp, struct cpu_user_regs, sp);
+   OFFSET(UREGS_lr, struct cpu_user_regs, lr);
+   OFFSET(UREGS_pc, struct cpu_user_regs, pc);
+   OFFSET(UREGS_cpsr, struct cpu_user_regs, cpsr);
+
+   OFFSET(UREGS_LR_usr, struct cpu_user_regs, lr_usr);
+   OFFSET(UREGS_SP_usr, struct cpu_user_regs, sp_usr);
+
+   OFFSET(UREGS_SP_svc, struct cpu_user_regs, sp_svc);
+   OFFSET(UREGS_LR_svc, struct cpu_user_regs, lr_svc);
+   OFFSET(UREGS_SPSR_svc, struct cpu_user_regs, spsr_svc);
+
+   OFFSET(UREGS_SP_abt, struct cpu_user_regs, sp_abt);
+   OFFSET(UREGS_LR_abt, struct cpu_user_regs, lr_abt);
+   OFFSET(UREGS_SPSR_abt, struct cpu_user_regs, spsr_abt);
+
+   OFFSET(UREGS_SP_und, struct cpu_user_regs, sp_und);
+   OFFSET(UREGS_LR_und, struct cpu_user_regs, lr_und);
+   OFFSET(UREGS_SPSR_und, struct cpu_user_regs, spsr_und);
+
+   OFFSET(UREGS_SP_irq, struct cpu_user_regs, sp_irq);
+   OFFSET(UREGS_LR_irq, struct cpu_user_regs, lr_irq);
+   OFFSET(UREGS_SPSR_irq, struct cpu_user_regs, spsr_irq);
+
+   OFFSET(UREGS_SP_fiq, struct cpu_user_regs, sp_fiq);
+   OFFSET(UREGS_LR_fiq, struct cpu_user_regs, lr_fiq);
+   OFFSET(UREGS_SPSR_fiq, struct cpu_user_regs, spsr_fiq);
+
+   OFFSET(UREGS_R8_fiq, struct cpu_user_regs, r8_fiq);
+   OFFSET(UREGS_R9_fiq, struct cpu_user_regs, r9_fiq);
+   OFFSET(UREGS_R10_fiq, struct cpu_user_regs, r10_fiq);
+   OFFSET(UREGS_R11_fiq, struct cpu_user_regs, r11_fiq);
+   OFFSET(UREGS_R12_fiq, struct cpu_user_regs, r12_fiq);
+
+   OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, cpsr);
+   DEFINE(UREGS_user_sizeof, sizeof(struct cpu_user_regs));
+   BLANK();
+
+   DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
+
+   OFFSET(VCPU_arch_saved_context, struct vcpu, arch.saved_context);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/entry.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/entry.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,141 @@
+#include <xen/config.h>
+#include <asm/asm_defns.h>
+#include <public/xen.h>
+
+#define SAVE_ONE_BANKED(reg)    mrs r11, reg; str r11, [sp, #UREGS_##reg]
+#define RESTORE_ONE_BANKED(reg) ldr r11, [sp, #UREGS_##reg]; msr reg, r11
+
+#define SAVE_BANKED(mode) \
+        SAVE_ONE_BANKED(SP_##mode) ; SAVE_ONE_BANKED(LR_##mode) ; SAVE_ONE_BANKED(SPSR_##mode)
+
+#define RESTORE_BANKED(mode) \
+        RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
+
+#define SAVE_ALL                                                        \
+        sub sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */      \
+        push {r0-r12}; /* Save R0-R12 */                                \
+                                                                        \
+        mrs r11, ELR_hyp;               /* ELR_hyp is return address. */\
+        str r11, [sp, #UREGS_pc];                                       \
+                                                                        \
+        str lr, [sp, #UREGS_lr];                                        \
+                                                                        \
+        add r11, sp, #UREGS_kernel_sizeof+4;                            \
+        str r11, [sp, #UREGS_sp];                                       \
+                                                                        \
+        mrs r11, SPSR_hyp;                                              \
+        str r11, [sp, #UREGS_cpsr];                                     \
+        and r11, #PSR_MODE_MASK;                                        \
+        cmp r11, #PSR_MODE_HYP;                                         \
+        blne save_guest_regs
+
+save_guest_regs:
+        ldr r11, =0xffffffff  /* Clobber SP which is only valid for hypervisor frames. */
+        str r11, [sp, #UREGS_sp]
+        SAVE_ONE_BANKED(SP_usr)
+        /* LR_usr is the same physical register as lr and is saved in SAVE_ALL */
+        SAVE_BANKED(svc)
+        SAVE_BANKED(abt)
+        SAVE_BANKED(und)
+        SAVE_BANKED(irq)
+        SAVE_BANKED(fiq)
+        SAVE_ONE_BANKED(R8_fiq); SAVE_ONE_BANKED(R9_fiq); SAVE_ONE_BANKED(R10_fiq)
+        SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
+        mov pc, lr
+
+#define DEFINE_TRAP_ENTRY(trap)                                         \
+        ALIGN;                                                          \
+trap_##trap:                                                            \
+        SAVE_ALL;                                                       \
+        cpsie i;        /* local_irq_enable */                          \
+        adr lr, return_from_trap;                                       \
+        mov r0, sp;                                                     \
+        mov r11, sp;                                                    \
+        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
+        b do_trap_##trap
+
+#define DEFINE_TRAP_ENTRY_NOIRQ(trap)                                   \
+        ALIGN;                                                          \
+trap_##trap:                                                            \
+        SAVE_ALL;                                                       \
+        adr lr, return_from_trap;                                       \
+        mov r0, sp;                                                     \
+        mov r11, sp;                                                    \
+        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
+        b do_trap_##trap
+
+.globl hyp_traps_vector
+        .align 5
+hyp_traps_vector:
+        .word 0                         /* 0x00 - Reset */
+        b trap_undefined_instruction    /* 0x04 - Undefined Instruction */
+        b trap_supervisor_call          /* 0x08 - Supervisor Call */
+        b trap_prefetch_abort           /* 0x0c - Prefetch Abort */
+        b trap_data_abort               /* 0x10 - Data Abort */
+        b trap_hypervisor               /* 0x14 - Hypervisor */
+        b trap_irq                      /* 0x18 - IRQ */
+        b trap_fiq                      /* 0x1c - FIQ */
+
+DEFINE_TRAP_ENTRY(undefined_instruction)
+DEFINE_TRAP_ENTRY(supervisor_call)
+DEFINE_TRAP_ENTRY(prefetch_abort)
+DEFINE_TRAP_ENTRY(data_abort)
+DEFINE_TRAP_ENTRY(hypervisor)
+DEFINE_TRAP_ENTRY_NOIRQ(irq)
+DEFINE_TRAP_ENTRY_NOIRQ(fiq)
+
+return_from_trap:
+        mov sp, r11
+ENTRY(return_to_new_vcpu)
+        ldr r11, [sp, #UREGS_cpsr]
+        and r11, #PSR_MODE_MASK
+        cmp r11, #PSR_MODE_HYP
+        beq return_to_hypervisor
+        /* Fall thru */
+ENTRY(return_to_guest)
+        mov r11, sp
+        bic sp, #7 /* Align the stack pointer */
+        bl leave_hypervisor_tail /* Disables interrupts on return */
+        mov sp, r11
+        RESTORE_ONE_BANKED(SP_usr)
+        /* LR_usr is the same physical register as lr and is restored below */
+        RESTORE_BANKED(svc)
+        RESTORE_BANKED(abt)
+        RESTORE_BANKED(und)
+        RESTORE_BANKED(irq)
+        RESTORE_BANKED(fiq)
+        RESTORE_ONE_BANKED(R8_fiq); RESTORE_ONE_BANKED(R9_fiq); RESTORE_ONE_BANKED(R10_fiq)
+        RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq);
+        /* Fall thru */
+ENTRY(return_to_hypervisor)
+        cpsid i
+        ldr lr, [sp, #UREGS_lr]
+        ldr r11, [sp, #UREGS_pc]
+        msr ELR_hyp, r11
+        ldr r11, [sp, #UREGS_cpsr]
+        msr SPSR_hyp, r11
+        pop {r0-r12}
+        add sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */
+        eret
+
+/*
+ * struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next)
+ *
+ * r0 - prev
+ * r1 - next
+ *
+ * Returns prev in r0
+ */
+ENTRY(__context_switch)
+        add     ip, r0, #VCPU_arch_saved_context
+        stmia   ip!, {r4 - sl, fp, sp, lr}      /* Save register state */
+
+        add     r4, r1, #VCPU_arch_saved_context
+        ldmia   r4, {r4 - sl, fp, sp, pc}       /* Load registers and return */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/head.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/head.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,415 @@
+/*
+ * xen/arch/arm/head.S
+ *
+ * Start-of-day code for an ARMv7-A with virt extensions.
+ *
+ * Tim Deegan <tim@xen.org>
+ * Copyright (c) 2011 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/config.h>
+#include <asm/page.h>
+#include <asm/processor-ca15.h>
+#include <asm/asm_defns.h>
+
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+
+#define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
+#define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
+#define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
+#define PT_DEV_L3 0xe73 /* lev3: nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=1, P=1 */
+
+#define PT_UPPER(x) (PT_##x & 0xf00)
+#define PT_LOWER(x) (PT_##x & 0x0ff)
+
+/* Macro to print a string to the UART, if there is one.
+ * Clobbers r0-r3. */
+#ifdef EARLY_UART_ADDRESS
+#define PRINT(_s)       \
+        adr   r0, 98f ; \
+        bl    puts    ; \
+        b     99f     ; \
+98:     .asciz _s     ; \
+        .align 2      ; \
+99:
+#else
+#define PRINT(s)
+#endif
+
+        .arm
+
+        /* This must be the very first address in the loaded image.
+         * It should be linked at XEN_VIRT_START, and loaded at any
+         * 2MB-aligned address.  All of text+data+bss must fit in 2MB,
+         * or the initial pagetable code below will need adjustment. */
+        .global start
+start:
+
+        /* zImage magic header, see:
+         * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+         */
+        .rept 8
+        mov   r0, r0
+        .endr
+        b     past_zImage
+
+        .word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+        .word 0x00000000             /* absolute load/run zImage address or
+                                      * 0 for PiC */
+        .word (_end - start)         /* zImage end address */
+
+past_zImage:
+        cpsid aif                    /* Disable all interrupts */
+
+        /* Save the bootloader arguments in less-clobberable registers */
+        mov   r7, r1                 /* r7 := ARM-linux machine type */
+        mov   r8, r2                 /* r8 := ATAG base address */
+
+        /* Find out where we are */
+        ldr   r0, =start
+        adr   r9, start              /* r9  := paddr (start) */
+        sub   r10, r9, r0            /* r10 := phys-offset */
+
+        /* Using the DTB in the .dtb section? */
+#ifdef CONFIG_DTB_FILE
+        ldr   r8, =_sdtb
+        add   r8, r10                /* r8 := paddr(DTB) */
+#endif
+
+        /* Are we the boot CPU? */
+        mov   r12, #0                /* r12 := CPU ID */
+        mrc   CP32(r0, MPIDR)
+        tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
+        beq   boot_cpu
+        tst   r0, #(1<<30)           /* Uniprocessor system? */
+        bne   boot_cpu
+        bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
+        beq   boot_cpu               /* If we're CPU 0, boot now */
+
+        /* Non-boot CPUs wait here to be woken up one at a time. */
+1:      dsb
+        ldr   r0, =smp_up_cpu        /* VA of gate */
+        add   r0, r0, r10            /* PA of gate */
+        ldr   r1, [r0]               /* Which CPU is being booted? */
+        teq   r1, r12                /* Is it us? */
+        wfene
+        bne   1b
+
+boot_cpu:
+#ifdef EARLY_UART_ADDRESS
+        ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
+        teq   r12, #0                   /* CPU 0 sets up the UART too */
+        bleq  init_uart
+        PRINT("- CPU ")
+        mov   r0, r12
+        bl    putn
+        PRINT(" booting -\r\n")
+#endif
+
+        /* Wake up secondary cpus */
+        teq   r12, #0
+        bleq  kick_cpus
+
+        /* Check that this CPU has Hyp mode */
+        mrc   CP32(r0, ID_PFR1)
+        and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
+        teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
+        beq   1f
+        PRINT("- CPU doesn't support the virtualization extensions -\r\n")
+        b     fail
+1:
+        /* Check if we're already in it */
+        mrs   r0, cpsr
+        and   r0, r0, #0x1f          /* Mode is in the low 5 bits of CPSR */
+        teq   r0, #0x1a              /* Hyp Mode? */
+        bne   1f
+        PRINT("- Started in Hyp mode -\r\n")
+        b     hyp
+1:
+        /* Otherwise, it must have been Secure Supervisor mode */
+        mrc   CP32(r0, SCR)
+        tst   r0, #0x1               /* Not-Secure bit set? */
+        beq   1f
+        PRINT("- CPU is not in Hyp mode or Secure state -\r\n")
+        b     fail
+1:
+        /* OK, we're in Secure state. */
+        PRINT("- Started in Secure state -\r\n- Entering Hyp mode -\r\n")
+        ldr   r0, =enter_hyp_mode    /* VA of function */
+        adr   lr, hyp                /* Set return address for call */
+        add   pc, r0, r10            /* Call PA of function */
+
+hyp:
+
+        /* Zero BSS On the boot CPU to avoid nasty surprises */
+        teq   r12, #0
+        bne   skip_bss
+
+        PRINT("- Zero BSS -\r\n")
+        ldr   r0, =__bss_start       /* Load start & end of bss */
+        ldr   r1, =__bss_end
+        add   r0, r0, r10            /* Apply physical offset */
+        add   r1, r1, r10
+
+        mov   r2, #0
+1:      str   r2, [r0], #4
+        cmp   r0, r1
+        blo   1b
+
+skip_bss:
+
+        PRINT("- Setting up control registers -\r\n")
+
+        /* Read CPU ID */
+        mrc   CP32(r0, MIDR)
+        ldr   r1, =(MIDR_MASK)
+        and   r0, r0, r1
+        /* Is this a Cortex A15? */
+        ldr   r1, =(CORTEX_A15_ID)
+        teq   r0, r1
+        bleq  cortex_a15_init
+
+        /* Set up memory attribute type tables */
+        ldr   r0, =MAIR0VAL
+        ldr   r1, =MAIR1VAL
+        mcr   CP32(r0, MAIR0)
+        mcr   CP32(r1, MAIR1)
+        mcr   CP32(r0, HMAIR0)
+        mcr   CP32(r1, HMAIR1)
+
+        /* Set up the HTCR:
+         * PT walks use Outer-Shareable accesses,
+         * PT walks are write-back, no-write-allocate in both cache levels,
+         * Full 32-bit address space goes through this table. */
+        ldr   r0, =0x80002500
+        mcr   CP32(r0, HTCR)
+
+        /* Set up the HSCTLR:
+         * Exceptions in LE ARM,
+         * Low-latency IRQs disabled,
+         * Write-implies-XN disabled (for now),
+         * D-cache disabled (for now),
+         * I-cache enabled,
+         * Alignment checking enabled,
+         * MMU translation disabled (for now). */
+        ldr   r0, =(HSCTLR_BASE|SCTLR_A)
+        mcr   CP32(r0, HSCTLR)
+
+        /* Write Xen's PT's paddr into the HTTBR */
+        ldr   r4, =xen_pgtable
+        add   r4, r4, r10            /* r4 := paddr (xen_pagetable) */
+        mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
+        mcrr  CP64(r4, r5, HTTBR)
+
+        /* Non-boot CPUs don't need to rebuild the pagetable */
+        teq   r12, #0
+        bne   pt_ready
+
+        /* console fixmap */
+#ifdef EARLY_UART_ADDRESS
+        ldr   r1, =xen_fixmap
+        add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
+        mov   r3, #0
+        lsr   r2, r11, #12
+        lsl   r2, r2, #12            /* 4K aligned paddr of UART */
+        orr   r2, r2, #PT_UPPER(DEV_L3)
+        orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
+        strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
+#endif
+
+        /* Build the baseline idle pagetable's first-level entries */
+        ldr   r1, =xen_second
+        add   r1, r1, r10            /* r1 := paddr (xen_second) */
+        mov   r3, #0x0
+        orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 := table map of xen_second */
+        orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
+        strd  r2, r3, [r4, #0]       /* Map it in slot 0 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #8]       /* Map 2nd page in slot 1 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #16]      /* Map 3rd page in slot 2 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #24]      /* Map 4th page in slot 3 */
+
+        /* Now set up the second-level entries */
+        orr   r2, r9, #PT_UPPER(MEM)
+        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB normal map of Xen */
+        mov   r4, r9, lsr #18        /* Slot for paddr(start) */
+        strd  r2, r3, [r1, r4]       /* Map Xen there */
+        ldr   r4, =start
+        lsr   r4, #18                /* Slot for vaddr(start) */
+        strd  r2, r3, [r1, r4]       /* Map Xen there too */
+
+        /* xen_fixmap pagetable */
+        ldr   r2, =xen_fixmap
+        add   r2, r2, r10            /* r2 := paddr (xen_fixmap) */
+        orr   r2, r2, #PT_UPPER(PT)
+        orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 := table map of xen_fixmap */
+        add   r4, r4, #8
+        strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
+
+        mov   r3, #0x0
+        lsr   r2, r8, #21
+        lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
+        orr   r2, r2, #PT_UPPER(MEM)
+        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB RAM incl. DTB */
+        add   r4, r4, #8
+        strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
+
+pt_ready:
+        PRINT("- Turning on paging -\r\n")
+
+        ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
+        mrc   CP32(r0, HSCTLR)
+        orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
+        dsb                          /* Flush PTE writes and finish reads */
+        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
+        isb                          /* Now, flush the icache */
+        mov   pc, r1                 /* Get a proper vaddr into PC */
+paging:
+
+
+#ifdef EARLY_UART_ADDRESS
+        /* Use a virtual address to access the UART. */
+        ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+#endif
+
+        PRINT("- Ready -\r\n")
+
+        /* The boot CPU should go straight into C now */
+        teq   r12, #0
+        beq   launch
+
+        /* Non-boot CPUs need to move on to the relocated pagetables */
+        mov   r0, #0
+        ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
+        add   r4, r4, r10            /* PA of it */
+        ldrd  r4, r5, [r4]           /* Actual value */
+        dsb
+        mcrr  CP64(r4, r5, HTTBR)
+        dsb
+        isb
+        mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+        mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
+        mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
+        dsb                          /* Ensure completion of TLB+BP flush */
+        isb
+
+        /* Non-boot CPUs report that they've got this far */
+        ldr   r0, =ready_cpus
+1:      ldrex r1, [r0]               /*            { read # of ready CPUs } */
+        add   r1, r1, #1             /* Atomically { ++                   } */
+        strex r2, r1, [r0]           /*            { writeback            } */
+        teq   r2, #0
+        bne   1b
+        dsb
+        mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
+        dsb
+
+        /* Here, the non-boot CPUs must wait again -- they're now running on
+         * the boot CPU's pagetables so it's safe for the boot CPU to
+         * overwrite the non-relocated copy of Xen.  Once it's done that,
+         * and brought up the memory allocator, non-boot CPUs can get their
+         * own stacks and enter C. */
+1:      wfe
+        dsb
+        ldr   r0, =smp_up_cpu
+        ldr   r1, [r0]               /* Which CPU is being booted? */
+        teq   r1, r12                /* Is it us? */
+        bne   1b
+
+launch:
+        ldr   r0, =init_stack        /* Find the boot-time stack */
+        ldr   sp, [r0]
+        add   sp, #STACK_SIZE        /* (which grows down from the top). */
+        sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
+        mov   r0, r10                /* Marshal args: - phys_offset */
+        mov   r1, r7                 /*               - machine type */
+        mov   r2, r8                 /*               - ATAG address */
+        movs  r3, r12                /*               - CPU ID */
+        beq   start_xen              /* and disappear into the land of C */
+        b     start_secondary        /* (to the appropriate entry point) */
+
+/* Fail-stop
+ * r0: string explaining why */
+fail:   PRINT("- Boot failed -\r\n")
+1:      wfe
+        b     1b
+
+#ifdef EARLY_UART_ADDRESS
+
+/* Bring up the UART. Specific to the PL011 UART.
+ * Clobbers r0-r2 */
+init_uart:
+        mov   r1, #0x0
+        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor fraction) */
+        mov   r1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
+        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor integer) */
+        mov   r1, #0x60              /* 8n1 */
+        str   r1, [r11, #0x24]       /* -> UARTLCR_H (Line control) */
+        ldr   r1, =0x00000301        /* RXE | TXE | UARTEN */
+        str   r1, [r11, #0x30]       /* -> UARTCR (Control Register) */
+        adr   r0, 1f
+        b     puts
+1:      .asciz "- UART enabled -\r\n"
+        .align 4
+
+/* Print early debug messages.  Specific to the PL011 UART.
+ * r0: Nul-terminated string to print.
+ * Clobbers r0-r2 */
+puts:
+        ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
+        tst   r2, #0x8               /* Check BUSY bit */
+        bne   puts                   /* Wait for the UART to be ready */
+        ldrb  r2, [r0], #1           /* Load next char */
+        teq   r2, #0                 /* Exit on nul */
+        moveq pc, lr
+        str   r2, [r11]              /* -> UARTDR (Data Register) */
+        b     puts
+
+/* Print a 32-bit number in hex.  Specific to the PL011 UART.
+ * r0: Number to print.
+ * clobbers r0-r3 */
+putn:
+        adr   r1, hex
+        mov   r3, #8
+1:      ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
+        tst   r2, #0x8               /* Check BUSY bit */
+        bne   1b                     /* Wait for the UART to be ready */
+        and   r2, r0, #0xf0000000    /* Mask off the top nybble */
+        ldrb  r2, [r1, r2, lsr #28]  /* Convert to a char */
+        str   r2, [r11]              /* -> UARTDR (Data Register) */
+        lsl   r0, #4                 /* Roll it through one nybble at a time */
+        subs  r3, r3, #1
+        bne   1b
+        mov   pc, lr
+
+hex:    .ascii "0123456789abcdef"
+        .align 2
+
+#else  /* EARLY_UART_ADDRESS */
+
+init_uart:
+.global early_puts
+early_puts:
+puts:
+putn:   mov   pc, lr
+
+#endif /* EARLY_UART_ADDRESS */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/Makefile	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,5 @@
+obj-y += memcpy.o memmove.o memset.o memzero.o
+obj-y += findbit.o setbit.o
+obj-y += setbit.o clearbit.o changebit.o
+obj-y += testsetbit.o testclearbit.o testchangebit.o
+obj-y += lib1funcs.o lshrdi3.o div64.o
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/assembler.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/assembler.h	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,325 @@
+/* From Linux arch/arm/include/asm/assembler.h */
+/*
+ *  arch/arm/include/asm/assembler.h
+ *
+ *  Copyright (C) 1996-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  This file contains arm architecture specific defines
+ *  for the different processors.
+ *
+ *  Do not include any C declarations in this file - it is included by
+ *  assembler source.
+ */
+#ifndef __ASM_ASSEMBLER_H__
+#define __ASM_ASSEMBLER_H__
+
+#ifndef __ASSEMBLY__
+#error "Only include this from assembly code"
+#endif
+
+// No Thumb, hence:
+#define W(instr)        instr
+#define ARM(instr...)   instr
+#define THUMB(instr...)
+
+#ifdef CONFIG_ARM_UNWIND
+#define UNWIND(code...)         code
+#else
+#define UNWIND(code...)
+#endif
+
+/*
+ * Endian independent macros for shifting bytes within registers.
+ */
+#ifndef __ARMEB__
+#define pull            lsr
+#define push            lsl
+#define get_byte_0      lsl #0
+#define get_byte_1	lsr #8
+#define get_byte_2	lsr #16
+#define get_byte_3	lsr #24
+#define put_byte_0      lsl #0
+#define put_byte_1	lsl #8
+#define put_byte_2	lsl #16
+#define put_byte_3	lsl #24
+#else
+#define pull            lsl
+#define push            lsr
+#define get_byte_0	lsr #24
+#define get_byte_1	lsr #16
+#define get_byte_2	lsr #8
+#define get_byte_3      lsl #0
+#define put_byte_0	lsl #24
+#define put_byte_1	lsl #16
+#define put_byte_2	lsl #8
+#define put_byte_3      lsl #0
+#endif
+
+/*
+ * Data preload for architectures that support it
+ */
+#if __LINUX_ARM_ARCH__ >= 5
+#define PLD(code...)	code
+#else
+#define PLD(code...)
+#endif
+
+/*
+ * This can be used to enable code to cacheline align the destination
+ * pointer when bulk writing to memory.  Experiments on StrongARM and
+ * XScale didn't show this a worthwhile thing to do when the cache is not
+ * set to write-allocate (this would need further testing on XScale when WA
+ * is used).
+ *
+ * On Feroceon there is much to gain however, regardless of cache mode.
+ */
+#ifdef CONFIG_CPU_FEROCEON
+#define CALGN(code...) code
+#else
+#define CALGN(code...)
+#endif
+
+/*
+ * Enable and disable interrupts
+ */
+#if __LINUX_ARM_ARCH__ >= 6
+	.macro	disable_irq_notrace
+	cpsid	i
+	.endm
+
+	.macro	enable_irq_notrace
+	cpsie	i
+	.endm
+#else
+	.macro	disable_irq_notrace
+	msr	cpsr_c, #PSR_I_BIT | SVC_MODE
+	.endm
+
+	.macro	enable_irq_notrace
+	msr	cpsr_c, #SVC_MODE
+	.endm
+#endif
+
+	.macro asm_trace_hardirqs_off
+#if defined(CONFIG_TRACE_IRQFLAGS)
+	stmdb   sp!, {r0-r3, ip, lr}
+	bl	trace_hardirqs_off
+	ldmia	sp!, {r0-r3, ip, lr}
+#endif
+	.endm
+
+	.macro asm_trace_hardirqs_on_cond, cond
+#if defined(CONFIG_TRACE_IRQFLAGS)
+	/*
+	 * actually the registers should be pushed and pop'd conditionally, but
+	 * after bl the flags are certainly clobbered
+	 */
+	stmdb   sp!, {r0-r3, ip, lr}
+	bl\cond	trace_hardirqs_on
+	ldmia	sp!, {r0-r3, ip, lr}
+#endif
+	.endm
+
+	.macro asm_trace_hardirqs_on
+	asm_trace_hardirqs_on_cond al
+	.endm
+
+	.macro disable_irq
+	disable_irq_notrace
+	asm_trace_hardirqs_off
+	.endm
+
+	.macro enable_irq
+	asm_trace_hardirqs_on
+	enable_irq_notrace
+	.endm
+/*
+ * Save the current IRQ state and disable IRQs.  Note that this macro
+ * assumes FIQs are enabled, and that the processor is in SVC mode.
+ */
+	.macro	save_and_disable_irqs, oldcpsr
+	mrs	\oldcpsr, cpsr
+	disable_irq
+	.endm
+
+/*
+ * Restore interrupt state previously stored in a register.  We don't
+ * guarantee that this will preserve the flags.
+ */
+	.macro	restore_irqs_notrace, oldcpsr
+	msr	cpsr_c, \oldcpsr
+	.endm
+
+	.macro restore_irqs, oldcpsr
+	tst	\oldcpsr, #PSR_I_BIT
+	asm_trace_hardirqs_on_cond eq
+	restore_irqs_notrace \oldcpsr
+	.endm
+
+#define USER(x...)				\
+9999:	x;					\
+	.pushsection __ex_table,"a";		\
+	.align	3;				\
+	.long	9999b,9001f;			\
+	.popsection
+
+#ifdef CONFIG_SMP
+#define ALT_SMP(instr...)					\
+9998:	instr
+/*
+ * Note: if you get assembler errors from ALT_UP() when building with
+ * CONFIG_THUMB2_KERNEL, you almost certainly need to use
+ * ALT_SMP( W(instr) ... )
+ */
+#define ALT_UP(instr...)					\
+	.pushsection ".alt.smp.init", "a"			;\
+	.long	9998b						;\
+9997:	instr							;\
+	.if . - 9997b != 4					;\
+		.error "ALT_UP() content must assemble to exactly 4 bytes";\
+	.endif							;\
+	.popsection
+#define ALT_UP_B(label)					\
+	.equ	up_b_offset, label - 9998b			;\
+	.pushsection ".alt.smp.init", "a"			;\
+	.long	9998b						;\
+	W(b)	. + up_b_offset					;\
+	.popsection
+#else
+#define ALT_SMP(instr...)
+#define ALT_UP(instr...) instr
+#define ALT_UP_B(label) b label
+#endif
+
+/*
+ * Instruction barrier
+ */
+	.macro	instr_sync
+#if __LINUX_ARM_ARCH__ >= 7
+	isb
+#elif __LINUX_ARM_ARCH__ == 6
+	mcr	p15, 0, r0, c7, c5, 4
+#endif
+	.endm
+
+/*
+ * SMP data memory barrier
+ */
+	.macro	smp_dmb mode
+#ifdef CONFIG_SMP
+#if __LINUX_ARM_ARCH__ >= 7
+	.ifeqs "\mode","arm"
+	ALT_SMP(dmb)
+	.else
+	ALT_SMP(W(dmb))
+	.endif
+#elif __LINUX_ARM_ARCH__ == 6
+	ALT_SMP(mcr	p15, 0, r0, c7, c10, 5)	@ dmb
+#else
+#error Incompatible SMP platform
+#endif
+	.ifeqs "\mode","arm"
+	ALT_UP(nop)
+	.else
+	ALT_UP(W(nop))
+	.endif
+#endif
+	.endm
+
+#ifdef CONFIG_THUMB2_KERNEL
+	.macro	setmode, mode, reg
+	mov	\reg, #\mode
+	msr	cpsr_c, \reg
+	.endm
+#else
+	.macro	setmode, mode, reg
+	msr	cpsr_c, #\mode
+	.endm
+#endif
+
+/*
+ * STRT/LDRT access macros with ARM and Thumb-2 variants
+ */
+#ifdef CONFIG_THUMB2_KERNEL
+
+	.macro	usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T()
+9999:
+	.if	\inc == 1
+	\instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
+	.elseif	\inc == 4
+	\instr\cond\()\t\().w \reg, [\ptr, #\off]
+	.else
+	.error	"Unsupported inc macro argument"
+	.endif
+
+	.pushsection __ex_table,"a"
+	.align	3
+	.long	9999b, \abort
+	.popsection
+	.endm
+
+	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort
+	@ explicit IT instruction needed because of the label
+	@ introduced by the USER macro
+	.ifnc	\cond,al
+	.if	\rept == 1
+	itt	\cond
+	.elseif	\rept == 2
+	ittt	\cond
+	.else
+	.error	"Unsupported rept macro argument"
+	.endif
+	.endif
+
+	@ Slightly optimised to avoid incrementing the pointer twice
+	usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort
+	.if	\rept == 2
+	usraccoff \instr, \reg, \ptr, \inc, \inc, \cond, \abort
+	.endif
+
+	add\cond \ptr, #\rept * \inc
+	.endm
+
+#else	/* !CONFIG_THUMB2_KERNEL */
+
+	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort, t=T()
+	.rept	\rept
+9999:
+	.if	\inc == 1
+	\instr\cond\()b\()\t \reg, [\ptr], #\inc
+	.elseif	\inc == 4
+	\instr\cond\()\t \reg, [\ptr], #\inc
+	.else
+	.error	"Unsupported inc macro argument"
+	.endif
+
+	.pushsection __ex_table,"a"
+	.align	3
+	.long	9999b, \abort
+	.popsection
+	.endr
+	.endm
+
+#endif	/* CONFIG_THUMB2_KERNEL */
+
+	.macro	strusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
+	usracc	str, \reg, \ptr, \inc, \cond, \rept, \abort
+	.endm
+
+	.macro	ldrusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
+	usracc	ldr, \reg, \ptr, \inc, \cond, \rept, \abort
+	.endm
+
+/* Utility macro for declaring string literals */
+	.macro	string name:req, string
+	.type \name , #object
+\name:
+	.asciz "\string"
+	.size \name , . - \name
+	.endm
+
+#endif /* __ASM_ASSEMBLER_H__ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/bitops.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/bitops.h	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,87 @@
+#include <xen/config.h>
+
+#if __LINUX_ARM_ARCH__ >= 6
+	.macro	bitop, instr
+	ands	ip, r1, #3
+	strneb	r1, [ip]		@ assert word-aligned
+	mov	r2, #1
+	and	r3, r0, #31		@ Get bit offset
+	mov	r0, r0, lsr #5
+	add	r1, r1, r0, lsl #2	@ Get word offset
+	mov	r3, r2, lsl r3
+1:	ldrex	r2, [r1]
+	\instr	r2, r2, r3
+	strex	r0, r2, [r1]
+	cmp	r0, #0
+	bne	1b
+	bx	lr
+	.endm
+
+	.macro	testop, instr, store
+	ands	ip, r1, #3
+	strneb	r1, [ip]		@ assert word-aligned
+	mov	r2, #1
+	and	r3, r0, #31		@ Get bit offset
+	mov	r0, r0, lsr #5
+	add	r1, r1, r0, lsl #2	@ Get word offset
+	mov	r3, r2, lsl r3		@ create mask
+	smp_dmb
+1:	ldrex	r2, [r1]
+	ands	r0, r2, r3		@ save old value of bit
+	\instr	r2, r2, r3		@ toggle bit
+	strex	ip, r2, [r1]
+	cmp	ip, #0
+	bne	1b
+	smp_dmb
+	cmp	r0, #0
+	movne	r0, #1
+2:	bx	lr
+	.endm
+#else
+	.macro	bitop, name, instr
+ENTRY(	\name		)
+UNWIND(	.fnstart	)
+	ands	ip, r1, #3
+	strneb	r1, [ip]		@ assert word-aligned
+	and	r2, r0, #31
+	mov	r0, r0, lsr #5
+	mov	r3, #1
+	mov	r3, r3, lsl r2
+	save_and_disable_irqs ip
+	ldr	r2, [r1, r0, lsl #2]
+	\instr	r2, r2, r3
+	str	r2, [r1, r0, lsl #2]
+	restore_irqs ip
+	mov	pc, lr
+UNWIND(	.fnend		)
+ENDPROC(\name		)
+	.endm
+
+/**
+ * testop - implement a test_and_xxx_bit operation.
+ * @instr: operational instruction
+ * @store: store instruction
+ *
+ * Note: we can trivially conditionalise the store instruction
+ * to avoid dirtying the data cache.
+ */
+	.macro	testop, name, instr, store
+ENTRY(	\name		)
+UNWIND(	.fnstart	)
+	ands	ip, r1, #3
+	strneb	r1, [ip]		@ assert word-aligned
+	and	r3, r0, #31
+	mov	r0, r0, lsr #5
+	save_and_disable_irqs ip
+	ldr	r2, [r1, r0, lsl #2]!
+	mov	r0, #1
+	tst	r2, r0, lsl r3
+	\instr	r2, r2, r0, lsl r3
+	\store	r2, [r1]
+	moveq	r0, #0
+	restore_irqs ip
+	mov	pc, lr
+UNWIND(	.fnend		)
+ENDPROC(\name		)
+	.endm
+#endif
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/changebit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/changebit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/arm/lib/changebit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+                .text
+
+ENTRY(_change_bit)
+	bitop	eor
+ENDPROC(_change_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/clearbit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/clearbit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,19 @@
+/*
+ *  linux/arch/arm/lib/clearbit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+                .text
+
+ENTRY(_clear_bit)
+	bitop	bic
+ENDPROC(_clear_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/copy_template.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/copy_template.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,267 @@
+/*
+ *  linux/arch/arm/lib/copy_template.s
+ *
+ *  Code template for optimized memory copy functions
+ *
+ *  Author:	Nicolas Pitre
+ *  Created:	Sep 28, 2005
+ *  Copyright:	MontaVista Software, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+/*
+ * Theory of operation
+ * -------------------
+ *
+ * This file provides the core code for a forward memory copy used in
+ * the implementation of memcopy(), copy_to_user() and copy_from_user().
+ *
+ * The including file must define the following accessor macros
+ * according to the need of the given function:
+ *
+ * ldr1w ptr reg abort
+ *
+ *	This loads one word from 'ptr', stores it in 'reg' and increments
+ *	'ptr' to the next word. The 'abort' argument is used for fixup tables.
+ *
+ * ldr4w ptr reg1 reg2 reg3 reg4 abort
+ * ldr8w ptr, reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
+ *
+ *	This loads four or eight words starting from 'ptr', stores them
+ *	in provided registers and increments 'ptr' past those words.
+ *	The'abort' argument is used for fixup tables.
+ *
+ * ldr1b ptr reg cond abort
+ *
+ *	Similar to ldr1w, but it loads a byte and increments 'ptr' one byte.
+ *	It also must apply the condition code if provided, otherwise the
+ *	"al" condition is assumed by default.
+ *
+ * str1w ptr reg abort
+ * str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
+ * str1b ptr reg cond abort
+ *
+ *	Same as their ldr* counterparts, but data is stored to 'ptr' location
+ *	rather than being loaded.
+ *
+ * enter reg1 reg2
+ *
+ *	Preserve the provided registers on the stack plus any additional
+ *	data as needed by the implementation including this code. Called
+ *	upon code entry.
+ *
+ * exit reg1 reg2
+ *
+ *	Restore registers with the values previously saved with the
+ *	'preserv' macro. Called upon code termination.
+ *
+ * LDR1W_SHIFT
+ * STR1W_SHIFT
+ *
+ *	Correction to be applied to the "ip" register when branching into
+ *	the ldr1w or str1w instructions (some of these macros may expand to
+ *	than one 32bit instruction in Thumb-2)
+ */
+
+
+		enter	r4, lr
+
+		subs	r2, r2, #4
+		blt	8f
+		ands	ip, r0, #3
+	PLD(	pld	[r1, #0]		)
+		bne	9f
+		ands	ip, r1, #3
+		bne	10f
+
+1:		subs	r2, r2, #(28)
+		stmfd	sp!, {r5 - r8}
+		blt	5f
+
+	CALGN(	ands	ip, r0, #31		)
+	CALGN(	rsb	r3, ip, #32		)
+	CALGN(	sbcnes	r4, r3, r2		)  @ C is always set here
+	CALGN(	bcs	2f			)
+	CALGN(	adr	r4, 6f			)
+	CALGN(	subs	r2, r2, r3		)  @ C gets set
+	CALGN(	add	pc, r4, ip		)
+
+	PLD(	pld	[r1, #0]		)
+2:	PLD(	subs	r2, r2, #96		)
+	PLD(	pld	[r1, #28]		)
+	PLD(	blt	4f			)
+	PLD(	pld	[r1, #60]		)
+	PLD(	pld	[r1, #92]		)
+
+3:	PLD(	pld	[r1, #124]		)
+4:		ldr8w	r1, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f
+		subs	r2, r2, #32
+		str8w	r0, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f
+		bge	3b
+	PLD(	cmn	r2, #96			)
+	PLD(	bge	4b			)
+
+5:		ands	ip, r2, #28
+		rsb	ip, ip, #32
+#if LDR1W_SHIFT > 0
+		lsl	ip, ip, #LDR1W_SHIFT
+#endif
+		addne	pc, pc, ip		@ C is always clear here
+		b	7f
+6:
+		.rept	(1 << LDR1W_SHIFT)
+		W(nop)
+		.endr
+		ldr1w	r1, r3, abort=20f
+		ldr1w	r1, r4, abort=20f
+		ldr1w	r1, r5, abort=20f
+		ldr1w	r1, r6, abort=20f
+		ldr1w	r1, r7, abort=20f
+		ldr1w	r1, r8, abort=20f
+		ldr1w	r1, lr, abort=20f
+
+#if LDR1W_SHIFT < STR1W_SHIFT
+		lsl	ip, ip, #STR1W_SHIFT - LDR1W_SHIFT
+#elif LDR1W_SHIFT > STR1W_SHIFT
+		lsr	ip, ip, #LDR1W_SHIFT - STR1W_SHIFT
+#endif
+		add	pc, pc, ip
+		nop
+		.rept	(1 << STR1W_SHIFT)
+		W(nop)
+		.endr
+		str1w	r0, r3, abort=20f
+		str1w	r0, r4, abort=20f
+		str1w	r0, r5, abort=20f
+		str1w	r0, r6, abort=20f
+		str1w	r0, r7, abort=20f
+		str1w	r0, r8, abort=20f
+		str1w	r0, lr, abort=20f
+
+	CALGN(	bcs	2b			)
+
+7:		ldmfd	sp!, {r5 - r8}
+
+8:		movs	r2, r2, lsl #31
+		ldr1b	r1, r3, ne, abort=21f
+		ldr1b	r1, r4, cs, abort=21f
+		ldr1b	r1, ip, cs, abort=21f
+		str1b	r0, r3, ne, abort=21f
+		str1b	r0, r4, cs, abort=21f
+		str1b	r0, ip, cs, abort=21f
+
+		exit	r4, pc
+
+9:		rsb	ip, ip, #4
+		cmp	ip, #2
+		ldr1b	r1, r3, gt, abort=21f
+		ldr1b	r1, r4, ge, abort=21f
+		ldr1b	r1, lr, abort=21f
+		str1b	r0, r3, gt, abort=21f
+		str1b	r0, r4, ge, abort=21f
+		subs	r2, r2, ip
+		str1b	r0, lr, abort=21f
+		blt	8b
+		ands	ip, r1, #3
+		beq	1b
+
+10:		bic	r1, r1, #3
+		cmp	ip, #2
+		ldr1w	r1, lr, abort=21f
+		beq	17f
+		bgt	18f
+
+
+		.macro	forward_copy_shift pull push
+
+		subs	r2, r2, #28
+		blt	14f
+
+	CALGN(	ands	ip, r0, #31		)
+	CALGN(	rsb	ip, ip, #32		)
+	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
+	CALGN(	subcc	r2, r2, ip		)
+	CALGN(	bcc	15f			)
+
+11:		stmfd	sp!, {r5 - r9}
+
+	PLD(	pld	[r1, #0]		)
+	PLD(	subs	r2, r2, #96		)
+	PLD(	pld	[r1, #28]		)
+	PLD(	blt	13f			)
+	PLD(	pld	[r1, #60]		)
+	PLD(	pld	[r1, #92]		)
+
+12:	PLD(	pld	[r1, #124]		)
+13:		ldr4w	r1, r4, r5, r6, r7, abort=19f
+		mov	r3, lr, pull #\pull
+		subs	r2, r2, #32
+		ldr4w	r1, r8, r9, ip, lr, abort=19f
+		orr	r3, r3, r4, push #\push
+		mov	r4, r4, pull #\pull
+		orr	r4, r4, r5, push #\push
+		mov	r5, r5, pull #\pull
+		orr	r5, r5, r6, push #\push
+		mov	r6, r6, pull #\pull
+		orr	r6, r6, r7, push #\push
+		mov	r7, r7, pull #\pull
+		orr	r7, r7, r8, push #\push
+		mov	r8, r8, pull #\pull
+		orr	r8, r8, r9, push #\push
+		mov	r9, r9, pull #\pull
+		orr	r9, r9, ip, push #\push
+		mov	ip, ip, pull #\pull
+		orr	ip, ip, lr, push #\push
+		str8w	r0, r3, r4, r5, r6, r7, r8, r9, ip, , abort=19f
+		bge	12b
+	PLD(	cmn	r2, #96			)
+	PLD(	bge	13b			)
+
+		ldmfd	sp!, {r5 - r9}
+
+14:		ands	ip, r2, #28
+		beq	16f
+
+15:		mov	r3, lr, pull #\pull
+		ldr1w	r1, lr, abort=21f
+		subs	ip, ip, #4
+		orr	r3, r3, lr, push #\push
+		str1w	r0, r3, abort=21f
+		bgt	15b
+	CALGN(	cmp	r2, #0			)
+	CALGN(	bge	11b			)
+
+16:		sub	r1, r1, #(\push / 8)
+		b	8b
+
+		.endm
+
+
+		forward_copy_shift	pull=8	push=24
+
+17:		forward_copy_shift	pull=16	push=16
+
+18:		forward_copy_shift	pull=24	push=8
+
+
+/*
+ * Abort preamble and completion macros.
+ * If a fixup handler is required then those macros must surround it.
+ * It is assumed that the fixup code will handle the private part of
+ * the exit macro.
+ */
+
+	.macro	copy_abort_preamble
+19:	ldmfd	sp!, {r5 - r9}
+	b	21f
+20:	ldmfd	sp!, {r5 - r8}
+21:
+	.endm
+
+	.macro	copy_abort_end
+	ldmfd	sp!, {r4, pc}
+	.endm
+
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/div64.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/div64.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,211 @@
+/*
+ *  linux/arch/arm/lib/div64.S
+ *
+ *  Optimized computation of 64-bit dividend / 32-bit divisor
+ *
+ *  Author:	Nicolas Pitre
+ *  Created:	Oct 5, 2003
+ *  Copyright:	Monta Vista Software, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <xen/config.h>
+#include "assembler.h"
+	
+#ifdef __ARMEB__
+#define xh r0
+#define xl r1
+#define yh r2
+#define yl r3
+#else
+#define xl r0
+#define xh r1
+#define yl r2
+#define yh r3
+#endif
+
+/*
+ * __do_div64: perform a division with 64-bit dividend and 32-bit divisor.
+ *
+ * Note: Calling convention is totally non standard for optimal code.
+ *       This is meant to be used by do_div() from include/asm/div64.h only.
+ *
+ * Input parameters:
+ * 	xh-xl	= dividend (clobbered)
+ * 	r4	= divisor (preserved)
+ *
+ * Output values:
+ * 	yh-yl	= result
+ * 	xh	= remainder
+ *
+ * Clobbered regs: xl, ip
+ */
+
+ENTRY(__do_div64)
+UNWIND(.fnstart)
+
+	@ Test for easy paths first.
+	subs	ip, r4, #1
+	bls	9f			@ divisor is 0 or 1
+	tst	ip, r4
+	beq	8f			@ divisor is power of 2
+
+	@ See if we need to handle upper 32-bit result.
+	cmp	xh, r4
+	mov	yh, #0
+	blo	3f
+
+	@ Align divisor with upper part of dividend.
+	@ The aligned divisor is stored in yl preserving the original.
+	@ The bit position is stored in ip.
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	yl, r4
+	clz	ip, xh
+	sub	yl, yl, ip
+	mov	ip, #1
+	mov	ip, ip, lsl yl
+	mov	yl, r4, lsl yl
+
+#else
+
+	mov	yl, r4
+	mov	ip, #1
+1:	cmp	yl, #0x80000000
+	cmpcc	yl, xh
+	movcc	yl, yl, lsl #1
+	movcc	ip, ip, lsl #1
+	bcc	1b
+
+#endif
+
+	@ The division loop for needed upper bit positions.
+ 	@ Break out early if dividend reaches 0.
+2:	cmp	xh, yl
+	orrcs	yh, yh, ip
+	subcss	xh, xh, yl
+	movnes	ip, ip, lsr #1
+	mov	yl, yl, lsr #1
+	bne	2b
+
+	@ See if we need to handle lower 32-bit result.
+3:	cmp	xh, #0
+	mov	yl, #0
+	cmpeq	xl, r4
+	movlo	xh, xl
+	movlo	pc, lr
+
+	@ The division loop for lower bit positions.
+	@ Here we shift remainer bits leftwards rather than moving the
+	@ divisor for comparisons, considering the carry-out bit as well.
+	mov	ip, #0x80000000
+4:	movs	xl, xl, lsl #1
+	adcs	xh, xh, xh
+	beq	6f
+	cmpcc	xh, r4
+5:	orrcs	yl, yl, ip
+	subcs	xh, xh, r4
+	movs	ip, ip, lsr #1
+	bne	4b
+	mov	pc, lr
+
+	@ The top part of remainder became zero.  If carry is set
+	@ (the 33th bit) this is a false positive so resume the loop.
+	@ Otherwise, if lower part is also null then we are done.
+6:	bcs	5b
+	cmp	xl, #0
+	moveq	pc, lr
+
+	@ We still have remainer bits in the low part.  Bring them up.
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	xh, xl			@ we know xh is zero here so...
+	add	xh, xh, #1
+	mov	xl, xl, lsl xh
+	mov	ip, ip, lsr xh
+
+#else
+
+7:	movs	xl, xl, lsl #1
+	mov	ip, ip, lsr #1
+	bcc	7b
+
+#endif
+
+	@ Current remainder is now 1.  It is worthless to compare with
+	@ divisor at this point since divisor can not be smaller than 3 here.
+	@ If possible, branch for another shift in the division loop.
+	@ If no bit position left then we are done.
+	movs	ip, ip, lsr #1
+	mov	xh, #1
+	bne	4b
+	mov	pc, lr
+
+8:	@ Division by a power of 2: determine what that divisor order is
+	@ then simply shift values around
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	ip, r4
+	rsb	ip, ip, #31
+
+#else
+
+	mov	yl, r4
+	cmp	r4, #(1 << 16)
+	mov	ip, #0
+	movhs	yl, yl, lsr #16
+	movhs	ip, #16
+
+	cmp	yl, #(1 << 8)
+	movhs	yl, yl, lsr #8
+	addhs	ip, ip, #8
+
+	cmp	yl, #(1 << 4)
+	movhs	yl, yl, lsr #4
+	addhs	ip, ip, #4
+
+	cmp	yl, #(1 << 2)
+	addhi	ip, ip, #3
+	addls	ip, ip, yl, lsr #1
+
+#endif
+
+	mov	yh, xh, lsr ip
+	mov	yl, xl, lsr ip
+	rsb	ip, ip, #32
+ ARM(	orr	yl, yl, xh, lsl ip	)
+ THUMB(	lsl	xh, xh, ip		)
+ THUMB(	orr	yl, yl, xh		)
+	mov	xh, xl, lsl ip
+	mov	xh, xh, lsr ip
+	mov	pc, lr
+
+	@ eq -> division by 1: obvious enough...
+9:	moveq	yl, xl
+	moveq	yh, xh
+	moveq	xh, #0
+	moveq	pc, lr
+UNWIND(.fnend)
+
+UNWIND(.fnstart)
+UNWIND(.pad #4)
+UNWIND(.save {lr})
+Ldiv0_64:
+	@ Division by 0:
+	str	lr, [sp, #-8]!
+	bl	__div0
+
+	@ as wrong as it could be...
+	mov	yl, #0
+	mov	yh, #0
+	mov	xh, #0
+	ldr	pc, [sp], #8
+
+UNWIND(.fnend)
+ENDPROC(__do_div64)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/findbit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/findbit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,198 @@
+/*
+ *  linux/arch/arm/lib/findbit.S
+ *
+ *  Copyright (C) 1995-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 16th March 2001 - John Ripley <jripley@sonicblue.com>
+ *   Fixed so that "size" is an exclusive not an inclusive quantity.
+ *   All users of these functions expect exclusive sizes, and may
+ *   also call with zero size.
+ * Reworked by rmk.
+ */
+
+#include <xen/config.h>
+
+#include "assembler.h"
+                .text
+
+/*
+ * Purpose  : Find a 'zero' bit
+ * Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit);
+ */
+ENTRY(_find_first_zero_bit_le)
+		teq	r1, #0	
+		beq	3f
+		mov	r2, #0
+1:
+ ARM(		ldrb	r3, [r0, r2, lsr #3]	)
+ THUMB(		lsr	r3, r2, #3		)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		eors	r3, r3, #0xff		@ invert bits
+		bne	.L_found		@ any now set - found zero bit
+		add	r2, r2, #8		@ next bit pointer
+2:		cmp	r2, r1			@ any more?
+		blo	1b
+3:		mov	r0, r1			@ no free bits
+		mov	pc, lr
+ENDPROC(_find_first_zero_bit_le)
+
+/*
+ * Purpose  : Find next 'zero' bit
+ * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
+ */
+ENTRY(_find_next_zero_bit_le)
+		teq	r1, #0
+		beq	3b
+		ands	ip, r2, #7
+		beq	1b			@ If new byte, goto old routine
+ ARM(		ldrb	r3, [r0, r2, lsr #3]	)
+ THUMB(		lsr	r3, r2, #3		)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		eor	r3, r3, #0xff		@ now looking for a 1 bit
+		movs	r3, r3, lsr ip		@ shift off unused bits
+		bne	.L_found
+		orr	r2, r2, #7		@ if zero, then no bits here
+		add	r2, r2, #1		@ align bit pointer
+		b	2b			@ loop for next bit
+ENDPROC(_find_next_zero_bit_le)
+
+/*
+ * Purpose  : Find a 'one' bit
+ * Prototype: int find_first_bit(const unsigned long *addr, unsigned int maxbit);
+ */
+ENTRY(_find_first_bit_le)
+		teq	r1, #0	
+		beq	3f
+		mov	r2, #0
+1:
+ ARM(		ldrb	r3, [r0, r2, lsr #3]	)
+ THUMB(		lsr	r3, r2, #3		)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		movs	r3, r3
+		bne	.L_found		@ any now set - found zero bit
+		add	r2, r2, #8		@ next bit pointer
+2:		cmp	r2, r1			@ any more?
+		blo	1b
+3:		mov	r0, r1			@ no free bits
+		mov	pc, lr
+ENDPROC(_find_first_bit_le)
+
+/*
+ * Purpose  : Find next 'one' bit
+ * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
+ */
+ENTRY(_find_next_bit_le)
+		teq	r1, #0
+		beq	3b
+		ands	ip, r2, #7
+		beq	1b			@ If new byte, goto old routine
+ ARM(		ldrb	r3, [r0, r2, lsr #3]	)
+ THUMB(		lsr	r3, r2, #3		)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		movs	r3, r3, lsr ip		@ shift off unused bits
+		bne	.L_found
+		orr	r2, r2, #7		@ if zero, then no bits here
+		add	r2, r2, #1		@ align bit pointer
+		b	2b			@ loop for next bit
+ENDPROC(_find_next_bit_le)
+
+#ifdef __ARMEB__
+
+ENTRY(_find_first_zero_bit_be)
+		teq	r1, #0
+		beq	3f
+		mov	r2, #0
+1:		eor	r3, r2, #0x18		@ big endian byte ordering
+ ARM(		ldrb	r3, [r0, r3, lsr #3]	)
+ THUMB(		lsr	r3, #3			)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		eors	r3, r3, #0xff		@ invert bits
+		bne	.L_found		@ any now set - found zero bit
+		add	r2, r2, #8		@ next bit pointer
+2:		cmp	r2, r1			@ any more?
+		blo	1b
+3:		mov	r0, r1			@ no free bits
+		mov	pc, lr
+ENDPROC(_find_first_zero_bit_be)
+
+ENTRY(_find_next_zero_bit_be)
+		teq	r1, #0
+		beq	3b
+		ands	ip, r2, #7
+		beq	1b			@ If new byte, goto old routine
+		eor	r3, r2, #0x18		@ big endian byte ordering
+ ARM(		ldrb	r3, [r0, r3, lsr #3]	)
+ THUMB(		lsr	r3, #3			)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		eor	r3, r3, #0xff		@ now looking for a 1 bit
+		movs	r3, r3, lsr ip		@ shift off unused bits
+		bne	.L_found
+		orr	r2, r2, #7		@ if zero, then no bits here
+		add	r2, r2, #1		@ align bit pointer
+		b	2b			@ loop for next bit
+ENDPROC(_find_next_zero_bit_be)
+
+ENTRY(_find_first_bit_be)
+		teq	r1, #0
+		beq	3f
+		mov	r2, #0
+1:		eor	r3, r2, #0x18		@ big endian byte ordering
+ ARM(		ldrb	r3, [r0, r3, lsr #3]	)
+ THUMB(		lsr	r3, #3			)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		movs	r3, r3
+		bne	.L_found		@ any now set - found zero bit
+		add	r2, r2, #8		@ next bit pointer
+2:		cmp	r2, r1			@ any more?
+		blo	1b
+3:		mov	r0, r1			@ no free bits
+		mov	pc, lr
+ENDPROC(_find_first_bit_be)
+
+ENTRY(_find_next_bit_be)
+		teq	r1, #0
+		beq	3b
+		ands	ip, r2, #7
+		beq	1b			@ If new byte, goto old routine
+		eor	r3, r2, #0x18		@ big endian byte ordering
+ ARM(		ldrb	r3, [r0, r3, lsr #3]	)
+ THUMB(		lsr	r3, #3			)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		movs	r3, r3, lsr ip		@ shift off unused bits
+		bne	.L_found
+		orr	r2, r2, #7		@ if zero, then no bits here
+		add	r2, r2, #1		@ align bit pointer
+		b	2b			@ loop for next bit
+ENDPROC(_find_next_bit_be)
+
+#endif
+
+/*
+ * One or more bits in the LSB of r3 are assumed to be set.
+ */
+.L_found:
+#if __LINUX_ARM_ARCH__ >= 5
+		rsb	r0, r3, #0
+		and	r3, r3, r0
+		clz	r3, r3
+		rsb	r3, r3, #31
+		add	r0, r2, r3
+#else
+		tst	r3, #0x0f
+		addeq	r2, r2, #4
+		movne	r3, r3, lsl #4
+		tst	r3, #0x30
+		addeq	r2, r2, #2
+		movne	r3, r3, lsl #2
+		tst	r3, #0x40
+		addeq	r2, r2, #1
+		mov	r0, r2
+#endif
+		cmp	r1, r0			@ Clamp to maxbit
+		movlo	r0, r1
+		mov	pc, lr
+
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/lib1funcs.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/lib1funcs.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,389 @@
+/*
+ * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
+ *
+ * Author: Nicolas Pitre <nico@fluxnic.net>
+ *   - contributed to gcc-3.4 on Sep 30, 2003
+ *   - adapted for the Linux kernel on Oct 2, 2003
+ */
+
+/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+
+This file is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file.  (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+This file is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+#include <xen/config.h>
+#include "assembler.h"
+
+.macro ARM_DIV_BODY dividend, divisor, result, curbit
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	\curbit, \divisor
+	clz	\result, \dividend
+	sub	\result, \curbit, \result
+	mov	\curbit, #1
+	mov	\divisor, \divisor, lsl \result
+	mov	\curbit, \curbit, lsl \result
+	mov	\result, #0
+	
+#else
+
+	@ Initially shift the divisor left 3 bits if possible,
+	@ set curbit accordingly.  This allows for curbit to be located
+	@ at the left end of each 4 bit nibbles in the division loop
+	@ to save one loop in most cases.
+	tst	\divisor, #0xe0000000
+	moveq	\divisor, \divisor, lsl #3
+	moveq	\curbit, #8
+	movne	\curbit, #1
+
+	@ Unless the divisor is very big, shift it up in multiples of
+	@ four bits, since this is the amount of unwinding in the main
+	@ division loop.  Continue shifting until the divisor is 
+	@ larger than the dividend.
+1:	cmp	\divisor, #0x10000000
+	cmplo	\divisor, \dividend
+	movlo	\divisor, \divisor, lsl #4
+	movlo	\curbit, \curbit, lsl #4
+	blo	1b
+
+	@ For very big divisors, we must shift it a bit at a time, or
+	@ we will be in danger of overflowing.
+1:	cmp	\divisor, #0x80000000
+	cmplo	\divisor, \dividend
+	movlo	\divisor, \divisor, lsl #1
+	movlo	\curbit, \curbit, lsl #1
+	blo	1b
+
+	mov	\result, #0
+
+#endif
+
+	@ Division loop
+1:	cmp	\dividend, \divisor
+	subhs	\dividend, \dividend, \divisor
+	orrhs	\result,   \result,   \curbit
+	cmp	\dividend, \divisor,  lsr #1
+	subhs	\dividend, \dividend, \divisor, lsr #1
+	orrhs	\result,   \result,   \curbit,  lsr #1
+	cmp	\dividend, \divisor,  lsr #2
+	subhs	\dividend, \dividend, \divisor, lsr #2
+	orrhs	\result,   \result,   \curbit,  lsr #2
+	cmp	\dividend, \divisor,  lsr #3
+	subhs	\dividend, \dividend, \divisor, lsr #3
+	orrhs	\result,   \result,   \curbit,  lsr #3
+	cmp	\dividend, #0			@ Early termination?
+	movnes	\curbit,   \curbit,  lsr #4	@ No, any more bits to do?
+	movne	\divisor,  \divisor, lsr #4
+	bne	1b
+
+.endm
+
+
+.macro ARM_DIV2_ORDER divisor, order
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	\order, \divisor
+	rsb	\order, \order, #31
+
+#else
+
+	cmp	\divisor, #(1 << 16)
+	movhs	\divisor, \divisor, lsr #16
+	movhs	\order, #16
+	movlo	\order, #0
+
+	cmp	\divisor, #(1 << 8)
+	movhs	\divisor, \divisor, lsr #8
+	addhs	\order, \order, #8
+
+	cmp	\divisor, #(1 << 4)
+	movhs	\divisor, \divisor, lsr #4
+	addhs	\order, \order, #4
+
+	cmp	\divisor, #(1 << 2)
+	addhi	\order, \order, #3
+	addls	\order, \order, \divisor, lsr #1
+
+#endif
+
+.endm
+
+
+.macro ARM_MOD_BODY dividend, divisor, order, spare
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	\order, \divisor
+	clz	\spare, \dividend
+	sub	\order, \order, \spare
+	mov	\divisor, \divisor, lsl \order
+
+#else
+
+	mov	\order, #0
+
+	@ Unless the divisor is very big, shift it up in multiples of
+	@ four bits, since this is the amount of unwinding in the main
+	@ division loop.  Continue shifting until the divisor is 
+	@ larger than the dividend.
+1:	cmp	\divisor, #0x10000000
+	cmplo	\divisor, \dividend
+	movlo	\divisor, \divisor, lsl #4
+	addlo	\order, \order, #4
+	blo	1b
+
+	@ For very big divisors, we must shift it a bit at a time, or
+	@ we will be in danger of overflowing.
+1:	cmp	\divisor, #0x80000000
+	cmplo	\divisor, \dividend
+	movlo	\divisor, \divisor, lsl #1
+	addlo	\order, \order, #1
+	blo	1b
+
+#endif
+
+	@ Perform all needed substractions to keep only the reminder.
+	@ Do comparisons in batch of 4 first.
+	subs	\order, \order, #3		@ yes, 3 is intended here
+	blt	2f
+
+1:	cmp	\dividend, \divisor
+	subhs	\dividend, \dividend, \divisor
+	cmp	\dividend, \divisor,  lsr #1
+	subhs	\dividend, \dividend, \divisor, lsr #1
+	cmp	\dividend, \divisor,  lsr #2
+	subhs	\dividend, \dividend, \divisor, lsr #2
+	cmp	\dividend, \divisor,  lsr #3
+	subhs	\dividend, \dividend, \divisor, lsr #3
+	cmp	\dividend, #1
+	mov	\divisor, \divisor, lsr #4
+	subges	\order, \order, #4
+	bge	1b
+
+	tst	\order, #3
+	teqne	\dividend, #0
+	beq	5f
+
+	@ Either 1, 2 or 3 comparison/substractions are left.
+2:	cmn	\order, #2
+	blt	4f
+	beq	3f
+	cmp	\dividend, \divisor
+	subhs	\dividend, \dividend, \divisor
+	mov	\divisor,  \divisor,  lsr #1
+3:	cmp	\dividend, \divisor
+	subhs	\dividend, \dividend, \divisor
+	mov	\divisor,  \divisor,  lsr #1
+4:	cmp	\dividend, \divisor
+	subhs	\dividend, \dividend, \divisor
+5:
+.endm
+
+
+ENTRY(__udivsi3)
+ENTRY(__aeabi_uidiv)
+UNWIND(.fnstart)
+
+	subs	r2, r1, #1
+	moveq	pc, lr
+	bcc	Ldiv0
+	cmp	r0, r1
+	bls	11f
+	tst	r1, r2
+	beq	12f
+
+	ARM_DIV_BODY r0, r1, r2, r3
+
+	mov	r0, r2
+	mov	pc, lr
+
+11:	moveq	r0, #1
+	movne	r0, #0
+	mov	pc, lr
+
+12:	ARM_DIV2_ORDER r1, r2
+
+	mov	r0, r0, lsr r2
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__udivsi3)
+ENDPROC(__aeabi_uidiv)
+
+ENTRY(__umodsi3)
+UNWIND(.fnstart)
+
+	subs	r2, r1, #1			@ compare divisor with 1
+	bcc	Ldiv0
+	cmpne	r0, r1				@ compare dividend with divisor
+	moveq   r0, #0
+	tsthi	r1, r2				@ see if divisor is power of 2
+	andeq	r0, r0, r2
+	movls	pc, lr
+
+	ARM_MOD_BODY r0, r1, r2, r3
+
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__umodsi3)
+
+ENTRY(__divsi3)
+ENTRY(__aeabi_idiv)
+UNWIND(.fnstart)
+
+	cmp	r1, #0
+	eor	ip, r0, r1			@ save the sign of the result.
+	beq	Ldiv0
+	rsbmi	r1, r1, #0			@ loops below use unsigned.
+	subs	r2, r1, #1			@ division by 1 or -1 ?
+	beq	10f
+	movs	r3, r0
+	rsbmi	r3, r0, #0			@ positive dividend value
+	cmp	r3, r1
+	bls	11f
+	tst	r1, r2				@ divisor is power of 2 ?
+	beq	12f
+
+	ARM_DIV_BODY r3, r1, r0, r2
+
+	cmp	ip, #0
+	rsbmi	r0, r0, #0
+	mov	pc, lr
+
+10:	teq	ip, r0				@ same sign ?
+	rsbmi	r0, r0, #0
+	mov	pc, lr
+
+11:	movlo	r0, #0
+	moveq	r0, ip, asr #31
+	orreq	r0, r0, #1
+	mov	pc, lr
+
+12:	ARM_DIV2_ORDER r1, r2
+
+	cmp	ip, #0
+	mov	r0, r3, lsr r2
+	rsbmi	r0, r0, #0
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__divsi3)
+ENDPROC(__aeabi_idiv)
+
+ENTRY(__modsi3)
+UNWIND(.fnstart)
+
+	cmp	r1, #0
+	beq	Ldiv0
+	rsbmi	r1, r1, #0			@ loops below use unsigned.
+	movs	ip, r0				@ preserve sign of dividend
+	rsbmi	r0, r0, #0			@ if negative make positive
+	subs	r2, r1, #1			@ compare divisor with 1
+	cmpne	r0, r1				@ compare dividend with divisor
+	moveq	r0, #0
+	tsthi	r1, r2				@ see if divisor is power of 2
+	andeq	r0, r0, r2
+	bls	10f
+
+	ARM_MOD_BODY r0, r1, r2, r3
+
+10:	cmp	ip, #0
+	rsbmi	r0, r0, #0
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__modsi3)
+
+#ifdef CONFIG_AEABI
+
+ENTRY(__aeabi_uidivmod)
+UNWIND(.fnstart)
+UNWIND(.save {r0, r1, ip, lr}	)
+
+	stmfd	sp!, {r0, r1, ip, lr}
+	bl	__aeabi_uidiv
+	ldmfd	sp!, {r1, r2, ip, lr}
+	mul	r3, r0, r2
+	sub	r1, r1, r3
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__aeabi_uidivmod)
+
+ENTRY(__aeabi_idivmod)
+UNWIND(.fnstart)
+UNWIND(.save {r0, r1, ip, lr}	)
+	stmfd	sp!, {r0, r1, ip, lr}
+	bl	__aeabi_idiv
+	ldmfd	sp!, {r1, r2, ip, lr}
+	mul	r3, r0, r2
+	sub	r1, r1, r3
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__aeabi_idivmod)
+
+ENTRY(__aeabi_uldivmod)
+UNWIND(.fnstart)
+UNWIND(.save {lr}	)
+	sub sp, sp, #8
+	stmfd   sp!, {sp, lr}
+	bl __qdivrem
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	ldmfd sp!, {r2, r3}
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__aeabi_uldivmod)
+
+ENTRY(__aeabi_ldivmod)
+UNWIND(.fnstart)
+UNWIND(.save {lr}	)
+	sub sp, sp, #16
+	stmfd   sp!, {sp, lr}
+	bl __ldivmod_helper
+	ldr lr, [sp, #4]
+	add sp, sp, #16
+	ldmfd	sp!, {r2, r3}
+	mov	pc, lr
+	
+UNWIND(.fnend)
+ENDPROC(__aeabi_ldivmod)
+#endif
+
+Ldiv0:
+UNWIND(.fnstart)
+UNWIND(.pad #4)
+UNWIND(.save {lr})
+	str	lr, [sp, #-8]!
+	bl	__div0
+	mov	r0, #0			@ About as wrong as it could be.
+	ldr	pc, [sp], #8
+UNWIND(.fnend)
+ENDPROC(Ldiv0)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/lshrdi3.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/lshrdi3.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,54 @@
+/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
+   Free Software Foundation, Inc.
+
+This file is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file.  (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+This file is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+
+#include <xen/config.h>
+#include "assembler.h"
+
+#ifdef __ARMEB__
+#define al r1
+#define ah r0
+#else
+#define al r0
+#define ah r1
+#endif
+
+ENTRY(__lshrdi3)
+ENTRY(__aeabi_llsr)
+
+	subs	r3, r2, #32
+	rsb	ip, r2, #32
+	movmi	al, al, lsr r2
+	movpl	al, ah, lsr r3
+ ARM(	orrmi	al, al, ah, lsl ip	)
+ THUMB(	lslmi	r3, ah, ip		)
+ THUMB(	orrmi	al, al, r3		)
+	mov	ah, ah, lsr r2
+	mov	pc, lr
+
+ENDPROC(__lshrdi3)
+ENDPROC(__aeabi_llsr)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/memcpy.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/memcpy.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,63 @@
+/*
+ *  linux/arch/arm/lib/memcpy.S
+ *
+ *  Author:	Nicolas Pitre
+ *  Created:	Sep 28, 2005
+ *  Copyright:	MontaVista Software, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <xen/config.h>
+#include "assembler.h"
+
+#define LDR1W_SHIFT	0
+#define STR1W_SHIFT	0
+
+	.macro ldr1w ptr reg abort
+	W(ldr) \reg, [\ptr], #4
+	.endm
+
+	.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
+	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
+	.endm
+
+	.macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
+	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
+	.endm
+
+	.macro ldr1b ptr reg cond=al abort
+	ldr\cond\()b \reg, [\ptr], #1
+	.endm
+
+	.macro str1w ptr reg abort
+	W(str) \reg, [\ptr], #4
+	.endm
+
+	.macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
+	stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
+	.endm
+
+	.macro str1b ptr reg cond=al abort
+	str\cond\()b \reg, [\ptr], #1
+	.endm
+
+	.macro enter reg1 reg2
+	stmdb sp!, {r0, \reg1, \reg2}
+	.endm
+
+	.macro exit reg1 reg2
+	ldmfd sp!, {r0, \reg1, \reg2}
+	.endm
+
+	.text
+
+/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
+
+ENTRY(memcpy)
+
+#include "copy_template.S"
+
+ENDPROC(memcpy)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/memmove.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/memmove.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,200 @@
+/*
+ *  linux/arch/arm/lib/memmove.S
+ *
+ *  Author:	Nicolas Pitre
+ *  Created:	Sep 28, 2005
+ *  Copyright:	(C) MontaVista Software Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <xen/config.h>
+
+#include "assembler.h"
+
+		.text
+
+/*
+ * Prototype: void *memmove(void *dest, const void *src, size_t n);
+ *
+ * Note:
+ *
+ * If the memory regions don't overlap, we simply branch to memcpy which is
+ * normally a bit faster. Otherwise the copy is done going downwards.  This
+ * is a transposition of the code from copy_template.S but with the copy
+ * occurring in the opposite direction.
+ */
+
+ENTRY(memmove)
+
+		subs	ip, r0, r1
+		cmphi	r2, ip
+		bls	memcpy
+
+		stmfd	sp!, {r0, r4, lr}
+		add	r1, r1, r2
+		add	r0, r0, r2
+		subs	r2, r2, #4
+		blt	8f
+		ands	ip, r0, #3
+	PLD(	pld	[r1, #-4]		)
+		bne	9f
+		ands	ip, r1, #3
+		bne	10f
+
+1:		subs	r2, r2, #(28)
+		stmfd	sp!, {r5 - r8}
+		blt	5f
+
+	CALGN(	ands	ip, r0, #31		)
+	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
+	CALGN(	bcs	2f			)
+	CALGN(	adr	r4, 6f			)
+	CALGN(	subs	r2, r2, ip		)  @ C is set here
+	CALGN(	rsb	ip, ip, #32		)
+	CALGN(	add	pc, r4, ip		)
+
+	PLD(	pld	[r1, #-4]		)
+2:	PLD(	subs	r2, r2, #96		)
+	PLD(	pld	[r1, #-32]		)
+	PLD(	blt	4f			)
+	PLD(	pld	[r1, #-64]		)
+	PLD(	pld	[r1, #-96]		)
+
+3:	PLD(	pld	[r1, #-128]		)
+4:		ldmdb	r1!, {r3, r4, r5, r6, r7, r8, ip, lr}
+		subs	r2, r2, #32
+		stmdb	r0!, {r3, r4, r5, r6, r7, r8, ip, lr}
+		bge	3b
+	PLD(	cmn	r2, #96			)
+	PLD(	bge	4b			)
+
+5:		ands	ip, r2, #28
+		rsb	ip, ip, #32
+		addne	pc, pc, ip		@ C is always clear here
+		b	7f
+6:		W(nop)
+		W(ldr)	r3, [r1, #-4]!
+		W(ldr)	r4, [r1, #-4]!
+		W(ldr)	r5, [r1, #-4]!
+		W(ldr)	r6, [r1, #-4]!
+		W(ldr)	r7, [r1, #-4]!
+		W(ldr)	r8, [r1, #-4]!
+		W(ldr)	lr, [r1, #-4]!
+
+		add	pc, pc, ip
+		nop
+		W(nop)
+		W(str)	r3, [r0, #-4]!
+		W(str)	r4, [r0, #-4]!
+		W(str)	r5, [r0, #-4]!
+		W(str)	r6, [r0, #-4]!
+		W(str)	r7, [r0, #-4]!
+		W(str)	r8, [r0, #-4]!
+		W(str)	lr, [r0, #-4]!
+
+	CALGN(	bcs	2b			)
+
+7:		ldmfd	sp!, {r5 - r8}
+
+8:		movs	r2, r2, lsl #31
+		ldrneb	r3, [r1, #-1]!
+		ldrcsb	r4, [r1, #-1]!
+		ldrcsb	ip, [r1, #-1]
+		strneb	r3, [r0, #-1]!
+		strcsb	r4, [r0, #-1]!
+		strcsb	ip, [r0, #-1]
+		ldmfd	sp!, {r0, r4, pc}
+
+9:		cmp	ip, #2
+		ldrgtb	r3, [r1, #-1]!
+		ldrgeb	r4, [r1, #-1]!
+		ldrb	lr, [r1, #-1]!
+		strgtb	r3, [r0, #-1]!
+		strgeb	r4, [r0, #-1]!
+		subs	r2, r2, ip
+		strb	lr, [r0, #-1]!
+		blt	8b
+		ands	ip, r1, #3
+		beq	1b
+
+10:		bic	r1, r1, #3
+		cmp	ip, #2
+		ldr	r3, [r1, #0]
+		beq	17f
+		blt	18f
+
+
+		.macro	backward_copy_shift push pull
+
+		subs	r2, r2, #28
+		blt	14f
+
+	CALGN(	ands	ip, r0, #31		)
+	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
+	CALGN(	subcc	r2, r2, ip		)
+	CALGN(	bcc	15f			)
+
+11:		stmfd	sp!, {r5 - r9}
+
+	PLD(	pld	[r1, #-4]		)
+	PLD(	subs	r2, r2, #96		)
+	PLD(	pld	[r1, #-32]		)
+	PLD(	blt	13f			)
+	PLD(	pld	[r1, #-64]		)
+	PLD(	pld	[r1, #-96]		)
+
+12:	PLD(	pld	[r1, #-128]		)
+13:		ldmdb   r1!, {r7, r8, r9, ip}
+		mov     lr, r3, push #\push
+		subs    r2, r2, #32
+		ldmdb   r1!, {r3, r4, r5, r6}
+		orr     lr, lr, ip, pull #\pull
+		mov     ip, ip, push #\push
+		orr     ip, ip, r9, pull #\pull
+		mov     r9, r9, push #\push
+		orr     r9, r9, r8, pull #\pull
+		mov     r8, r8, push #\push
+		orr     r8, r8, r7, pull #\pull
+		mov     r7, r7, push #\push
+		orr     r7, r7, r6, pull #\pull
+		mov     r6, r6, push #\push
+		orr     r6, r6, r5, pull #\pull
+		mov     r5, r5, push #\push
+		orr     r5, r5, r4, pull #\pull
+		mov     r4, r4, push #\push
+		orr     r4, r4, r3, pull #\pull
+		stmdb   r0!, {r4 - r9, ip, lr}
+		bge	12b
+	PLD(	cmn	r2, #96			)
+	PLD(	bge	13b			)
+
+		ldmfd	sp!, {r5 - r9}
+
+14:		ands	ip, r2, #28
+		beq	16f
+
+15:		mov     lr, r3, push #\push
+		ldr	r3, [r1, #-4]!
+		subs	ip, ip, #4
+		orr	lr, lr, r3, pull #\pull
+		str	lr, [r0, #-4]!
+		bgt	15b
+	CALGN(	cmp	r2, #0			)
+	CALGN(	bge	11b			)
+
+16:		add	r1, r1, #(\pull / 8)
+		b	8b
+
+		.endm
+
+
+		backward_copy_shift	push=8	pull=24
+
+17:		backward_copy_shift	push=16	pull=16
+
+18:		backward_copy_shift	push=24	pull=8
+
+ENDPROC(memmove)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/memset.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/memset.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,129 @@
+/*
+ *  linux/arch/arm/lib/memset.S
+ *
+ *  Copyright (C) 1995-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  ASM optimised string functions
+ */
+
+#include <xen/config.h>
+
+#include "assembler.h"
+
+	.text
+	.align	5
+	.word	0
+
+1:	subs	r2, r2, #4		@ 1 do we have enough
+	blt	5f			@ 1 bytes to align with?
+	cmp	r3, #2			@ 1
+	strltb	r1, [r0], #1		@ 1
+	strleb	r1, [r0], #1		@ 1
+	strb	r1, [r0], #1		@ 1
+	add	r2, r2, r3		@ 1 (r2 = r2 - (4 - r3))
+/*
+ * The pointer is now aligned and the length is adjusted.  Try doing the
+ * memset again.
+ */
+
+ENTRY(memset)
+	ands	r3, r0, #3		@ 1 unaligned?
+	bne	1b			@ 1
+/*
+ * we know that the pointer in r0 is aligned to a word boundary.
+ */
+	orr	r1, r1, r1, lsl #8
+	orr	r1, r1, r1, lsl #16
+	mov	r3, r1
+	cmp	r2, #16
+	blt	4f
+
+#if ! CALGN(1)+0
+
+/*
+ * We need an extra register for this loop - save the return address and
+ * use the LR
+ */
+	str	lr, [sp, #-4]!
+	mov	ip, r1
+	mov	lr, r1
+
+2:	subs	r2, r2, #64
+	stmgeia	r0!, {r1, r3, ip, lr}	@ 64 bytes at a time.
+	stmgeia	r0!, {r1, r3, ip, lr}
+	stmgeia	r0!, {r1, r3, ip, lr}
+	stmgeia	r0!, {r1, r3, ip, lr}
+	bgt	2b
+	ldmeqfd	sp!, {pc}		@ Now <64 bytes to go.
+/*
+ * No need to correct the count; we're only testing bits from now on
+ */
+	tst	r2, #32
+	stmneia	r0!, {r1, r3, ip, lr}
+	stmneia	r0!, {r1, r3, ip, lr}
+	tst	r2, #16
+	stmneia	r0!, {r1, r3, ip, lr}
+	ldr	lr, [sp], #4
+
+#else
+
+/*
+ * This version aligns the destination pointer in order to write
+ * whole cache lines at once.
+ */
+
+	stmfd	sp!, {r4-r7, lr}
+	mov	r4, r1
+	mov	r5, r1
+	mov	r6, r1
+	mov	r7, r1
+	mov	ip, r1
+	mov	lr, r1
+
+	cmp	r2, #96
+	tstgt	r0, #31
+	ble	3f
+
+	and	ip, r0, #31
+	rsb	ip, ip, #32
+	sub	r2, r2, ip
+	movs	ip, ip, lsl #(32 - 4)
+	stmcsia	r0!, {r4, r5, r6, r7}
+	stmmiia	r0!, {r4, r5}
+	tst	ip, #(1 << 30)
+	mov	ip, r1
+	strne	r1, [r0], #4
+
+3:	subs	r2, r2, #64
+	stmgeia	r0!, {r1, r3-r7, ip, lr}
+	stmgeia	r0!, {r1, r3-r7, ip, lr}
+	bgt	3b
+	ldmeqfd	sp!, {r4-r7, pc}
+
+	tst	r2, #32
+	stmneia	r0!, {r1, r3-r7, ip, lr}
+	tst	r2, #16
+	stmneia	r0!, {r4-r7}
+	ldmfd	sp!, {r4-r7, lr}
+
+#endif
+
+4:	tst	r2, #8
+	stmneia	r0!, {r1, r3}
+	tst	r2, #4
+	strne	r1, [r0], #4
+/*
+ * When we get here, we've got less than 4 bytes to zero.  We
+ * may have an unaligned pointer as well.
+ */
+5:	tst	r2, #2
+	strneb	r1, [r0], #1
+	strneb	r1, [r0], #1
+	tst	r2, #1
+	strneb	r1, [r0], #1
+	mov	pc, lr
+ENDPROC(memset)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/memzero.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/memzero.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,127 @@
+/*
+ *  linux/arch/arm/lib/memzero.S
+ *
+ *  Copyright (C) 1995-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <xen/config.h>
+
+#include "assembler.h"
+
+	.text
+	.align	5
+	.word	0
+/*
+ * Align the pointer in r0.  r3 contains the number of bytes that we are
+ * mis-aligned by, and r1 is the number of bytes.  If r1 < 4, then we
+ * don't bother; we use byte stores instead.
+ */
+1:	subs	r1, r1, #4		@ 1 do we have enough
+	blt	5f			@ 1 bytes to align with?
+	cmp	r3, #2			@ 1
+	strltb	r2, [r0], #1		@ 1
+	strleb	r2, [r0], #1		@ 1
+	strb	r2, [r0], #1		@ 1
+	add	r1, r1, r3		@ 1 (r1 = r1 - (4 - r3))
+/*
+ * The pointer is now aligned and the length is adjusted.  Try doing the
+ * memzero again.
+ */
+
+ENTRY(__memzero)
+	mov	r2, #0			@ 1
+	ands	r3, r0, #3		@ 1 unaligned?
+	bne	1b			@ 1
+/*
+ * r3 = 0, and we know that the pointer in r0 is aligned to a word boundary.
+ */
+	cmp	r1, #16			@ 1 we can skip this chunk if we
+	blt	4f			@ 1 have < 16 bytes
+
+#if ! CALGN(1)+0
+
+/*
+ * We need an extra register for this loop - save the return address and
+ * use the LR
+ */
+	str	lr, [sp, #-4]!		@ 1
+	mov	ip, r2			@ 1
+	mov	lr, r2			@ 1
+
+3:	subs	r1, r1, #64		@ 1 write 32 bytes out per loop
+	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
+	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
+	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
+	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
+	bgt	3b			@ 1
+	ldmeqfd	sp!, {pc}		@ 1/2 quick exit
+/*
+ * No need to correct the count; we're only testing bits from now on
+ */
+	tst	r1, #32			@ 1
+	stmneia	r0!, {r2, r3, ip, lr}	@ 4
+	stmneia	r0!, {r2, r3, ip, lr}	@ 4
+	tst	r1, #16			@ 1 16 bytes or more?
+	stmneia	r0!, {r2, r3, ip, lr}	@ 4
+	ldr	lr, [sp], #4		@ 1
+
+#else
+
+/*
+ * This version aligns the destination pointer in order to write
+ * whole cache lines at once.
+ */
+
+	stmfd	sp!, {r4-r7, lr}
+	mov	r4, r2
+	mov	r5, r2
+	mov	r6, r2
+	mov	r7, r2
+	mov	ip, r2
+	mov	lr, r2
+
+	cmp	r1, #96
+	andgts	ip, r0, #31
+	ble	3f
+
+	rsb	ip, ip, #32
+	sub	r1, r1, ip
+	movs	ip, ip, lsl #(32 - 4)
+	stmcsia	r0!, {r4, r5, r6, r7}
+	stmmiia	r0!, {r4, r5}
+	movs	ip, ip, lsl #2
+	strcs	r2, [r0], #4
+
+3:	subs	r1, r1, #64
+	stmgeia	r0!, {r2-r7, ip, lr}
+	stmgeia	r0!, {r2-r7, ip, lr}
+	bgt	3b
+	ldmeqfd	sp!, {r4-r7, pc}
+
+	tst	r1, #32
+	stmneia	r0!, {r2-r7, ip, lr}
+	tst	r1, #16
+	stmneia	r0!, {r4-r7}
+	ldmfd	sp!, {r4-r7, lr}
+
+#endif
+
+4:	tst	r1, #8			@ 1 8 bytes or more?
+	stmneia	r0!, {r2, r3}		@ 2
+	tst	r1, #4			@ 1 4 bytes or more?
+	strne	r2, [r0], #4		@ 1
+/*
+ * When we get here, we've got less than 4 bytes to zero.  We
+ * may have an unaligned pointer as well.
+ */
+5:	tst	r1, #2			@ 1 2 bytes or more?
+	strneb	r2, [r0], #1		@ 1
+	strneb	r2, [r0], #1		@ 1
+	tst	r1, #1			@ 1 a byte left over
+	strneb	r2, [r0], #1		@ 1
+	mov	pc, lr			@ 1
+ENDPROC(__memzero)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/setbit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/setbit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/arm/lib/setbit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+	.text
+
+ENTRY(_set_bit)
+	bitop	orr
+ENDPROC(_set_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/testchangebit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/testchangebit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/arm/lib/testchangebit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+                .text
+
+ENTRY(_test_and_change_bit)
+	testop	eor, str
+ENDPROC(_test_and_change_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/testclearbit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/testclearbit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/arm/lib/testclearbit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+                .text
+
+ENTRY(_test_and_clear_bit)
+	testop	bicne, strne
+ENDPROC(_test_and_clear_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/testsetbit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/testsetbit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/arm/lib/testsetbit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+                .text
+
+ENTRY(_test_and_set_bit)
+	testop	orreq, streq
+ENDPROC(_test_and_set_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/mode_switch.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/mode_switch.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,121 @@
+/*
+ * xen/arch/arm/mode_switch.S
+ *
+ * Start-of day code to take a CPU from Secure mode to Hyp mode.
+ *
+ * Tim Deegan <tim@xen.org>
+ * Copyright (c) 2011-2012 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/config.h>
+#include <asm/page.h>
+#include <asm/platform_vexpress.h>
+#include <asm/asm_defns.h>
+#include <asm/gic.h>
+
+
+/* XXX: Versatile Express specific code */
+/* wake up secondary cpus */
+.globl kick_cpus
+kick_cpus:
+        /* write start paddr to v2m sysreg FLAGSSET register */
+        ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
+        dsb
+        mov   r2, #0xffffffff
+        str   r2, [r0, #(V2M_SYS_FLAGSCLR)]
+        dsb
+        ldr   r2, =start
+        add   r2, r2, r10
+        str   r2, [r0, #(V2M_SYS_FLAGSSET)]
+        dsb
+        /* send an interrupt */
+        ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
+        mov   r2, #0x1
+        str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
+        mov   r2, #0xfe0000
+        str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
+        dsb
+        str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
+        mov   pc, lr
+
+
+/* Get up a CPU into Hyp mode.  Clobbers r0-r3.
+ *
+ * Expects r12 == CPU number
+ *
+ * This code is specific to the VE model, and not intended to be used
+ * on production systems.  As such it's a bit hackier than the main
+ * boot code in head.S.  In future it will be replaced by better
+ * integration with the bootloader/firmware so that Xen always starts
+ * in Hyp mode. */
+
+.globl enter_hyp_mode
+enter_hyp_mode:
+        mov   r3, lr                 /* Put return address in non-banked reg */
+        cpsid aif, #0x16             /* Enter Monitor mode */
+        mrc   CP32(r0, SCR)
+        orr   r0, r0, #0x100         /* Set HCE */
+        orr   r0, r0, #0xb1          /* Set SCD, AW, FW and NS */
+        bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
+        mcr   CP32(r0, SCR)
+        /* Ugly: the system timer's frequency register is only
+         * programmable in Secure state.  Since we don't know where its
+         * memory-mapped control registers live, we can't find out the
+         * right frequency.  Use the VE model's default frequency here. */
+        ldr   r0, =0x5f5e100         /* 100 MHz */
+        mcr   CP32(r0, CNTFRQ)
+        ldr   r0, =0x40c00           /* SMP, c11, c10 in non-secure mode */
+        mcr   CP32(r0, NSACR)
+        mov   r0, #GIC_BASE_ADDRESS
+        add   r0, r0, #GIC_DR_OFFSET
+        /* Disable the GIC distributor, on the boot CPU only */
+        mov   r1, #0
+        teq   r12, #0                /* Is this the boot CPU? */
+        streq r1, [r0]
+        /* Continuing ugliness: Set up the GIC so NS state owns interrupts,
+         * The first 32 interrupts (SGIs & PPIs) must be configured on all
+         * CPUs while the remainder are SPIs and only need to be done one, on
+         * the boot CPU. */
+        add   r0, r0, #0x80          /* GICD_IGROUP0 */
+        mov   r2, #0xffffffff        /* All interrupts to group 1 */
+        teq   r12, #0                /* Boot CPU? */
+        str   r2, [r0]               /* Interrupts  0-31 (SGI & PPI) */
+        streq r2, [r0, #4]           /* Interrupts 32-63 (SPI) */
+        streq r2, [r0, #8]           /* Interrupts 64-95 (SPI) */
+        /* Disable the GIC CPU interface on all processors */
+        mov   r0, #GIC_BASE_ADDRESS
+        add   r0, r0, #GIC_CR_OFFSET
+        mov   r1, #0
+        str   r1, [r0]
+        /* Must drop priority mask below 0x80 before entering NS state */
+        ldr   r1, =0xff
+        str   r1, [r0, #0x4]         /* -> GICC_PMR */
+        /* Reset a few config registers */
+        mov   r0, #0
+        mcr   CP32(r0, FCSEIDR)
+        mcr   CP32(r0, CONTEXTIDR)
+        /* Allow non-secure access to coprocessors, FIQs, VFP and NEON */
+        ldr   r1, =0x3fff            /* 14 CP bits set, all others clear */
+        mcr   CP32(r1, NSACR)
+
+        mrs   r0, cpsr               /* Copy the CPSR */
+        add   r0, r0, #0x4           /* 0x16 (Monitor) -> 0x1a (Hyp) */
+        msr   spsr_cxsf, r0          /* into the SPSR */
+        movs  pc, r3                 /* Exception-return into Hyp mode */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/proc-ca15.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/proc-ca15.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,35 @@
+/*
+ * xen/arch/arm/proc-ca15.S
+ *
+ * Cortex A15 specific initializations
+ *
+ * Copyright (c) 2011 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/asm_defns.h>
+#include <asm/processor-ca15.h>
+
+.globl cortex_a15_init
+cortex_a15_init:
+        /* Set up the SMP bit in ACTLR */
+        mrc   CP32(r0, ACTLR)
+        orr   r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit */
+        mcr   CP32(r0, ACTLR)
+        mov   pc, lr
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/asm-offsets.c
--- a/xen/arch/arm/asm-offsets.c	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Generate definitions needed by assembly language modules.
- * This code generates raw asm output which is post-processed
- * to extract and format the required data.
- */
-#define COMPILE_OFFSETS
-
-#include <xen/config.h>
-#include <xen/types.h>
-#include <xen/sched.h>
-#include <public/xen.h>
-#include <asm/current.h>
-
-#define DEFINE(_sym, _val) \
-    __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
-#define BLANK() \
-    __asm__ __volatile__ ( "\n->" : : )
-#define OFFSET(_sym, _str, _mem) \
-    DEFINE(_sym, offsetof(_str, _mem));
-
-/* base-2 logarithm */
-#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
-#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
-#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
-#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
-#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
-
-void __dummy__(void)
-{
-   OFFSET(UREGS_sp, struct cpu_user_regs, sp);
-   OFFSET(UREGS_lr, struct cpu_user_regs, lr);
-   OFFSET(UREGS_pc, struct cpu_user_regs, pc);
-   OFFSET(UREGS_cpsr, struct cpu_user_regs, cpsr);
-
-   OFFSET(UREGS_LR_usr, struct cpu_user_regs, lr_usr);
-   OFFSET(UREGS_SP_usr, struct cpu_user_regs, sp_usr);
-
-   OFFSET(UREGS_SP_svc, struct cpu_user_regs, sp_svc);
-   OFFSET(UREGS_LR_svc, struct cpu_user_regs, lr_svc);
-   OFFSET(UREGS_SPSR_svc, struct cpu_user_regs, spsr_svc);
-
-   OFFSET(UREGS_SP_abt, struct cpu_user_regs, sp_abt);
-   OFFSET(UREGS_LR_abt, struct cpu_user_regs, lr_abt);
-   OFFSET(UREGS_SPSR_abt, struct cpu_user_regs, spsr_abt);
-
-   OFFSET(UREGS_SP_und, struct cpu_user_regs, sp_und);
-   OFFSET(UREGS_LR_und, struct cpu_user_regs, lr_und);
-   OFFSET(UREGS_SPSR_und, struct cpu_user_regs, spsr_und);
-
-   OFFSET(UREGS_SP_irq, struct cpu_user_regs, sp_irq);
-   OFFSET(UREGS_LR_irq, struct cpu_user_regs, lr_irq);
-   OFFSET(UREGS_SPSR_irq, struct cpu_user_regs, spsr_irq);
-
-   OFFSET(UREGS_SP_fiq, struct cpu_user_regs, sp_fiq);
-   OFFSET(UREGS_LR_fiq, struct cpu_user_regs, lr_fiq);
-   OFFSET(UREGS_SPSR_fiq, struct cpu_user_regs, spsr_fiq);
-
-   OFFSET(UREGS_R8_fiq, struct cpu_user_regs, r8_fiq);
-   OFFSET(UREGS_R9_fiq, struct cpu_user_regs, r9_fiq);
-   OFFSET(UREGS_R10_fiq, struct cpu_user_regs, r10_fiq);
-   OFFSET(UREGS_R11_fiq, struct cpu_user_regs, r11_fiq);
-   OFFSET(UREGS_R12_fiq, struct cpu_user_regs, r12_fiq);
-
-   OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, cpsr);
-   DEFINE(UREGS_user_sizeof, sizeof(struct cpu_user_regs));
-   BLANK();
-
-   DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
-
-   OFFSET(VCPU_arch_saved_context, struct vcpu, arch.saved_context);
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/domain.c	Wed Dec 19 14:16:30 2012 +0000
@@ -12,7 +12,7 @@
 #include <asm/p2m.h>
 #include <asm/irq.h>
 
-#include "gic.h"
+#include <asm/gic.h>
 #include "vtimer.h"
 #include "vpl011.h"
 
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/domain_build.c
--- a/xen/arch/arm/domain_build.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/domain_build.c	Wed Dec 19 14:16:30 2012 +0000
@@ -11,7 +11,7 @@
 #include <xen/libfdt/libfdt.h>
 #include <xen/guest_access.h>
 
-#include "gic.h"
+#include <asm/gic.h>
 #include "kernel.h"
 
 static unsigned int __initdata opt_dom0_max_vcpus;
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-#include <xen/config.h>
-#include <asm/asm_defns.h>
-#include <public/xen.h>
-
-#define SAVE_ONE_BANKED(reg)    mrs r11, reg; str r11, [sp, #UREGS_##reg]
-#define RESTORE_ONE_BANKED(reg) ldr r11, [sp, #UREGS_##reg]; msr reg, r11
-
-#define SAVE_BANKED(mode) \
-        SAVE_ONE_BANKED(SP_##mode) ; SAVE_ONE_BANKED(LR_##mode) ; SAVE_ONE_BANKED(SPSR_##mode)
-
-#define RESTORE_BANKED(mode) \
-        RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
-
-#define SAVE_ALL                                                        \
-        sub sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */      \
-        push {r0-r12}; /* Save R0-R12 */                                \
-                                                                        \
-        mrs r11, ELR_hyp;               /* ELR_hyp is return address. */\
-        str r11, [sp, #UREGS_pc];                                       \
-                                                                        \
-        str lr, [sp, #UREGS_lr];                                        \
-                                                                        \
-        add r11, sp, #UREGS_kernel_sizeof+4;                            \
-        str r11, [sp, #UREGS_sp];                                       \
-                                                                        \
-        mrs r11, SPSR_hyp;                                              \
-        str r11, [sp, #UREGS_cpsr];                                     \
-        and r11, #PSR_MODE_MASK;                                        \
-        cmp r11, #PSR_MODE_HYP;                                         \
-        blne save_guest_regs
-
-save_guest_regs:
-        ldr r11, =0xffffffff  /* Clobber SP which is only valid for hypervisor frames. */
-        str r11, [sp, #UREGS_sp]
-        SAVE_ONE_BANKED(SP_usr)
-        /* LR_usr is the same physical register as lr and is saved in SAVE_ALL */
-        SAVE_BANKED(svc)
-        SAVE_BANKED(abt)
-        SAVE_BANKED(und)
-        SAVE_BANKED(irq)
-        SAVE_BANKED(fiq)
-        SAVE_ONE_BANKED(R8_fiq); SAVE_ONE_BANKED(R9_fiq); SAVE_ONE_BANKED(R10_fiq)
-        SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
-        mov pc, lr
-
-#define DEFINE_TRAP_ENTRY(trap)                                         \
-        ALIGN;                                                          \
-trap_##trap:                                                            \
-        SAVE_ALL;                                                       \
-        cpsie i;        /* local_irq_enable */                          \
-        adr lr, return_from_trap;                                       \
-        mov r0, sp;                                                     \
-        mov r11, sp;                                                    \
-        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
-        b do_trap_##trap
-
-#define DEFINE_TRAP_ENTRY_NOIRQ(trap)                                   \
-        ALIGN;                                                          \
-trap_##trap:                                                            \
-        SAVE_ALL;                                                       \
-        adr lr, return_from_trap;                                       \
-        mov r0, sp;                                                     \
-        mov r11, sp;                                                    \
-        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
-        b do_trap_##trap
-
-.globl hyp_traps_vector
-        .align 5
-hyp_traps_vector:
-        .word 0                         /* 0x00 - Reset */
-        b trap_undefined_instruction    /* 0x04 - Undefined Instruction */
-        b trap_supervisor_call          /* 0x08 - Supervisor Call */
-        b trap_prefetch_abort           /* 0x0c - Prefetch Abort */
-        b trap_data_abort               /* 0x10 - Data Abort */
-        b trap_hypervisor               /* 0x14 - Hypervisor */
-        b trap_irq                      /* 0x18 - IRQ */
-        b trap_fiq                      /* 0x1c - FIQ */
-
-DEFINE_TRAP_ENTRY(undefined_instruction)
-DEFINE_TRAP_ENTRY(supervisor_call)
-DEFINE_TRAP_ENTRY(prefetch_abort)
-DEFINE_TRAP_ENTRY(data_abort)
-DEFINE_TRAP_ENTRY(hypervisor)
-DEFINE_TRAP_ENTRY_NOIRQ(irq)
-DEFINE_TRAP_ENTRY_NOIRQ(fiq)
-
-return_from_trap:
-        mov sp, r11
-ENTRY(return_to_new_vcpu)
-        ldr r11, [sp, #UREGS_cpsr]
-        and r11, #PSR_MODE_MASK
-        cmp r11, #PSR_MODE_HYP
-        beq return_to_hypervisor
-        /* Fall thru */
-ENTRY(return_to_guest)
-        mov r11, sp
-        bic sp, #7 /* Align the stack pointer */
-        bl leave_hypervisor_tail /* Disables interrupts on return */
-        mov sp, r11
-        RESTORE_ONE_BANKED(SP_usr)
-        /* LR_usr is the same physical register as lr and is restored below */
-        RESTORE_BANKED(svc)
-        RESTORE_BANKED(abt)
-        RESTORE_BANKED(und)
-        RESTORE_BANKED(irq)
-        RESTORE_BANKED(fiq)
-        RESTORE_ONE_BANKED(R8_fiq); RESTORE_ONE_BANKED(R9_fiq); RESTORE_ONE_BANKED(R10_fiq)
-        RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq);
-        /* Fall thru */
-ENTRY(return_to_hypervisor)
-        cpsid i
-        ldr lr, [sp, #UREGS_lr]
-        ldr r11, [sp, #UREGS_pc]
-        msr ELR_hyp, r11
-        ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR_hyp, r11
-        pop {r0-r12}
-        add sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */
-        eret
-
-/*
- * struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next)
- *
- * r0 - prev
- * r1 - next
- *
- * Returns prev in r0
- */
-ENTRY(__context_switch)
-        add     ip, r0, #VCPU_arch_saved_context
-        stmia   ip!, {r4 - sl, fp, sp, lr}      /* Save register state */
-
-        add     r4, r1, #VCPU_arch_saved_context
-        ldmia   r4, {r4 - sl, fp, sp, pc}       /* Load registers and return */
-
-/*
- * Local variables:
- * mode: ASM
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/gic.c	Wed Dec 19 14:16:30 2012 +0000
@@ -30,7 +30,7 @@
 #include <asm/p2m.h>
 #include <asm/domain.h>
 
-#include "gic.h"
+#include <asm/gic.h>
 
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
- * xen/arch/arm/gic.h
- *
- * ARM Generic Interrupt Controller support
- *
- * Tim Deegan <tim@xen.org>
- * Copyright (c) 2011 Citrix Systems.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ARCH_ARM_GIC_H__
-#define __ARCH_ARM_GIC_H__
-
-#define GICD_CTLR       (0x000/4)
-#define GICD_TYPER      (0x004/4)
-#define GICD_IIDR       (0x008/4)
-#define GICD_IGROUPR    (0x080/4)
-#define GICD_IGROUPRN   (0x0FC/4)
-#define GICD_ISENABLER  (0x100/4)
-#define GICD_ISENABLERN (0x17C/4)
-#define GICD_ICENABLER  (0x180/4)
-#define GICD_ICENABLERN (0x1fC/4)
-#define GICD_ISPENDR    (0x200/4)
-#define GICD_ISPENDRN   (0x27C/4)
-#define GICD_ICPENDR    (0x280/4)
-#define GICD_ICPENDRN   (0x2FC/4)
-#define GICD_ISACTIVER  (0x300/4)
-#define GICD_ISACTIVERN (0x37C/4)
-#define GICD_ICACTIVER  (0x380/4)
-#define GICD_ICACTIVERN (0x3FC/4)
-#define GICD_IPRIORITYR (0x400/4)
-#define GICD_IPRIORITYRN (0x7F8/4)
-#define GICD_ITARGETSR  (0x800/4)
-#define GICD_ITARGETSRN (0xBF8/4)
-#define GICD_ICFGR      (0xC00/4)
-#define GICD_ICFGRN     (0xCFC/4)
-#define GICD_NSACR      (0xE00/4)
-#define GICD_NSACRN     (0xEFC/4)
-#define GICD_ICPIDR2    (0xFE8/4)
-#define GICD_SGIR       (0xF00/4)
-#define GICD_CPENDSGIR  (0xF10/4)
-#define GICD_CPENDSGIRN (0xF1C/4)
-#define GICD_SPENDSGIR  (0xF20/4)
-#define GICD_SPENDSGIRN (0xF2C/4)
-#define GICD_ICPIDR2    (0xFE8/4)
-
-#define GICC_CTLR       (0x0000/4)
-#define GICC_PMR        (0x0004/4)
-#define GICC_BPR        (0x0008/4)
-#define GICC_IAR        (0x000C/4)
-#define GICC_EOIR       (0x0010/4)
-#define GICC_RPR        (0x0014/4)
-#define GICC_HPPIR      (0x0018/4)
-#define GICC_APR        (0x00D0/4)
-#define GICC_NSAPR      (0x00E0/4)
-#define GICC_DIR        (0x1000/4)
-
-#define GICH_HCR        (0x00/4)
-#define GICH_VTR        (0x04/4)
-#define GICH_VMCR       (0x08/4)
-#define GICH_MISR       (0x10/4)
-#define GICH_EISR0      (0x20/4)
-#define GICH_EISR1      (0x24/4)
-#define GICH_ELSR0      (0x30/4)
-#define GICH_ELSR1      (0x34/4)
-#define GICH_APR        (0xF0/4)
-#define GICH_LR         (0x100/4)
-
-/* Register bits */
-#define GICD_CTL_ENABLE 0x1
-
-#define GICD_TYPE_LINES 0x01f
-#define GICD_TYPE_CPUS  0x0e0
-#define GICD_TYPE_SEC   0x400
-
-#define GICC_CTL_ENABLE 0x1
-#define GICC_CTL_EOI    (0x1 << 9)
-
-#define GICC_IA_IRQ     0x03ff
-#define GICC_IA_CPU     0x1c00
-
-#define GICH_HCR_EN       (1 << 0)
-#define GICH_HCR_UIE      (1 << 1)
-#define GICH_HCR_LRENPIE  (1 << 2)
-#define GICH_HCR_NPIE     (1 << 3)
-#define GICH_HCR_VGRP0EIE (1 << 4)
-#define GICH_HCR_VGRP0DIE (1 << 5)
-#define GICH_HCR_VGRP1EIE (1 << 6)
-#define GICH_HCR_VGRP1DIE (1 << 7)
-
-#define GICH_MISR_EOI     (1 << 0)
-#define GICH_MISR_U       (1 << 1)
-#define GICH_MISR_LRENP   (1 << 2)
-#define GICH_MISR_NP      (1 << 3)
-#define GICH_MISR_VGRP0E  (1 << 4)
-#define GICH_MISR_VGRP0D  (1 << 5)
-#define GICH_MISR_VGRP1E  (1 << 6)
-#define GICH_MISR_VGRP1D  (1 << 7)
-
-#define GICH_LR_VIRTUAL_MASK    0x3ff
-#define GICH_LR_VIRTUAL_SHIFT   0
-#define GICH_LR_PHYSICAL_MASK   0x3ff
-#define GICH_LR_PHYSICAL_SHIFT  10
-#define GICH_LR_STATE_MASK      0x3
-#define GICH_LR_STATE_SHIFT     28
-#define GICH_LR_PRIORITY_SHIFT  23
-#define GICH_LR_MAINTENANCE_IRQ (1<<19)
-#define GICH_LR_PENDING         (1<<28)
-#define GICH_LR_ACTIVE          (1<<29)
-#define GICH_LR_GRP1            (1<<30)
-#define GICH_LR_HW              (1<<31)
-#define GICH_LR_CPUID_SHIFT     9
-#define GICH_VTR_NRLRGS         0x3f
-
-/* XXX: write this into the DT */
-#define VGIC_IRQ_EVTCHN_CALLBACK 31
-
-#ifndef __ASSEMBLY__
-extern int domain_vgic_init(struct domain *d);
-extern void domain_vgic_free(struct domain *d);
-
-extern int vcpu_vgic_init(struct vcpu *v);
-
-extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual);
-extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
-
-extern void gic_route_ppis(void);
-extern void gic_route_spis(void);
-
-extern void gic_inject(void);
-
-extern void __cpuinit init_maintenance_interrupt(void);
-extern void gic_set_guest_irq(struct vcpu *v, unsigned int irq,
-        unsigned int state, unsigned int priority);
-extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
-                                  const char * devname);
-
-/* Accept an interrupt from the GIC and dispatch its handler */
-extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
-/* Bring up the interrupt controller, and report # cpus attached */
-extern void gic_init(void);
-/* Bring up a secondary CPU's per-CPU GIC interface */
-extern void gic_init_secondary_cpu(void);
-/* Take down a CPU's per-CPU GIC interface */
-extern void gic_disable_cpu(void);
-/* setup the gic virtual interface for a guest */
-extern int gicv_setup(struct domain *d);
-
-/* Context switch */
-extern void gic_save_state(struct vcpu *v);
-extern void gic_restore_state(struct vcpu *v);
-
-#endif /* __ASSEMBLY__ */
-#endif
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,415 +0,0 @@
-/*
- * xen/arch/arm/head.S
- *
- * Start-of-day code for an ARMv7-A with virt extensions.
- *
- * Tim Deegan <tim@xen.org>
- * Copyright (c) 2011 Citrix Systems.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <asm/config.h>
-#include <asm/page.h>
-#include <asm/processor-ca15.h>
-#include <asm/asm_defns.h>
-
-#define ZIMAGE_MAGIC_NUMBER 0x016f2818
-
-#define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
-#define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
-#define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
-#define PT_DEV_L3 0xe73 /* lev3: nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=1, P=1 */
-
-#define PT_UPPER(x) (PT_##x & 0xf00)
-#define PT_LOWER(x) (PT_##x & 0x0ff)
-
-/* Macro to print a string to the UART, if there is one.
- * Clobbers r0-r3. */
-#ifdef EARLY_UART_ADDRESS
-#define PRINT(_s)       \
-        adr   r0, 98f ; \
-        bl    puts    ; \
-        b     99f     ; \
-98:     .asciz _s     ; \
-        .align 2      ; \
-99:
-#else
-#define PRINT(s)
-#endif
-
-        .arm
-
-        /* This must be the very first address in the loaded image.
-         * It should be linked at XEN_VIRT_START, and loaded at any
-         * 2MB-aligned address.  All of text+data+bss must fit in 2MB,
-         * or the initial pagetable code below will need adjustment. */
-        .global start
-start:
-
-        /* zImage magic header, see:
-         * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
-         */
-        .rept 8
-        mov   r0, r0
-        .endr
-        b     past_zImage
-
-        .word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
-        .word 0x00000000             /* absolute load/run zImage address or
-                                      * 0 for PiC */
-        .word (_end - start)         /* zImage end address */
-
-past_zImage:
-        cpsid aif                    /* Disable all interrupts */
-
-        /* Save the bootloader arguments in less-clobberable registers */
-        mov   r7, r1                 /* r7 := ARM-linux machine type */
-        mov   r8, r2                 /* r8 := ATAG base address */
-
-        /* Find out where we are */
-        ldr   r0, =start
-        adr   r9, start              /* r9  := paddr (start) */
-        sub   r10, r9, r0            /* r10 := phys-offset */
-
-        /* Using the DTB in the .dtb section? */
-#ifdef CONFIG_DTB_FILE
-        ldr   r8, =_sdtb
-        add   r8, r10                /* r8 := paddr(DTB) */
-#endif
-
-        /* Are we the boot CPU? */
-        mov   r12, #0                /* r12 := CPU ID */
-        mrc   CP32(r0, MPIDR)
-        tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
-        beq   boot_cpu
-        tst   r0, #(1<<30)           /* Uniprocessor system? */
-        bne   boot_cpu
-        bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
-        beq   boot_cpu               /* If we're CPU 0, boot now */
-
-        /* Non-boot CPUs wait here to be woken up one at a time. */
-1:      dsb
-        ldr   r0, =smp_up_cpu        /* VA of gate */
-        add   r0, r0, r10            /* PA of gate */
-        ldr   r1, [r0]               /* Which CPU is being booted? */
-        teq   r1, r12                /* Is it us? */
-        wfene
-        bne   1b
-
-boot_cpu:
-#ifdef EARLY_UART_ADDRESS
-        ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
-        teq   r12, #0                   /* CPU 0 sets up the UART too */
-        bleq  init_uart
-        PRINT("- CPU ")
-        mov   r0, r12
-        bl    putn
-        PRINT(" booting -\r\n")
-#endif
-
-        /* Wake up secondary cpus */
-        teq   r12, #0
-        bleq  kick_cpus
-
-        /* Check that this CPU has Hyp mode */
-        mrc   CP32(r0, ID_PFR1)
-        and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
-        teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
-        beq   1f
-        PRINT("- CPU doesn't support the virtualization extensions -\r\n")
-        b     fail
-1:
-        /* Check if we're already in it */
-        mrs   r0, cpsr
-        and   r0, r0, #0x1f          /* Mode is in the low 5 bits of CPSR */
-        teq   r0, #0x1a              /* Hyp Mode? */
-        bne   1f
-        PRINT("- Started in Hyp mode -\r\n")
-        b     hyp
-1:
-        /* Otherwise, it must have been Secure Supervisor mode */
-        mrc   CP32(r0, SCR)
-        tst   r0, #0x1               /* Not-Secure bit set? */
-        beq   1f
-        PRINT("- CPU is not in Hyp mode or Secure state -\r\n")
-        b     fail
-1:
-        /* OK, we're in Secure state. */
-        PRINT("- Started in Secure state -\r\n- Entering Hyp mode -\r\n")
-        ldr   r0, =enter_hyp_mode    /* VA of function */
-        adr   lr, hyp                /* Set return address for call */
-        add   pc, r0, r10            /* Call PA of function */
-
-hyp:
-
-        /* Zero BSS On the boot CPU to avoid nasty surprises */
-        teq   r12, #0
-        bne   skip_bss
-
-        PRINT("- Zero BSS -\r\n")
-        ldr   r0, =__bss_start       /* Load start & end of bss */
-        ldr   r1, =__bss_end
-        add   r0, r0, r10            /* Apply physical offset */
-        add   r1, r1, r10
-
-        mov   r2, #0
-1:      str   r2, [r0], #4
-        cmp   r0, r1
-        blo   1b
-
-skip_bss:
-
-        PRINT("- Setting up control registers -\r\n")
-
-        /* Read CPU ID */
-        mrc   CP32(r0, MIDR)
-        ldr   r1, =(MIDR_MASK)
-        and   r0, r0, r1
-        /* Is this a Cortex A15? */
-        ldr   r1, =(CORTEX_A15_ID)
-        teq   r0, r1
-        bleq  cortex_a15_init
-
-        /* Set up memory attribute type tables */
-        ldr   r0, =MAIR0VAL
-        ldr   r1, =MAIR1VAL
-        mcr   CP32(r0, MAIR0)
-        mcr   CP32(r1, MAIR1)
-        mcr   CP32(r0, HMAIR0)
-        mcr   CP32(r1, HMAIR1)
-
-        /* Set up the HTCR:
-         * PT walks use Outer-Shareable accesses,
-         * PT walks are write-back, no-write-allocate in both cache levels,
-         * Full 32-bit address space goes through this table. */
-        ldr   r0, =0x80002500
-        mcr   CP32(r0, HTCR)
-
-        /* Set up the HSCTLR:
-         * Exceptions in LE ARM,
-         * Low-latency IRQs disabled,
-         * Write-implies-XN disabled (for now),
-         * D-cache disabled (for now),
-         * I-cache enabled,
-         * Alignment checking enabled,
-         * MMU translation disabled (for now). */
-        ldr   r0, =(HSCTLR_BASE|SCTLR_A)
-        mcr   CP32(r0, HSCTLR)
-
-        /* Write Xen's PT's paddr into the HTTBR */
-        ldr   r4, =xen_pgtable
-        add   r4, r4, r10            /* r4 := paddr (xen_pagetable) */
-        mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
-        mcrr  CP64(r4, r5, HTTBR)
-
-        /* Non-boot CPUs don't need to rebuild the pagetable */
-        teq   r12, #0
-        bne   pt_ready
-
-        /* console fixmap */
-#ifdef EARLY_UART_ADDRESS
-        ldr   r1, =xen_fixmap
-        add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
-        mov   r3, #0
-        lsr   r2, r11, #12
-        lsl   r2, r2, #12            /* 4K aligned paddr of UART */
-        orr   r2, r2, #PT_UPPER(DEV_L3)
-        orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
-        strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
-#endif
-
-        /* Build the baseline idle pagetable's first-level entries */
-        ldr   r1, =xen_second
-        add   r1, r1, r10            /* r1 := paddr (xen_second) */
-        mov   r3, #0x0
-        orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 := table map of xen_second */
-        orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
-        strd  r2, r3, [r4, #0]       /* Map it in slot 0 */
-        add   r2, r2, #0x1000
-        strd  r2, r3, [r4, #8]       /* Map 2nd page in slot 1 */
-        add   r2, r2, #0x1000
-        strd  r2, r3, [r4, #16]      /* Map 3rd page in slot 2 */
-        add   r2, r2, #0x1000
-        strd  r2, r3, [r4, #24]      /* Map 4th page in slot 3 */
-
-        /* Now set up the second-level entries */
-        orr   r2, r9, #PT_UPPER(MEM)
-        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB normal map of Xen */
-        mov   r4, r9, lsr #18        /* Slot for paddr(start) */
-        strd  r2, r3, [r1, r4]       /* Map Xen there */
-        ldr   r4, =start
-        lsr   r4, #18                /* Slot for vaddr(start) */
-        strd  r2, r3, [r1, r4]       /* Map Xen there too */
-
-        /* xen_fixmap pagetable */
-        ldr   r2, =xen_fixmap
-        add   r2, r2, r10            /* r2 := paddr (xen_fixmap) */
-        orr   r2, r2, #PT_UPPER(PT)
-        orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 := table map of xen_fixmap */
-        add   r4, r4, #8
-        strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
-
-        mov   r3, #0x0
-        lsr   r2, r8, #21
-        lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
-        orr   r2, r2, #PT_UPPER(MEM)
-        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB RAM incl. DTB */
-        add   r4, r4, #8
-        strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
-
-pt_ready:
-        PRINT("- Turning on paging -\r\n")
-
-        ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
-        mrc   CP32(r0, HSCTLR)
-        orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
-        dsb                          /* Flush PTE writes and finish reads */
-        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
-        isb                          /* Now, flush the icache */
-        mov   pc, r1                 /* Get a proper vaddr into PC */
-paging:
-
-
-#ifdef EARLY_UART_ADDRESS
-        /* Use a virtual address to access the UART. */
-        ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
-#endif
-
-        PRINT("- Ready -\r\n")
-
-        /* The boot CPU should go straight into C now */
-        teq   r12, #0
-        beq   launch
-
-        /* Non-boot CPUs need to move on to the relocated pagetables */
-        mov   r0, #0
-        ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
-        add   r4, r4, r10            /* PA of it */
-        ldrd  r4, r5, [r4]           /* Actual value */
-        dsb
-        mcrr  CP64(r4, r5, HTTBR)
-        dsb
-        isb
-        mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
-        mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
-        mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
-        dsb                          /* Ensure completion of TLB+BP flush */
-        isb
-
-        /* Non-boot CPUs report that they've got this far */
-        ldr   r0, =ready_cpus
-1:      ldrex r1, [r0]               /*            { read # of ready CPUs } */
-        add   r1, r1, #1             /* Atomically { ++                   } */
-        strex r2, r1, [r0]           /*            { writeback            } */
-        teq   r2, #0
-        bne   1b
-        dsb
-        mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
-        dsb
-
-        /* Here, the non-boot CPUs must wait again -- they're now running on
-         * the boot CPU's pagetables so it's safe for the boot CPU to
-         * overwrite the non-relocated copy of Xen.  Once it's done that,
-         * and brought up the memory allocator, non-boot CPUs can get their
-         * own stacks and enter C. */
-1:      wfe
-        dsb
-        ldr   r0, =smp_up_cpu
-        ldr   r1, [r0]               /* Which CPU is being booted? */
-        teq   r1, r12                /* Is it us? */
-        bne   1b
-
-launch:
-        ldr   r0, =init_stack        /* Find the boot-time stack */
-        ldr   sp, [r0]
-        add   sp, #STACK_SIZE        /* (which grows down from the top). */
-        sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
-        mov   r0, r10                /* Marshal args: - phys_offset */
-        mov   r1, r7                 /*               - machine type */
-        mov   r2, r8                 /*               - ATAG address */
-        movs  r3, r12                /*               - CPU ID */
-        beq   start_xen              /* and disappear into the land of C */
-        b     start_secondary        /* (to the appropriate entry point) */
-
-/* Fail-stop
- * r0: string explaining why */
-fail:   PRINT("- Boot failed -\r\n")
-1:      wfe
-        b     1b
-
-#ifdef EARLY_UART_ADDRESS
-
-/* Bring up the UART. Specific to the PL011 UART.
- * Clobbers r0-r2 */
-init_uart:
-        mov   r1, #0x0
-        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor fraction) */
-        mov   r1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
-        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor integer) */
-        mov   r1, #0x60              /* 8n1 */
-        str   r1, [r11, #0x24]       /* -> UARTLCR_H (Line control) */
-        ldr   r1, =0x00000301        /* RXE | TXE | UARTEN */
-        str   r1, [r11, #0x30]       /* -> UARTCR (Control Register) */
-        adr   r0, 1f
-        b     puts
-1:      .asciz "- UART enabled -\r\n"
-        .align 4
-
-/* Print early debug messages.  Specific to the PL011 UART.
- * r0: Nul-terminated string to print.
- * Clobbers r0-r2 */
-puts:
-        ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
-        tst   r2, #0x8               /* Check BUSY bit */
-        bne   puts                   /* Wait for the UART to be ready */
-        ldrb  r2, [r0], #1           /* Load next char */
-        teq   r2, #0                 /* Exit on nul */
-        moveq pc, lr
-        str   r2, [r11]              /* -> UARTDR (Data Register) */
-        b     puts
-
-/* Print a 32-bit number in hex.  Specific to the PL011 UART.
- * r0: Number to print.
- * clobbers r0-r3 */
-putn:
-        adr   r1, hex
-        mov   r3, #8
-1:      ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
-        tst   r2, #0x8               /* Check BUSY bit */
-        bne   1b                     /* Wait for the UART to be ready */
-        and   r2, r0, #0xf0000000    /* Mask off the top nybble */
-        ldrb  r2, [r1, r2, lsr #28]  /* Convert to a char */
-        str   r2, [r11]              /* -> UARTDR (Data Register) */
-        lsl   r0, #4                 /* Roll it through one nybble at a time */
-        subs  r3, r3, #1
-        bne   1b
-        mov   pc, lr
-
-hex:    .ascii "0123456789abcdef"
-        .align 2
-
-#else  /* EARLY_UART_ADDRESS */
-
-init_uart:
-.global early_puts
-early_puts:
-puts:
-putn:   mov   pc, lr
-
-#endif /* EARLY_UART_ADDRESS */
-
-/*
- * Local variables:
- * mode: ASM
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/irq.c
--- a/xen/arch/arm/irq.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/irq.c	Wed Dec 19 14:16:30 2012 +0000
@@ -25,7 +25,7 @@
 #include <xen/errno.h>
 #include <xen/sched.h>
 
-#include "gic.h"
+#include <asm/gic.h>
 
 static void enable_none(struct irq_desc *irq) { }
 static unsigned int startup_none(struct irq_desc *irq) { return 0; }
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/Makefile
--- a/xen/arch/arm/lib/Makefile	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-obj-y += memcpy.o memmove.o memset.o memzero.o
-obj-y += findbit.o setbit.o
-obj-y += setbit.o clearbit.o changebit.o
-obj-y += testsetbit.o testclearbit.o testchangebit.o
-obj-y += lib1funcs.o lshrdi3.o div64.o
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/assembler.h
--- a/xen/arch/arm/lib/assembler.h	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,325 +0,0 @@
-/* From Linux arch/arm/include/asm/assembler.h */
-/*
- *  arch/arm/include/asm/assembler.h
- *
- *  Copyright (C) 1996-2000 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- *  This file contains arm architecture specific defines
- *  for the different processors.
- *
- *  Do not include any C declarations in this file - it is included by
- *  assembler source.
- */
-#ifndef __ASM_ASSEMBLER_H__
-#define __ASM_ASSEMBLER_H__
-
-#ifndef __ASSEMBLY__
-#error "Only include this from assembly code"
-#endif
-
-// No Thumb, hence:
-#define W(instr)        instr
-#define ARM(instr...)   instr
-#define THUMB(instr...)
-
-#ifdef CONFIG_ARM_UNWIND
-#define UNWIND(code...)         code
-#else
-#define UNWIND(code...)
-#endif
-
-/*
- * Endian independent macros for shifting bytes within registers.
- */
-#ifndef __ARMEB__
-#define pull            lsr
-#define push            lsl
-#define get_byte_0      lsl #0
-#define get_byte_1	lsr #8
-#define get_byte_2	lsr #16
-#define get_byte_3	lsr #24
-#define put_byte_0      lsl #0
-#define put_byte_1	lsl #8
-#define put_byte_2	lsl #16
-#define put_byte_3	lsl #24
-#else
-#define pull            lsl
-#define push            lsr
-#define get_byte_0	lsr #24
-#define get_byte_1	lsr #16
-#define get_byte_2	lsr #8
-#define get_byte_3      lsl #0
-#define put_byte_0	lsl #24
-#define put_byte_1	lsl #16
-#define put_byte_2	lsl #8
-#define put_byte_3      lsl #0
-#endif
-
-/*
- * Data preload for architectures that support it
- */
-#if __LINUX_ARM_ARCH__ >= 5
-#define PLD(code...)	code
-#else
-#define PLD(code...)
-#endif
-
-/*
- * This can be used to enable code to cacheline align the destination
- * pointer when bulk writing to memory.  Experiments on StrongARM and
- * XScale didn't show this a worthwhile thing to do when the cache is not
- * set to write-allocate (this would need further testing on XScale when WA
- * is used).
- *
- * On Feroceon there is much to gain however, regardless of cache mode.
- */
-#ifdef CONFIG_CPU_FEROCEON
-#define CALGN(code...) code
-#else
-#define CALGN(code...)
-#endif
-
-/*
- * Enable and disable interrupts
- */
-#if __LINUX_ARM_ARCH__ >= 6
-	.macro	disable_irq_notrace
-	cpsid	i
-	.endm
-
-	.macro	enable_irq_notrace
-	cpsie	i
-	.endm
-#else
-	.macro	disable_irq_notrace
-	msr	cpsr_c, #PSR_I_BIT | SVC_MODE
-	.endm
-
-	.macro	enable_irq_notrace
-	msr	cpsr_c, #SVC_MODE
-	.endm
-#endif
-
-	.macro asm_trace_hardirqs_off
-#if defined(CONFIG_TRACE_IRQFLAGS)
-	stmdb   sp!, {r0-r3, ip, lr}
-	bl	trace_hardirqs_off
-	ldmia	sp!, {r0-r3, ip, lr}
-#endif
-	.endm
-
-	.macro asm_trace_hardirqs_on_cond, cond
-#if defined(CONFIG_TRACE_IRQFLAGS)
-	/*
-	 * actually the registers should be pushed and pop'd conditionally, but
-	 * after bl the flags are certainly clobbered
-	 */
-	stmdb   sp!, {r0-r3, ip, lr}
-	bl\cond	trace_hardirqs_on
-	ldmia	sp!, {r0-r3, ip, lr}
-#endif
-	.endm
-
-	.macro asm_trace_hardirqs_on
-	asm_trace_hardirqs_on_cond al
-	.endm
-
-	.macro disable_irq
-	disable_irq_notrace
-	asm_trace_hardirqs_off
-	.endm
-
-	.macro enable_irq
-	asm_trace_hardirqs_on
-	enable_irq_notrace
-	.endm
-/*
- * Save the current IRQ state and disable IRQs.  Note that this macro
- * assumes FIQs are enabled, and that the processor is in SVC mode.
- */
-	.macro	save_and_disable_irqs, oldcpsr
-	mrs	\oldcpsr, cpsr
-	disable_irq
-	.endm
-
-/*
- * Restore interrupt state previously stored in a register.  We don't
- * guarantee that this will preserve the flags.
- */
-	.macro	restore_irqs_notrace, oldcpsr
-	msr	cpsr_c, \oldcpsr
-	.endm
-
-	.macro restore_irqs, oldcpsr
-	tst	\oldcpsr, #PSR_I_BIT
-	asm_trace_hardirqs_on_cond eq
-	restore_irqs_notrace \oldcpsr
-	.endm
-
-#define USER(x...)				\
-9999:	x;					\
-	.pushsection __ex_table,"a";		\
-	.align	3;				\
-	.long	9999b,9001f;			\
-	.popsection
-
-#ifdef CONFIG_SMP
-#define ALT_SMP(instr...)					\
-9998:	instr
-/*
- * Note: if you get assembler errors from ALT_UP() when building with
- * CONFIG_THUMB2_KERNEL, you almost certainly need to use
- * ALT_SMP( W(instr) ... )
- */
-#define ALT_UP(instr...)					\
-	.pushsection ".alt.smp.init", "a"			;\
-	.long	9998b						;\
-9997:	instr							;\
-	.if . - 9997b != 4					;\
-		.error "ALT_UP() content must assemble to exactly 4 bytes";\
-	.endif							;\
-	.popsection
-#define ALT_UP_B(label)					\
-	.equ	up_b_offset, label - 9998b			;\
-	.pushsection ".alt.smp.init", "a"			;\
-	.long	9998b						;\
-	W(b)	. + up_b_offset					;\
-	.popsection
-#else
-#define ALT_SMP(instr...)
-#define ALT_UP(instr...) instr
-#define ALT_UP_B(label) b label
-#endif
-
-/*
- * Instruction barrier
- */
-	.macro	instr_sync
-#if __LINUX_ARM_ARCH__ >= 7
-	isb
-#elif __LINUX_ARM_ARCH__ == 6
-	mcr	p15, 0, r0, c7, c5, 4
-#endif
-	.endm
-
-/*
- * SMP data memory barrier
- */
-	.macro	smp_dmb mode
-#ifdef CONFIG_SMP
-#if __LINUX_ARM_ARCH__ >= 7
-	.ifeqs "\mode","arm"
-	ALT_SMP(dmb)
-	.else
-	ALT_SMP(W(dmb))
-	.endif
-#elif __LINUX_ARM_ARCH__ == 6
-	ALT_SMP(mcr	p15, 0, r0, c7, c10, 5)	@ dmb
-#else
-#error Incompatible SMP platform
-#endif
-	.ifeqs "\mode","arm"
-	ALT_UP(nop)
-	.else
-	ALT_UP(W(nop))
-	.endif
-#endif
-	.endm
-
-#ifdef CONFIG_THUMB2_KERNEL
-	.macro	setmode, mode, reg
-	mov	\reg, #\mode
-	msr	cpsr_c, \reg
-	.endm
-#else
-	.macro	setmode, mode, reg
-	msr	cpsr_c, #\mode
-	.endm
-#endif
-
-/*
- * STRT/LDRT access macros with ARM and Thumb-2 variants
- */
-#ifdef CONFIG_THUMB2_KERNEL
-
-	.macro	usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T()
-9999:
-	.if	\inc == 1
-	\instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
-	.elseif	\inc == 4
-	\instr\cond\()\t\().w \reg, [\ptr, #\off]
-	.else
-	.error	"Unsupported inc macro argument"
-	.endif
-
-	.pushsection __ex_table,"a"
-	.align	3
-	.long	9999b, \abort
-	.popsection
-	.endm
-
-	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort
-	@ explicit IT instruction needed because of the label
-	@ introduced by the USER macro
-	.ifnc	\cond,al
-	.if	\rept == 1
-	itt	\cond
-	.elseif	\rept == 2
-	ittt	\cond
-	.else
-	.error	"Unsupported rept macro argument"
-	.endif
-	.endif
-
-	@ Slightly optimised to avoid incrementing the pointer twice
-	usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort
-	.if	\rept == 2
-	usraccoff \instr, \reg, \ptr, \inc, \inc, \cond, \abort
-	.endif
-
-	add\cond \ptr, #\rept * \inc
-	.endm
-
-#else	/* !CONFIG_THUMB2_KERNEL */
-
-	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort, t=T()
-	.rept	\rept
-9999:
-	.if	\inc == 1
-	\instr\cond\()b\()\t \reg, [\ptr], #\inc
-	.elseif	\inc == 4
-	\instr\cond\()\t \reg, [\ptr], #\inc
-	.else
-	.error	"Unsupported inc macro argument"
-	.endif
-
-	.pushsection __ex_table,"a"
-	.align	3
-	.long	9999b, \abort
-	.popsection
-	.endr
-	.endm
-
-#endif	/* CONFIG_THUMB2_KERNEL */
-
-	.macro	strusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
-	usracc	str, \reg, \ptr, \inc, \cond, \rept, \abort
-	.endm
-
-	.macro	ldrusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
-	usracc	ldr, \reg, \ptr, \inc, \cond, \rept, \abort
-	.endm
-
-/* Utility macro for declaring string literals */
-	.macro	string name:req, string
-	.type \name , #object
-\name:
-	.asciz "\string"
-	.size \name , . - \name
-	.endm
-
-#endif /* __ASM_ASSEMBLER_H__ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/bitops.h
--- a/xen/arch/arm/lib/bitops.h	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-#include <xen/config.h>
-
-#if __LINUX_ARM_ARCH__ >= 6
-	.macro	bitop, instr
-	ands	ip, r1, #3
-	strneb	r1, [ip]		@ assert word-aligned
-	mov	r2, #1
-	and	r3, r0, #31		@ Get bit offset
-	mov	r0, r0, lsr #5
-	add	r1, r1, r0, lsl #2	@ Get word offset
-	mov	r3, r2, lsl r3
-1:	ldrex	r2, [r1]
-	\instr	r2, r2, r3
-	strex	r0, r2, [r1]
-	cmp	r0, #0
-	bne	1b
-	bx	lr
-	.endm
-
-	.macro	testop, instr, store
-	ands	ip, r1, #3
-	strneb	r1, [ip]		@ assert word-aligned
-	mov	r2, #1
-	and	r3, r0, #31		@ Get bit offset
-	mov	r0, r0, lsr #5
-	add	r1, r1, r0, lsl #2	@ Get word offset
-	mov	r3, r2, lsl r3		@ create mask
-	smp_dmb
-1:	ldrex	r2, [r1]
-	ands	r0, r2, r3		@ save old value of bit
-	\instr	r2, r2, r3		@ toggle bit
-	strex	ip, r2, [r1]
-	cmp	ip, #0
-	bne	1b
-	smp_dmb
-	cmp	r0, #0
-	movne	r0, #1
-2:	bx	lr
-	.endm
-#else
-	.macro	bitop, name, instr
-ENTRY(	\name		)
-UNWIND(	.fnstart	)
-	ands	ip, r1, #3
-	strneb	r1, [ip]		@ assert word-aligned
-	and	r2, r0, #31
-	mov	r0, r0, lsr #5
-	mov	r3, #1
-	mov	r3, r3, lsl r2
-	save_and_disable_irqs ip
-	ldr	r2, [r1, r0, lsl #2]
-	\instr	r2, r2, r3
-	str	r2, [r1, r0, lsl #2]
-	restore_irqs ip
-	mov	pc, lr
-UNWIND(	.fnend		)
-ENDPROC(\name		)
-	.endm
-
-/**
- * testop - implement a test_and_xxx_bit operation.
- * @instr: operational instruction
- * @store: store instruction
- *
- * Note: we can trivially conditionalise the store instruction
- * to avoid dirtying the data cache.
- */
-	.macro	testop, name, instr, store
-ENTRY(	\name		)
-UNWIND(	.fnstart	)
-	ands	ip, r1, #3
-	strneb	r1, [ip]		@ assert word-aligned
-	and	r3, r0, #31
-	mov	r0, r0, lsr #5
-	save_and_disable_irqs ip
-	ldr	r2, [r1, r0, lsl #2]!
-	mov	r0, #1
-	tst	r2, r0, lsl r3
-	\instr	r2, r2, r0, lsl r3
-	\store	r2, [r1]
-	moveq	r0, #0
-	restore_irqs ip
-	mov	pc, lr
-UNWIND(	.fnend		)
-ENDPROC(\name		)
-	.endm
-#endif
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/changebit.S
--- a/xen/arch/arm/lib/changebit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- *  linux/arch/arm/lib/changebit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-                .text
-
-ENTRY(_change_bit)
-	bitop	eor
-ENDPROC(_change_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/clearbit.S
--- a/xen/arch/arm/lib/clearbit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/*
- *  linux/arch/arm/lib/clearbit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-                .text
-
-ENTRY(_clear_bit)
-	bitop	bic
-ENDPROC(_clear_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/copy_template.S
--- a/xen/arch/arm/lib/copy_template.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +0,0 @@
-/*
- *  linux/arch/arm/lib/copy_template.s
- *
- *  Code template for optimized memory copy functions
- *
- *  Author:	Nicolas Pitre
- *  Created:	Sep 28, 2005
- *  Copyright:	MontaVista Software, Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- */
-
-/*
- * Theory of operation
- * -------------------
- *
- * This file provides the core code for a forward memory copy used in
- * the implementation of memcopy(), copy_to_user() and copy_from_user().
- *
- * The including file must define the following accessor macros
- * according to the need of the given function:
- *
- * ldr1w ptr reg abort
- *
- *	This loads one word from 'ptr', stores it in 'reg' and increments
- *	'ptr' to the next word. The 'abort' argument is used for fixup tables.
- *
- * ldr4w ptr reg1 reg2 reg3 reg4 abort
- * ldr8w ptr, reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
- *
- *	This loads four or eight words starting from 'ptr', stores them
- *	in provided registers and increments 'ptr' past those words.
- *	The'abort' argument is used for fixup tables.
- *
- * ldr1b ptr reg cond abort
- *
- *	Similar to ldr1w, but it loads a byte and increments 'ptr' one byte.
- *	It also must apply the condition code if provided, otherwise the
- *	"al" condition is assumed by default.
- *
- * str1w ptr reg abort
- * str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
- * str1b ptr reg cond abort
- *
- *	Same as their ldr* counterparts, but data is stored to 'ptr' location
- *	rather than being loaded.
- *
- * enter reg1 reg2
- *
- *	Preserve the provided registers on the stack plus any additional
- *	data as needed by the implementation including this code. Called
- *	upon code entry.
- *
- * exit reg1 reg2
- *
- *	Restore registers with the values previously saved with the
- *	'preserv' macro. Called upon code termination.
- *
- * LDR1W_SHIFT
- * STR1W_SHIFT
- *
- *	Correction to be applied to the "ip" register when branching into
- *	the ldr1w or str1w instructions (some of these macros may expand to
- *	than one 32bit instruction in Thumb-2)
- */
-
-
-		enter	r4, lr
-
-		subs	r2, r2, #4
-		blt	8f
-		ands	ip, r0, #3
-	PLD(	pld	[r1, #0]		)
-		bne	9f
-		ands	ip, r1, #3
-		bne	10f
-
-1:		subs	r2, r2, #(28)
-		stmfd	sp!, {r5 - r8}
-		blt	5f
-
-	CALGN(	ands	ip, r0, #31		)
-	CALGN(	rsb	r3, ip, #32		)
-	CALGN(	sbcnes	r4, r3, r2		)  @ C is always set here
-	CALGN(	bcs	2f			)
-	CALGN(	adr	r4, 6f			)
-	CALGN(	subs	r2, r2, r3		)  @ C gets set
-	CALGN(	add	pc, r4, ip		)
-
-	PLD(	pld	[r1, #0]		)
-2:	PLD(	subs	r2, r2, #96		)
-	PLD(	pld	[r1, #28]		)
-	PLD(	blt	4f			)
-	PLD(	pld	[r1, #60]		)
-	PLD(	pld	[r1, #92]		)
-
-3:	PLD(	pld	[r1, #124]		)
-4:		ldr8w	r1, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f
-		subs	r2, r2, #32
-		str8w	r0, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f
-		bge	3b
-	PLD(	cmn	r2, #96			)
-	PLD(	bge	4b			)
-
-5:		ands	ip, r2, #28
-		rsb	ip, ip, #32
-#if LDR1W_SHIFT > 0
-		lsl	ip, ip, #LDR1W_SHIFT
-#endif
-		addne	pc, pc, ip		@ C is always clear here
-		b	7f
-6:
-		.rept	(1 << LDR1W_SHIFT)
-		W(nop)
-		.endr
-		ldr1w	r1, r3, abort=20f
-		ldr1w	r1, r4, abort=20f
-		ldr1w	r1, r5, abort=20f
-		ldr1w	r1, r6, abort=20f
-		ldr1w	r1, r7, abort=20f
-		ldr1w	r1, r8, abort=20f
-		ldr1w	r1, lr, abort=20f
-
-#if LDR1W_SHIFT < STR1W_SHIFT
-		lsl	ip, ip, #STR1W_SHIFT - LDR1W_SHIFT
-#elif LDR1W_SHIFT > STR1W_SHIFT
-		lsr	ip, ip, #LDR1W_SHIFT - STR1W_SHIFT
-#endif
-		add	pc, pc, ip
-		nop
-		.rept	(1 << STR1W_SHIFT)
-		W(nop)
-		.endr
-		str1w	r0, r3, abort=20f
-		str1w	r0, r4, abort=20f
-		str1w	r0, r5, abort=20f
-		str1w	r0, r6, abort=20f
-		str1w	r0, r7, abort=20f
-		str1w	r0, r8, abort=20f
-		str1w	r0, lr, abort=20f
-
-	CALGN(	bcs	2b			)
-
-7:		ldmfd	sp!, {r5 - r8}
-
-8:		movs	r2, r2, lsl #31
-		ldr1b	r1, r3, ne, abort=21f
-		ldr1b	r1, r4, cs, abort=21f
-		ldr1b	r1, ip, cs, abort=21f
-		str1b	r0, r3, ne, abort=21f
-		str1b	r0, r4, cs, abort=21f
-		str1b	r0, ip, cs, abort=21f
-
-		exit	r4, pc
-
-9:		rsb	ip, ip, #4
-		cmp	ip, #2
-		ldr1b	r1, r3, gt, abort=21f
-		ldr1b	r1, r4, ge, abort=21f
-		ldr1b	r1, lr, abort=21f
-		str1b	r0, r3, gt, abort=21f
-		str1b	r0, r4, ge, abort=21f
-		subs	r2, r2, ip
-		str1b	r0, lr, abort=21f
-		blt	8b
-		ands	ip, r1, #3
-		beq	1b
-
-10:		bic	r1, r1, #3
-		cmp	ip, #2
-		ldr1w	r1, lr, abort=21f
-		beq	17f
-		bgt	18f
-
-
-		.macro	forward_copy_shift pull push
-
-		subs	r2, r2, #28
-		blt	14f
-
-	CALGN(	ands	ip, r0, #31		)
-	CALGN(	rsb	ip, ip, #32		)
-	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
-	CALGN(	subcc	r2, r2, ip		)
-	CALGN(	bcc	15f			)
-
-11:		stmfd	sp!, {r5 - r9}
-
-	PLD(	pld	[r1, #0]		)
-	PLD(	subs	r2, r2, #96		)
-	PLD(	pld	[r1, #28]		)
-	PLD(	blt	13f			)
-	PLD(	pld	[r1, #60]		)
-	PLD(	pld	[r1, #92]		)
-
-12:	PLD(	pld	[r1, #124]		)
-13:		ldr4w	r1, r4, r5, r6, r7, abort=19f
-		mov	r3, lr, pull #\pull
-		subs	r2, r2, #32
-		ldr4w	r1, r8, r9, ip, lr, abort=19f
-		orr	r3, r3, r4, push #\push
-		mov	r4, r4, pull #\pull
-		orr	r4, r4, r5, push #\push
-		mov	r5, r5, pull #\pull
-		orr	r5, r5, r6, push #\push
-		mov	r6, r6, pull #\pull
-		orr	r6, r6, r7, push #\push
-		mov	r7, r7, pull #\pull
-		orr	r7, r7, r8, push #\push
-		mov	r8, r8, pull #\pull
-		orr	r8, r8, r9, push #\push
-		mov	r9, r9, pull #\pull
-		orr	r9, r9, ip, push #\push
-		mov	ip, ip, pull #\pull
-		orr	ip, ip, lr, push #\push
-		str8w	r0, r3, r4, r5, r6, r7, r8, r9, ip, , abort=19f
-		bge	12b
-	PLD(	cmn	r2, #96			)
-	PLD(	bge	13b			)
-
-		ldmfd	sp!, {r5 - r9}
-
-14:		ands	ip, r2, #28
-		beq	16f
-
-15:		mov	r3, lr, pull #\pull
-		ldr1w	r1, lr, abort=21f
-		subs	ip, ip, #4
-		orr	r3, r3, lr, push #\push
-		str1w	r0, r3, abort=21f
-		bgt	15b
-	CALGN(	cmp	r2, #0			)
-	CALGN(	bge	11b			)
-
-16:		sub	r1, r1, #(\push / 8)
-		b	8b
-
-		.endm
-
-
-		forward_copy_shift	pull=8	push=24
-
-17:		forward_copy_shift	pull=16	push=16
-
-18:		forward_copy_shift	pull=24	push=8
-
-
-/*
- * Abort preamble and completion macros.
- * If a fixup handler is required then those macros must surround it.
- * It is assumed that the fixup code will handle the private part of
- * the exit macro.
- */
-
-	.macro	copy_abort_preamble
-19:	ldmfd	sp!, {r5 - r9}
-	b	21f
-20:	ldmfd	sp!, {r5 - r8}
-21:
-	.endm
-
-	.macro	copy_abort_end
-	ldmfd	sp!, {r4, pc}
-	.endm
-
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/div64.S
--- a/xen/arch/arm/lib/div64.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +0,0 @@
-/*
- *  linux/arch/arm/lib/div64.S
- *
- *  Optimized computation of 64-bit dividend / 32-bit divisor
- *
- *  Author:	Nicolas Pitre
- *  Created:	Oct 5, 2003
- *  Copyright:	Monta Vista Software, Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- */
-
-#include <xen/config.h>
-#include "assembler.h"
-	
-#ifdef __ARMEB__
-#define xh r0
-#define xl r1
-#define yh r2
-#define yl r3
-#else
-#define xl r0
-#define xh r1
-#define yl r2
-#define yh r3
-#endif
-
-/*
- * __do_div64: perform a division with 64-bit dividend and 32-bit divisor.
- *
- * Note: Calling convention is totally non standard for optimal code.
- *       This is meant to be used by do_div() from include/asm/div64.h only.
- *
- * Input parameters:
- * 	xh-xl	= dividend (clobbered)
- * 	r4	= divisor (preserved)
- *
- * Output values:
- * 	yh-yl	= result
- * 	xh	= remainder
- *
- * Clobbered regs: xl, ip
- */
-
-ENTRY(__do_div64)
-UNWIND(.fnstart)
-
-	@ Test for easy paths first.
-	subs	ip, r4, #1
-	bls	9f			@ divisor is 0 or 1
-	tst	ip, r4
-	beq	8f			@ divisor is power of 2
-
-	@ See if we need to handle upper 32-bit result.
-	cmp	xh, r4
-	mov	yh, #0
-	blo	3f
-
-	@ Align divisor with upper part of dividend.
-	@ The aligned divisor is stored in yl preserving the original.
-	@ The bit position is stored in ip.
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	yl, r4
-	clz	ip, xh
-	sub	yl, yl, ip
-	mov	ip, #1
-	mov	ip, ip, lsl yl
-	mov	yl, r4, lsl yl
-
-#else
-
-	mov	yl, r4
-	mov	ip, #1
-1:	cmp	yl, #0x80000000
-	cmpcc	yl, xh
-	movcc	yl, yl, lsl #1
-	movcc	ip, ip, lsl #1
-	bcc	1b
-
-#endif
-
-	@ The division loop for needed upper bit positions.
- 	@ Break out early if dividend reaches 0.
-2:	cmp	xh, yl
-	orrcs	yh, yh, ip
-	subcss	xh, xh, yl
-	movnes	ip, ip, lsr #1
-	mov	yl, yl, lsr #1
-	bne	2b
-
-	@ See if we need to handle lower 32-bit result.
-3:	cmp	xh, #0
-	mov	yl, #0
-	cmpeq	xl, r4
-	movlo	xh, xl
-	movlo	pc, lr
-
-	@ The division loop for lower bit positions.
-	@ Here we shift remainer bits leftwards rather than moving the
-	@ divisor for comparisons, considering the carry-out bit as well.
-	mov	ip, #0x80000000
-4:	movs	xl, xl, lsl #1
-	adcs	xh, xh, xh
-	beq	6f
-	cmpcc	xh, r4
-5:	orrcs	yl, yl, ip
-	subcs	xh, xh, r4
-	movs	ip, ip, lsr #1
-	bne	4b
-	mov	pc, lr
-
-	@ The top part of remainder became zero.  If carry is set
-	@ (the 33th bit) this is a false positive so resume the loop.
-	@ Otherwise, if lower part is also null then we are done.
-6:	bcs	5b
-	cmp	xl, #0
-	moveq	pc, lr
-
-	@ We still have remainer bits in the low part.  Bring them up.
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	xh, xl			@ we know xh is zero here so...
-	add	xh, xh, #1
-	mov	xl, xl, lsl xh
-	mov	ip, ip, lsr xh
-
-#else
-
-7:	movs	xl, xl, lsl #1
-	mov	ip, ip, lsr #1
-	bcc	7b
-
-#endif
-
-	@ Current remainder is now 1.  It is worthless to compare with
-	@ divisor at this point since divisor can not be smaller than 3 here.
-	@ If possible, branch for another shift in the division loop.
-	@ If no bit position left then we are done.
-	movs	ip, ip, lsr #1
-	mov	xh, #1
-	bne	4b
-	mov	pc, lr
-
-8:	@ Division by a power of 2: determine what that divisor order is
-	@ then simply shift values around
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	ip, r4
-	rsb	ip, ip, #31
-
-#else
-
-	mov	yl, r4
-	cmp	r4, #(1 << 16)
-	mov	ip, #0
-	movhs	yl, yl, lsr #16
-	movhs	ip, #16
-
-	cmp	yl, #(1 << 8)
-	movhs	yl, yl, lsr #8
-	addhs	ip, ip, #8
-
-	cmp	yl, #(1 << 4)
-	movhs	yl, yl, lsr #4
-	addhs	ip, ip, #4
-
-	cmp	yl, #(1 << 2)
-	addhi	ip, ip, #3
-	addls	ip, ip, yl, lsr #1
-
-#endif
-
-	mov	yh, xh, lsr ip
-	mov	yl, xl, lsr ip
-	rsb	ip, ip, #32
- ARM(	orr	yl, yl, xh, lsl ip	)
- THUMB(	lsl	xh, xh, ip		)
- THUMB(	orr	yl, yl, xh		)
-	mov	xh, xl, lsl ip
-	mov	xh, xh, lsr ip
-	mov	pc, lr
-
-	@ eq -> division by 1: obvious enough...
-9:	moveq	yl, xl
-	moveq	yh, xh
-	moveq	xh, #0
-	moveq	pc, lr
-UNWIND(.fnend)
-
-UNWIND(.fnstart)
-UNWIND(.pad #4)
-UNWIND(.save {lr})
-Ldiv0_64:
-	@ Division by 0:
-	str	lr, [sp, #-8]!
-	bl	__div0
-
-	@ as wrong as it could be...
-	mov	yl, #0
-	mov	yh, #0
-	mov	xh, #0
-	ldr	pc, [sp], #8
-
-UNWIND(.fnend)
-ENDPROC(__do_div64)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/findbit.S
--- a/xen/arch/arm/lib/findbit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-/*
- *  linux/arch/arm/lib/findbit.S
- *
- *  Copyright (C) 1995-2000 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * 16th March 2001 - John Ripley <jripley@sonicblue.com>
- *   Fixed so that "size" is an exclusive not an inclusive quantity.
- *   All users of these functions expect exclusive sizes, and may
- *   also call with zero size.
- * Reworked by rmk.
- */
-
-#include <xen/config.h>
-
-#include "assembler.h"
-                .text
-
-/*
- * Purpose  : Find a 'zero' bit
- * Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit);
- */
-ENTRY(_find_first_zero_bit_le)
-		teq	r1, #0	
-		beq	3f
-		mov	r2, #0
-1:
- ARM(		ldrb	r3, [r0, r2, lsr #3]	)
- THUMB(		lsr	r3, r2, #3		)
- THUMB(		ldrb	r3, [r0, r3]		)
-		eors	r3, r3, #0xff		@ invert bits
-		bne	.L_found		@ any now set - found zero bit
-		add	r2, r2, #8		@ next bit pointer
-2:		cmp	r2, r1			@ any more?
-		blo	1b
-3:		mov	r0, r1			@ no free bits
-		mov	pc, lr
-ENDPROC(_find_first_zero_bit_le)
-
-/*
- * Purpose  : Find next 'zero' bit
- * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
- */
-ENTRY(_find_next_zero_bit_le)
-		teq	r1, #0
-		beq	3b
-		ands	ip, r2, #7
-		beq	1b			@ If new byte, goto old routine
- ARM(		ldrb	r3, [r0, r2, lsr #3]	)
- THUMB(		lsr	r3, r2, #3		)
- THUMB(		ldrb	r3, [r0, r3]		)
-		eor	r3, r3, #0xff		@ now looking for a 1 bit
-		movs	r3, r3, lsr ip		@ shift off unused bits
-		bne	.L_found
-		orr	r2, r2, #7		@ if zero, then no bits here
-		add	r2, r2, #1		@ align bit pointer
-		b	2b			@ loop for next bit
-ENDPROC(_find_next_zero_bit_le)
-
-/*
- * Purpose  : Find a 'one' bit
- * Prototype: int find_first_bit(const unsigned long *addr, unsigned int maxbit);
- */
-ENTRY(_find_first_bit_le)
-		teq	r1, #0	
-		beq	3f
-		mov	r2, #0
-1:
- ARM(		ldrb	r3, [r0, r2, lsr #3]	)
- THUMB(		lsr	r3, r2, #3		)
- THUMB(		ldrb	r3, [r0, r3]		)
-		movs	r3, r3
-		bne	.L_found		@ any now set - found zero bit
-		add	r2, r2, #8		@ next bit pointer
-2:		cmp	r2, r1			@ any more?
-		blo	1b
-3:		mov	r0, r1			@ no free bits
-		mov	pc, lr
-ENDPROC(_find_first_bit_le)
-
-/*
- * Purpose  : Find next 'one' bit
- * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
- */
-ENTRY(_find_next_bit_le)
-		teq	r1, #0
-		beq	3b
-		ands	ip, r2, #7
-		beq	1b			@ If new byte, goto old routine
- ARM(		ldrb	r3, [r0, r2, lsr #3]	)
- THUMB(		lsr	r3, r2, #3		)
- THUMB(		ldrb	r3, [r0, r3]		)
-		movs	r3, r3, lsr ip		@ shift off unused bits
-		bne	.L_found
-		orr	r2, r2, #7		@ if zero, then no bits here
-		add	r2, r2, #1		@ align bit pointer
-		b	2b			@ loop for next bit
-ENDPROC(_find_next_bit_le)
-
-#ifdef __ARMEB__
-
-ENTRY(_find_first_zero_bit_be)
-		teq	r1, #0
-		beq	3f
-		mov	r2, #0
-1:		eor	r3, r2, #0x18		@ big endian byte ordering
- ARM(		ldrb	r3, [r0, r3, lsr #3]	)
- THUMB(		lsr	r3, #3			)
- THUMB(		ldrb	r3, [r0, r3]		)
-		eors	r3, r3, #0xff		@ invert bits
-		bne	.L_found		@ any now set - found zero bit
-		add	r2, r2, #8		@ next bit pointer
-2:		cmp	r2, r1			@ any more?
-		blo	1b
-3:		mov	r0, r1			@ no free bits
-		mov	pc, lr
-ENDPROC(_find_first_zero_bit_be)
-
-ENTRY(_find_next_zero_bit_be)
-		teq	r1, #0
-		beq	3b
-		ands	ip, r2, #7
-		beq	1b			@ If new byte, goto old routine
-		eor	r3, r2, #0x18		@ big endian byte ordering
- ARM(		ldrb	r3, [r0, r3, lsr #3]	)
- THUMB(		lsr	r3, #3			)
- THUMB(		ldrb	r3, [r0, r3]		)
-		eor	r3, r3, #0xff		@ now looking for a 1 bit
-		movs	r3, r3, lsr ip		@ shift off unused bits
-		bne	.L_found
-		orr	r2, r2, #7		@ if zero, then no bits here
-		add	r2, r2, #1		@ align bit pointer
-		b	2b			@ loop for next bit
-ENDPROC(_find_next_zero_bit_be)
-
-ENTRY(_find_first_bit_be)
-		teq	r1, #0
-		beq	3f
-		mov	r2, #0
-1:		eor	r3, r2, #0x18		@ big endian byte ordering
- ARM(		ldrb	r3, [r0, r3, lsr #3]	)
- THUMB(		lsr	r3, #3			)
- THUMB(		ldrb	r3, [r0, r3]		)
-		movs	r3, r3
-		bne	.L_found		@ any now set - found zero bit
-		add	r2, r2, #8		@ next bit pointer
-2:		cmp	r2, r1			@ any more?
-		blo	1b
-3:		mov	r0, r1			@ no free bits
-		mov	pc, lr
-ENDPROC(_find_first_bit_be)
-
-ENTRY(_find_next_bit_be)
-		teq	r1, #0
-		beq	3b
-		ands	ip, r2, #7
-		beq	1b			@ If new byte, goto old routine
-		eor	r3, r2, #0x18		@ big endian byte ordering
- ARM(		ldrb	r3, [r0, r3, lsr #3]	)
- THUMB(		lsr	r3, #3			)
- THUMB(		ldrb	r3, [r0, r3]		)
-		movs	r3, r3, lsr ip		@ shift off unused bits
-		bne	.L_found
-		orr	r2, r2, #7		@ if zero, then no bits here
-		add	r2, r2, #1		@ align bit pointer
-		b	2b			@ loop for next bit
-ENDPROC(_find_next_bit_be)
-
-#endif
-
-/*
- * One or more bits in the LSB of r3 are assumed to be set.
- */
-.L_found:
-#if __LINUX_ARM_ARCH__ >= 5
-		rsb	r0, r3, #0
-		and	r3, r3, r0
-		clz	r3, r3
-		rsb	r3, r3, #31
-		add	r0, r2, r3
-#else
-		tst	r3, #0x0f
-		addeq	r2, r2, #4
-		movne	r3, r3, lsl #4
-		tst	r3, #0x30
-		addeq	r2, r2, #2
-		movne	r3, r3, lsl #2
-		tst	r3, #0x40
-		addeq	r2, r2, #1
-		mov	r0, r2
-#endif
-		cmp	r1, r0			@ Clamp to maxbit
-		movlo	r0, r1
-		mov	pc, lr
-
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/lib1funcs.S
--- a/xen/arch/arm/lib/lib1funcs.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,389 +0,0 @@
-/*
- * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
- *
- * Author: Nicolas Pitre <nico@fluxnic.net>
- *   - contributed to gcc-3.4 on Sep 30, 2003
- *   - adapted for the Linux kernel on Oct 2, 2003
- */
-
-/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
-
-This file is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file into combinations with other programs,
-and to distribute those combinations without any restriction coming
-from the use of this file.  (The General Public License restrictions
-do apply in other respects; for example, they cover modification of
-the file, and distribution when not linked into a combine
-executable.)
-
-This file is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-
-#include <xen/config.h>
-#include "assembler.h"
-
-.macro ARM_DIV_BODY dividend, divisor, result, curbit
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	\curbit, \divisor
-	clz	\result, \dividend
-	sub	\result, \curbit, \result
-	mov	\curbit, #1
-	mov	\divisor, \divisor, lsl \result
-	mov	\curbit, \curbit, lsl \result
-	mov	\result, #0
-	
-#else
-
-	@ Initially shift the divisor left 3 bits if possible,
-	@ set curbit accordingly.  This allows for curbit to be located
-	@ at the left end of each 4 bit nibbles in the division loop
-	@ to save one loop in most cases.
-	tst	\divisor, #0xe0000000
-	moveq	\divisor, \divisor, lsl #3
-	moveq	\curbit, #8
-	movne	\curbit, #1
-
-	@ Unless the divisor is very big, shift it up in multiples of
-	@ four bits, since this is the amount of unwinding in the main
-	@ division loop.  Continue shifting until the divisor is 
-	@ larger than the dividend.
-1:	cmp	\divisor, #0x10000000
-	cmplo	\divisor, \dividend
-	movlo	\divisor, \divisor, lsl #4
-	movlo	\curbit, \curbit, lsl #4
-	blo	1b
-
-	@ For very big divisors, we must shift it a bit at a time, or
-	@ we will be in danger of overflowing.
-1:	cmp	\divisor, #0x80000000
-	cmplo	\divisor, \dividend
-	movlo	\divisor, \divisor, lsl #1
-	movlo	\curbit, \curbit, lsl #1
-	blo	1b
-
-	mov	\result, #0
-
-#endif
-
-	@ Division loop
-1:	cmp	\dividend, \divisor
-	subhs	\dividend, \dividend, \divisor
-	orrhs	\result,   \result,   \curbit
-	cmp	\dividend, \divisor,  lsr #1
-	subhs	\dividend, \dividend, \divisor, lsr #1
-	orrhs	\result,   \result,   \curbit,  lsr #1
-	cmp	\dividend, \divisor,  lsr #2
-	subhs	\dividend, \dividend, \divisor, lsr #2
-	orrhs	\result,   \result,   \curbit,  lsr #2
-	cmp	\dividend, \divisor,  lsr #3
-	subhs	\dividend, \dividend, \divisor, lsr #3
-	orrhs	\result,   \result,   \curbit,  lsr #3
-	cmp	\dividend, #0			@ Early termination?
-	movnes	\curbit,   \curbit,  lsr #4	@ No, any more bits to do?
-	movne	\divisor,  \divisor, lsr #4
-	bne	1b
-
-.endm
-
-
-.macro ARM_DIV2_ORDER divisor, order
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	\order, \divisor
-	rsb	\order, \order, #31
-
-#else
-
-	cmp	\divisor, #(1 << 16)
-	movhs	\divisor, \divisor, lsr #16
-	movhs	\order, #16
-	movlo	\order, #0
-
-	cmp	\divisor, #(1 << 8)
-	movhs	\divisor, \divisor, lsr #8
-	addhs	\order, \order, #8
-
-	cmp	\divisor, #(1 << 4)
-	movhs	\divisor, \divisor, lsr #4
-	addhs	\order, \order, #4
-
-	cmp	\divisor, #(1 << 2)
-	addhi	\order, \order, #3
-	addls	\order, \order, \divisor, lsr #1
-
-#endif
-
-.endm
-
-
-.macro ARM_MOD_BODY dividend, divisor, order, spare
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	\order, \divisor
-	clz	\spare, \dividend
-	sub	\order, \order, \spare
-	mov	\divisor, \divisor, lsl \order
-
-#else
-
-	mov	\order, #0
-
-	@ Unless the divisor is very big, shift it up in multiples of
-	@ four bits, since this is the amount of unwinding in the main
-	@ division loop.  Continue shifting until the divisor is 
-	@ larger than the dividend.
-1:	cmp	\divisor, #0x10000000
-	cmplo	\divisor, \dividend
-	movlo	\divisor, \divisor, lsl #4
-	addlo	\order, \order, #4
-	blo	1b
-
-	@ For very big divisors, we must shift it a bit at a time, or
-	@ we will be in danger of overflowing.
-1:	cmp	\divisor, #0x80000000
-	cmplo	\divisor, \dividend
-	movlo	\divisor, \divisor, lsl #1
-	addlo	\order, \order, #1
-	blo	1b
-
-#endif
-
-	@ Perform all needed substractions to keep only the reminder.
-	@ Do comparisons in batch of 4 first.
-	subs	\order, \order, #3		@ yes, 3 is intended here
-	blt	2f
-
-1:	cmp	\dividend, \divisor
-	subhs	\dividend, \dividend, \divisor
-	cmp	\dividend, \divisor,  lsr #1
-	subhs	\dividend, \dividend, \divisor, lsr #1
-	cmp	\dividend, \divisor,  lsr #2
-	subhs	\dividend, \dividend, \divisor, lsr #2
-	cmp	\dividend, \divisor,  lsr #3
-	subhs	\dividend, \dividend, \divisor, lsr #3
-	cmp	\dividend, #1
-	mov	\divisor, \divisor, lsr #4
-	subges	\order, \order, #4
-	bge	1b
-
-	tst	\order, #3
-	teqne	\dividend, #0
-	beq	5f
-
-	@ Either 1, 2 or 3 comparison/substractions are left.
-2:	cmn	\order, #2
-	blt	4f
-	beq	3f
-	cmp	\dividend, \divisor
-	subhs	\dividend, \dividend, \divisor
-	mov	\divisor,  \divisor,  lsr #1
-3:	cmp	\dividend, \divisor
-	subhs	\dividend, \dividend, \divisor
-	mov	\divisor,  \divisor,  lsr #1
-4:	cmp	\dividend, \divisor
-	subhs	\dividend, \dividend, \divisor
-5:
-.endm
-
-
-ENTRY(__udivsi3)
-ENTRY(__aeabi_uidiv)
-UNWIND(.fnstart)
-
-	subs	r2, r1, #1
-	moveq	pc, lr
-	bcc	Ldiv0
-	cmp	r0, r1
-	bls	11f
-	tst	r1, r2
-	beq	12f
-
-	ARM_DIV_BODY r0, r1, r2, r3
-
-	mov	r0, r2
-	mov	pc, lr
-
-11:	moveq	r0, #1
-	movne	r0, #0
-	mov	pc, lr
-
-12:	ARM_DIV2_ORDER r1, r2
-
-	mov	r0, r0, lsr r2
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__udivsi3)
-ENDPROC(__aeabi_uidiv)
-
-ENTRY(__umodsi3)
-UNWIND(.fnstart)
-
-	subs	r2, r1, #1			@ compare divisor with 1
-	bcc	Ldiv0
-	cmpne	r0, r1				@ compare dividend with divisor
-	moveq   r0, #0
-	tsthi	r1, r2				@ see if divisor is power of 2
-	andeq	r0, r0, r2
-	movls	pc, lr
-
-	ARM_MOD_BODY r0, r1, r2, r3
-
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__umodsi3)
-
-ENTRY(__divsi3)
-ENTRY(__aeabi_idiv)
-UNWIND(.fnstart)
-
-	cmp	r1, #0
-	eor	ip, r0, r1			@ save the sign of the result.
-	beq	Ldiv0
-	rsbmi	r1, r1, #0			@ loops below use unsigned.
-	subs	r2, r1, #1			@ division by 1 or -1 ?
-	beq	10f
-	movs	r3, r0
-	rsbmi	r3, r0, #0			@ positive dividend value
-	cmp	r3, r1
-	bls	11f
-	tst	r1, r2				@ divisor is power of 2 ?
-	beq	12f
-
-	ARM_DIV_BODY r3, r1, r0, r2
-
-	cmp	ip, #0
-	rsbmi	r0, r0, #0
-	mov	pc, lr
-
-10:	teq	ip, r0				@ same sign ?
-	rsbmi	r0, r0, #0
-	mov	pc, lr
-
-11:	movlo	r0, #0
-	moveq	r0, ip, asr #31
-	orreq	r0, r0, #1
-	mov	pc, lr
-
-12:	ARM_DIV2_ORDER r1, r2
-
-	cmp	ip, #0
-	mov	r0, r3, lsr r2
-	rsbmi	r0, r0, #0
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__divsi3)
-ENDPROC(__aeabi_idiv)
-
-ENTRY(__modsi3)
-UNWIND(.fnstart)
-
-	cmp	r1, #0
-	beq	Ldiv0
-	rsbmi	r1, r1, #0			@ loops below use unsigned.
-	movs	ip, r0				@ preserve sign of dividend
-	rsbmi	r0, r0, #0			@ if negative make positive
-	subs	r2, r1, #1			@ compare divisor with 1
-	cmpne	r0, r1				@ compare dividend with divisor
-	moveq	r0, #0
-	tsthi	r1, r2				@ see if divisor is power of 2
-	andeq	r0, r0, r2
-	bls	10f
-
-	ARM_MOD_BODY r0, r1, r2, r3
-
-10:	cmp	ip, #0
-	rsbmi	r0, r0, #0
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__modsi3)
-
-#ifdef CONFIG_AEABI
-
-ENTRY(__aeabi_uidivmod)
-UNWIND(.fnstart)
-UNWIND(.save {r0, r1, ip, lr}	)
-
-	stmfd	sp!, {r0, r1, ip, lr}
-	bl	__aeabi_uidiv
-	ldmfd	sp!, {r1, r2, ip, lr}
-	mul	r3, r0, r2
-	sub	r1, r1, r3
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__aeabi_uidivmod)
-
-ENTRY(__aeabi_idivmod)
-UNWIND(.fnstart)
-UNWIND(.save {r0, r1, ip, lr}	)
-	stmfd	sp!, {r0, r1, ip, lr}
-	bl	__aeabi_idiv
-	ldmfd	sp!, {r1, r2, ip, lr}
-	mul	r3, r0, r2
-	sub	r1, r1, r3
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__aeabi_idivmod)
-
-ENTRY(__aeabi_uldivmod)
-UNWIND(.fnstart)
-UNWIND(.save {lr}	)
-	sub sp, sp, #8
-	stmfd   sp!, {sp, lr}
-	bl __qdivrem
-	ldr lr, [sp, #4]
-	add sp, sp, #8
-	ldmfd sp!, {r2, r3}
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__aeabi_uldivmod)
-
-ENTRY(__aeabi_ldivmod)
-UNWIND(.fnstart)
-UNWIND(.save {lr}	)
-	sub sp, sp, #16
-	stmfd   sp!, {sp, lr}
-	bl __ldivmod_helper
-	ldr lr, [sp, #4]
-	add sp, sp, #16
-	ldmfd	sp!, {r2, r3}
-	mov	pc, lr
-	
-UNWIND(.fnend)
-ENDPROC(__aeabi_ldivmod)
-#endif
-
-Ldiv0:
-UNWIND(.fnstart)
-UNWIND(.pad #4)
-UNWIND(.save {lr})
-	str	lr, [sp, #-8]!
-	bl	__div0
-	mov	r0, #0			@ About as wrong as it could be.
-	ldr	pc, [sp], #8
-UNWIND(.fnend)
-ENDPROC(Ldiv0)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/lshrdi3.S
--- a/xen/arch/arm/lib/lshrdi3.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
-   Free Software Foundation, Inc.
-
-This file is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file into combinations with other programs,
-and to distribute those combinations without any restriction coming
-from the use of this file.  (The General Public License restrictions
-do apply in other respects; for example, they cover modification of
-the file, and distribution when not linked into a combine
-executable.)
-
-This file is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; see the file COPYING.  If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
-
-
-#include <xen/config.h>
-#include "assembler.h"
-
-#ifdef __ARMEB__
-#define al r1
-#define ah r0
-#else
-#define al r0
-#define ah r1
-#endif
-
-ENTRY(__lshrdi3)
-ENTRY(__aeabi_llsr)
-
-	subs	r3, r2, #32
-	rsb	ip, r2, #32
-	movmi	al, al, lsr r2
-	movpl	al, ah, lsr r3
- ARM(	orrmi	al, al, ah, lsl ip	)
- THUMB(	lslmi	r3, ah, ip		)
- THUMB(	orrmi	al, al, r3		)
-	mov	ah, ah, lsr r2
-	mov	pc, lr
-
-ENDPROC(__lshrdi3)
-ENDPROC(__aeabi_llsr)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/memcpy.S
--- a/xen/arch/arm/lib/memcpy.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- *  linux/arch/arm/lib/memcpy.S
- *
- *  Author:	Nicolas Pitre
- *  Created:	Sep 28, 2005
- *  Copyright:	MontaVista Software, Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- */
-
-#include <xen/config.h>
-#include "assembler.h"
-
-#define LDR1W_SHIFT	0
-#define STR1W_SHIFT	0
-
-	.macro ldr1w ptr reg abort
-	W(ldr) \reg, [\ptr], #4
-	.endm
-
-	.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
-	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
-	.endm
-
-	.macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
-	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
-	.endm
-
-	.macro ldr1b ptr reg cond=al abort
-	ldr\cond\()b \reg, [\ptr], #1
-	.endm
-
-	.macro str1w ptr reg abort
-	W(str) \reg, [\ptr], #4
-	.endm
-
-	.macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
-	stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
-	.endm
-
-	.macro str1b ptr reg cond=al abort
-	str\cond\()b \reg, [\ptr], #1
-	.endm
-
-	.macro enter reg1 reg2
-	stmdb sp!, {r0, \reg1, \reg2}
-	.endm
-
-	.macro exit reg1 reg2
-	ldmfd sp!, {r0, \reg1, \reg2}
-	.endm
-
-	.text
-
-/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
-
-ENTRY(memcpy)
-
-#include "copy_template.S"
-
-ENDPROC(memcpy)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/memmove.S
--- a/xen/arch/arm/lib/memmove.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
- *  linux/arch/arm/lib/memmove.S
- *
- *  Author:	Nicolas Pitre
- *  Created:	Sep 28, 2005
- *  Copyright:	(C) MontaVista Software Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- */
-
-#include <xen/config.h>
-
-#include "assembler.h"
-
-		.text
-
-/*
- * Prototype: void *memmove(void *dest, const void *src, size_t n);
- *
- * Note:
- *
- * If the memory regions don't overlap, we simply branch to memcpy which is
- * normally a bit faster. Otherwise the copy is done going downwards.  This
- * is a transposition of the code from copy_template.S but with the copy
- * occurring in the opposite direction.
- */
-
-ENTRY(memmove)
-
-		subs	ip, r0, r1
-		cmphi	r2, ip
-		bls	memcpy
-
-		stmfd	sp!, {r0, r4, lr}
-		add	r1, r1, r2
-		add	r0, r0, r2
-		subs	r2, r2, #4
-		blt	8f
-		ands	ip, r0, #3
-	PLD(	pld	[r1, #-4]		)
-		bne	9f
-		ands	ip, r1, #3
-		bne	10f
-
-1:		subs	r2, r2, #(28)
-		stmfd	sp!, {r5 - r8}
-		blt	5f
-
-	CALGN(	ands	ip, r0, #31		)
-	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
-	CALGN(	bcs	2f			)
-	CALGN(	adr	r4, 6f			)
-	CALGN(	subs	r2, r2, ip		)  @ C is set here
-	CALGN(	rsb	ip, ip, #32		)
-	CALGN(	add	pc, r4, ip		)
-
-	PLD(	pld	[r1, #-4]		)
-2:	PLD(	subs	r2, r2, #96		)
-	PLD(	pld	[r1, #-32]		)
-	PLD(	blt	4f			)
-	PLD(	pld	[r1, #-64]		)
-	PLD(	pld	[r1, #-96]		)
-
-3:	PLD(	pld	[r1, #-128]		)
-4:		ldmdb	r1!, {r3, r4, r5, r6, r7, r8, ip, lr}
-		subs	r2, r2, #32
-		stmdb	r0!, {r3, r4, r5, r6, r7, r8, ip, lr}
-		bge	3b
-	PLD(	cmn	r2, #96			)
-	PLD(	bge	4b			)
-
-5:		ands	ip, r2, #28
-		rsb	ip, ip, #32
-		addne	pc, pc, ip		@ C is always clear here
-		b	7f
-6:		W(nop)
-		W(ldr)	r3, [r1, #-4]!
-		W(ldr)	r4, [r1, #-4]!
-		W(ldr)	r5, [r1, #-4]!
-		W(ldr)	r6, [r1, #-4]!
-		W(ldr)	r7, [r1, #-4]!
-		W(ldr)	r8, [r1, #-4]!
-		W(ldr)	lr, [r1, #-4]!
-
-		add	pc, pc, ip
-		nop
-		W(nop)
-		W(str)	r3, [r0, #-4]!
-		W(str)	r4, [r0, #-4]!
-		W(str)	r5, [r0, #-4]!
-		W(str)	r6, [r0, #-4]!
-		W(str)	r7, [r0, #-4]!
-		W(str)	r8, [r0, #-4]!
-		W(str)	lr, [r0, #-4]!
-
-	CALGN(	bcs	2b			)
-
-7:		ldmfd	sp!, {r5 - r8}
-
-8:		movs	r2, r2, lsl #31
-		ldrneb	r3, [r1, #-1]!
-		ldrcsb	r4, [r1, #-1]!
-		ldrcsb	ip, [r1, #-1]
-		strneb	r3, [r0, #-1]!
-		strcsb	r4, [r0, #-1]!
-		strcsb	ip, [r0, #-1]
-		ldmfd	sp!, {r0, r4, pc}
-
-9:		cmp	ip, #2
-		ldrgtb	r3, [r1, #-1]!
-		ldrgeb	r4, [r1, #-1]!
-		ldrb	lr, [r1, #-1]!
-		strgtb	r3, [r0, #-1]!
-		strgeb	r4, [r0, #-1]!
-		subs	r2, r2, ip
-		strb	lr, [r0, #-1]!
-		blt	8b
-		ands	ip, r1, #3
-		beq	1b
-
-10:		bic	r1, r1, #3
-		cmp	ip, #2
-		ldr	r3, [r1, #0]
-		beq	17f
-		blt	18f
-
-
-		.macro	backward_copy_shift push pull
-
-		subs	r2, r2, #28
-		blt	14f
-
-	CALGN(	ands	ip, r0, #31		)
-	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
-	CALGN(	subcc	r2, r2, ip		)
-	CALGN(	bcc	15f			)
-
-11:		stmfd	sp!, {r5 - r9}
-
-	PLD(	pld	[r1, #-4]		)
-	PLD(	subs	r2, r2, #96		)
-	PLD(	pld	[r1, #-32]		)
-	PLD(	blt	13f			)
-	PLD(	pld	[r1, #-64]		)
-	PLD(	pld	[r1, #-96]		)
-
-12:	PLD(	pld	[r1, #-128]		)
-13:		ldmdb   r1!, {r7, r8, r9, ip}
-		mov     lr, r3, push #\push
-		subs    r2, r2, #32
-		ldmdb   r1!, {r3, r4, r5, r6}
-		orr     lr, lr, ip, pull #\pull
-		mov     ip, ip, push #\push
-		orr     ip, ip, r9, pull #\pull
-		mov     r9, r9, push #\push
-		orr     r9, r9, r8, pull #\pull
-		mov     r8, r8, push #\push
-		orr     r8, r8, r7, pull #\pull
-		mov     r7, r7, push #\push
-		orr     r7, r7, r6, pull #\pull
-		mov     r6, r6, push #\push
-		orr     r6, r6, r5, pull #\pull
-		mov     r5, r5, push #\push
-		orr     r5, r5, r4, pull #\pull
-		mov     r4, r4, push #\push
-		orr     r4, r4, r3, pull #\pull
-		stmdb   r0!, {r4 - r9, ip, lr}
-		bge	12b
-	PLD(	cmn	r2, #96			)
-	PLD(	bge	13b			)
-
-		ldmfd	sp!, {r5 - r9}
-
-14:		ands	ip, r2, #28
-		beq	16f
-
-15:		mov     lr, r3, push #\push
-		ldr	r3, [r1, #-4]!
-		subs	ip, ip, #4
-		orr	lr, lr, r3, pull #\pull
-		str	lr, [r0, #-4]!
-		bgt	15b
-	CALGN(	cmp	r2, #0			)
-	CALGN(	bge	11b			)
-
-16:		add	r1, r1, #(\pull / 8)
-		b	8b
-
-		.endm
-
-
-		backward_copy_shift	push=8	pull=24
-
-17:		backward_copy_shift	push=16	pull=16
-
-18:		backward_copy_shift	push=24	pull=8
-
-ENDPROC(memmove)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/memset.S
--- a/xen/arch/arm/lib/memset.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
- *  linux/arch/arm/lib/memset.S
- *
- *  Copyright (C) 1995-2000 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- *  ASM optimised string functions
- */
-
-#include <xen/config.h>
-
-#include "assembler.h"
-
-	.text
-	.align	5
-	.word	0
-
-1:	subs	r2, r2, #4		@ 1 do we have enough
-	blt	5f			@ 1 bytes to align with?
-	cmp	r3, #2			@ 1
-	strltb	r1, [r0], #1		@ 1
-	strleb	r1, [r0], #1		@ 1
-	strb	r1, [r0], #1		@ 1
-	add	r2, r2, r3		@ 1 (r2 = r2 - (4 - r3))
-/*
- * The pointer is now aligned and the length is adjusted.  Try doing the
- * memset again.
- */
-
-ENTRY(memset)
-	ands	r3, r0, #3		@ 1 unaligned?
-	bne	1b			@ 1
-/*
- * we know that the pointer in r0 is aligned to a word boundary.
- */
-	orr	r1, r1, r1, lsl #8
-	orr	r1, r1, r1, lsl #16
-	mov	r3, r1
-	cmp	r2, #16
-	blt	4f
-
-#if ! CALGN(1)+0
-
-/*
- * We need an extra register for this loop - save the return address and
- * use the LR
- */
-	str	lr, [sp, #-4]!
-	mov	ip, r1
-	mov	lr, r1
-
-2:	subs	r2, r2, #64
-	stmgeia	r0!, {r1, r3, ip, lr}	@ 64 bytes at a time.
-	stmgeia	r0!, {r1, r3, ip, lr}
-	stmgeia	r0!, {r1, r3, ip, lr}
-	stmgeia	r0!, {r1, r3, ip, lr}
-	bgt	2b
-	ldmeqfd	sp!, {pc}		@ Now <64 bytes to go.
-/*
- * No need to correct the count; we're only testing bits from now on
- */
-	tst	r2, #32
-	stmneia	r0!, {r1, r3, ip, lr}
-	stmneia	r0!, {r1, r3, ip, lr}
-	tst	r2, #16
-	stmneia	r0!, {r1, r3, ip, lr}
-	ldr	lr, [sp], #4
-
-#else
-
-/*
- * This version aligns the destination pointer in order to write
- * whole cache lines at once.
- */
-
-	stmfd	sp!, {r4-r7, lr}
-	mov	r4, r1
-	mov	r5, r1
-	mov	r6, r1
-	mov	r7, r1
-	mov	ip, r1
-	mov	lr, r1
-
-	cmp	r2, #96
-	tstgt	r0, #31
-	ble	3f
-
-	and	ip, r0, #31
-	rsb	ip, ip, #32
-	sub	r2, r2, ip
-	movs	ip, ip, lsl #(32 - 4)
-	stmcsia	r0!, {r4, r5, r6, r7}
-	stmmiia	r0!, {r4, r5}
-	tst	ip, #(1 << 30)
-	mov	ip, r1
-	strne	r1, [r0], #4
-
-3:	subs	r2, r2, #64
-	stmgeia	r0!, {r1, r3-r7, ip, lr}
-	stmgeia	r0!, {r1, r3-r7, ip, lr}
-	bgt	3b
-	ldmeqfd	sp!, {r4-r7, pc}
-
-	tst	r2, #32
-	stmneia	r0!, {r1, r3-r7, ip, lr}
-	tst	r2, #16
-	stmneia	r0!, {r4-r7}
-	ldmfd	sp!, {r4-r7, lr}
-
-#endif
-
-4:	tst	r2, #8
-	stmneia	r0!, {r1, r3}
-	tst	r2, #4
-	strne	r1, [r0], #4
-/*
- * When we get here, we've got less than 4 bytes to zero.  We
- * may have an unaligned pointer as well.
- */
-5:	tst	r2, #2
-	strneb	r1, [r0], #1
-	strneb	r1, [r0], #1
-	tst	r2, #1
-	strneb	r1, [r0], #1
-	mov	pc, lr
-ENDPROC(memset)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/memzero.S
--- a/xen/arch/arm/lib/memzero.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
- *  linux/arch/arm/lib/memzero.S
- *
- *  Copyright (C) 1995-2000 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <xen/config.h>
-
-#include "assembler.h"
-
-	.text
-	.align	5
-	.word	0
-/*
- * Align the pointer in r0.  r3 contains the number of bytes that we are
- * mis-aligned by, and r1 is the number of bytes.  If r1 < 4, then we
- * don't bother; we use byte stores instead.
- */
-1:	subs	r1, r1, #4		@ 1 do we have enough
-	blt	5f			@ 1 bytes to align with?
-	cmp	r3, #2			@ 1
-	strltb	r2, [r0], #1		@ 1
-	strleb	r2, [r0], #1		@ 1
-	strb	r2, [r0], #1		@ 1
-	add	r1, r1, r3		@ 1 (r1 = r1 - (4 - r3))
-/*
- * The pointer is now aligned and the length is adjusted.  Try doing the
- * memzero again.
- */
-
-ENTRY(__memzero)
-	mov	r2, #0			@ 1
-	ands	r3, r0, #3		@ 1 unaligned?
-	bne	1b			@ 1
-/*
- * r3 = 0, and we know that the pointer in r0 is aligned to a word boundary.
- */
-	cmp	r1, #16			@ 1 we can skip this chunk if we
-	blt	4f			@ 1 have < 16 bytes
-
-#if ! CALGN(1)+0
-
-/*
- * We need an extra register for this loop - save the return address and
- * use the LR
- */
-	str	lr, [sp, #-4]!		@ 1
-	mov	ip, r2			@ 1
-	mov	lr, r2			@ 1
-
-3:	subs	r1, r1, #64		@ 1 write 32 bytes out per loop
-	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
-	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
-	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
-	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
-	bgt	3b			@ 1
-	ldmeqfd	sp!, {pc}		@ 1/2 quick exit
-/*
- * No need to correct the count; we're only testing bits from now on
- */
-	tst	r1, #32			@ 1
-	stmneia	r0!, {r2, r3, ip, lr}	@ 4
-	stmneia	r0!, {r2, r3, ip, lr}	@ 4
-	tst	r1, #16			@ 1 16 bytes or more?
-	stmneia	r0!, {r2, r3, ip, lr}	@ 4
-	ldr	lr, [sp], #4		@ 1
-
-#else
-
-/*
- * This version aligns the destination pointer in order to write
- * whole cache lines at once.
- */
-
-	stmfd	sp!, {r4-r7, lr}
-	mov	r4, r2
-	mov	r5, r2
-	mov	r6, r2
-	mov	r7, r2
-	mov	ip, r2
-	mov	lr, r2
-
-	cmp	r1, #96
-	andgts	ip, r0, #31
-	ble	3f
-
-	rsb	ip, ip, #32
-	sub	r1, r1, ip
-	movs	ip, ip, lsl #(32 - 4)
-	stmcsia	r0!, {r4, r5, r6, r7}
-	stmmiia	r0!, {r4, r5}
-	movs	ip, ip, lsl #2
-	strcs	r2, [r0], #4
-
-3:	subs	r1, r1, #64
-	stmgeia	r0!, {r2-r7, ip, lr}
-	stmgeia	r0!, {r2-r7, ip, lr}
-	bgt	3b
-	ldmeqfd	sp!, {r4-r7, pc}
-
-	tst	r1, #32
-	stmneia	r0!, {r2-r7, ip, lr}
-	tst	r1, #16
-	stmneia	r0!, {r4-r7}
-	ldmfd	sp!, {r4-r7, lr}
-
-#endif
-
-4:	tst	r1, #8			@ 1 8 bytes or more?
-	stmneia	r0!, {r2, r3}		@ 2
-	tst	r1, #4			@ 1 4 bytes or more?
-	strne	r2, [r0], #4		@ 1
-/*
- * When we get here, we've got less than 4 bytes to zero.  We
- * may have an unaligned pointer as well.
- */
-5:	tst	r1, #2			@ 1 2 bytes or more?
-	strneb	r2, [r0], #1		@ 1
-	strneb	r2, [r0], #1		@ 1
-	tst	r1, #1			@ 1 a byte left over
-	strneb	r2, [r0], #1		@ 1
-	mov	pc, lr			@ 1
-ENDPROC(__memzero)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/setbit.S
--- a/xen/arch/arm/lib/setbit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- *  linux/arch/arm/lib/setbit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-	.text
-
-ENTRY(_set_bit)
-	bitop	orr
-ENDPROC(_set_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/testchangebit.S
--- a/xen/arch/arm/lib/testchangebit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- *  linux/arch/arm/lib/testchangebit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-                .text
-
-ENTRY(_test_and_change_bit)
-	testop	eor, str
-ENDPROC(_test_and_change_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/testclearbit.S
--- a/xen/arch/arm/lib/testclearbit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- *  linux/arch/arm/lib/testclearbit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-                .text
-
-ENTRY(_test_and_clear_bit)
-	testop	bicne, strne
-ENDPROC(_test_and_clear_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/testsetbit.S
--- a/xen/arch/arm/lib/testsetbit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- *  linux/arch/arm/lib/testsetbit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-                .text
-
-ENTRY(_test_and_set_bit)
-	testop	orreq, streq
-ENDPROC(_test_and_set_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/mode_switch.S
--- a/xen/arch/arm/mode_switch.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
- * xen/arch/arm/mode_switch.S
- *
- * Start-of day code to take a CPU from Secure mode to Hyp mode.
- *
- * Tim Deegan <tim@xen.org>
- * Copyright (c) 2011-2012 Citrix Systems.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <asm/config.h>
-#include <asm/page.h>
-#include <asm/platform_vexpress.h>
-#include <asm/asm_defns.h>
-#include "gic.h"
-
-
-/* XXX: Versatile Express specific code */
-/* wake up secondary cpus */
-.globl kick_cpus
-kick_cpus:
-        /* write start paddr to v2m sysreg FLAGSSET register */
-        ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
-        dsb
-        mov   r2, #0xffffffff
-        str   r2, [r0, #(V2M_SYS_FLAGSCLR)]
-        dsb
-        ldr   r2, =start
-        add   r2, r2, r10
-        str   r2, [r0, #(V2M_SYS_FLAGSSET)]
-        dsb
-        /* send an interrupt */
-        ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
-        mov   r2, #0x1
-        str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
-        mov   r2, #0xfe0000
-        str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
-        dsb
-        str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
-        mov   pc, lr
-
-
-/* Get up a CPU into Hyp mode.  Clobbers r0-r3.
- *
- * Expects r12 == CPU number
- *
- * This code is specific to the VE model, and not intended to be used
- * on production systems.  As such it's a bit hackier than the main
- * boot code in head.S.  In future it will be replaced by better
- * integration with the bootloader/firmware so that Xen always starts
- * in Hyp mode. */
-
-.globl enter_hyp_mode
-enter_hyp_mode:
-        mov   r3, lr                 /* Put return address in non-banked reg */
-        cpsid aif, #0x16             /* Enter Monitor mode */
-        mrc   CP32(r0, SCR)
-        orr   r0, r0, #0x100         /* Set HCE */
-        orr   r0, r0, #0xb1          /* Set SCD, AW, FW and NS */
-        bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
-        mcr   CP32(r0, SCR)
-        /* Ugly: the system timer's frequency register is only
-         * programmable in Secure state.  Since we don't know where its
-         * memory-mapped control registers live, we can't find out the
-         * right frequency.  Use the VE model's default frequency here. */
-        ldr   r0, =0x5f5e100         /* 100 MHz */
-        mcr   CP32(r0, CNTFRQ)
-        ldr   r0, =0x40c00           /* SMP, c11, c10 in non-secure mode */
-        mcr   CP32(r0, NSACR)
-        mov   r0, #GIC_BASE_ADDRESS
-        add   r0, r0, #GIC_DR_OFFSET
-        /* Disable the GIC distributor, on the boot CPU only */
-        mov   r1, #0
-        teq   r12, #0                /* Is this the boot CPU? */
-        streq r1, [r0]
-        /* Continuing ugliness: Set up the GIC so NS state owns interrupts,
-         * The first 32 interrupts (SGIs & PPIs) must be configured on all
-         * CPUs while the remainder are SPIs and only need to be done one, on
-         * the boot CPU. */
-        add   r0, r0, #0x80          /* GICD_IGROUP0 */
-        mov   r2, #0xffffffff        /* All interrupts to group 1 */
-        teq   r12, #0                /* Boot CPU? */
-        str   r2, [r0]               /* Interrupts  0-31 (SGI & PPI) */
-        streq r2, [r0, #4]           /* Interrupts 32-63 (SPI) */
-        streq r2, [r0, #8]           /* Interrupts 64-95 (SPI) */
-        /* Disable the GIC CPU interface on all processors */
-        mov   r0, #GIC_BASE_ADDRESS
-        add   r0, r0, #GIC_CR_OFFSET
-        mov   r1, #0
-        str   r1, [r0]
-        /* Must drop priority mask below 0x80 before entering NS state */
-        ldr   r1, =0xff
-        str   r1, [r0, #0x4]         /* -> GICC_PMR */
-        /* Reset a few config registers */
-        mov   r0, #0
-        mcr   CP32(r0, FCSEIDR)
-        mcr   CP32(r0, CONTEXTIDR)
-        /* Allow non-secure access to coprocessors, FIQs, VFP and NEON */
-        ldr   r1, =0x3fff            /* 14 CP bits set, all others clear */
-        mcr   CP32(r1, NSACR)
-
-        mrs   r0, cpsr               /* Copy the CPSR */
-        add   r0, r0, #0x4           /* 0x16 (Monitor) -> 0x1a (Hyp) */
-        msr   spsr_cxsf, r0          /* into the SPSR */
-        movs  pc, r3                 /* Exception-return into Hyp mode */
-
-/*
- * Local variables:
- * mode: ASM
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/p2m.c
--- a/xen/arch/arm/p2m.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/p2m.c	Wed Dec 19 14:16:30 2012 +0000
@@ -4,7 +4,7 @@
 #include <xen/errno.h>
 #include <xen/domain_page.h>
 #include <asm/flushtlb.h>
-#include "gic.h"
+#include <asm/gic.h>
 
 void dump_p2m_lookup(struct domain *d, paddr_t addr)
 {
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/proc-ca15.S
--- a/xen/arch/arm/proc-ca15.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * xen/arch/arm/proc-ca15.S
- *
- * Cortex A15 specific initializations
- *
- * Copyright (c) 2011 Citrix Systems.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <asm/asm_defns.h>
-#include <asm/processor-ca15.h>
-
-.globl cortex_a15_init
-cortex_a15_init:
-        /* Set up the SMP bit in ACTLR */
-        mrc   CP32(r0, ACTLR)
-        orr   r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit */
-        mcr   CP32(r0, ACTLR)
-        mov   pc, lr
-
-/*
- * Local variables:
- * mode: ASM
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/setup.c	Wed Dec 19 14:16:30 2012 +0000
@@ -39,7 +39,7 @@
 #include <asm/setup.h>
 #include <asm/vfp.h>
 #include <asm/early_printk.h>
-#include "gic.h"
+#include <asm/gic.h>
 
 static __used void init_done(void)
 {
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Wed Dec 19 14:16:30 2012 +0000
@@ -29,7 +29,7 @@
 #include <xen/timer.h>
 #include <xen/irq.h>
 #include <asm/vfp.h>
-#include "gic.h"
+#include <asm/gic.h>
 
 cpumask_t cpu_online_map;
 EXPORT_SYMBOL(cpu_online_map);
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/traps.c	Wed Dec 19 14:16:30 2012 +0000
@@ -35,7 +35,7 @@
 
 #include "io.h"
 #include "vtimer.h"
-#include "gic.h"
+#include <asm/gic.h>
 
 /* The base of the stack must always be double-word aligned, which means
  * that both the kernel half of struct cpu_user_regs (which is pushed in
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/vgic.c
--- a/xen/arch/arm/vgic.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/vgic.c	Wed Dec 19 14:16:30 2012 +0000
@@ -27,7 +27,7 @@
 #include <asm/current.h>
 
 #include "io.h"
-#include "gic.h"
+#include <asm/gic.h>
 
 #define VGIC_DISTR_BASE_ADDRESS 0x000000002c001000
 
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/vtimer.c
--- a/xen/arch/arm/vtimer.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/vtimer.c	Wed Dec 19 14:16:30 2012 +0000
@@ -21,7 +21,7 @@
 #include <xen/lib.h>
 #include <xen/timer.h>
 #include <xen/sched.h>
-#include "gic.h"
+#include <asm/gic.h>
 
 extern s_time_t ticks_to_ns(uint64_t ticks);
 extern uint64_t ns_to_ticks(s_time_t ns);
diff -r 984086ca8ca0 -r b094ba4bf985 xen/include/asm-arm/gic.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-arm/gic.h	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,170 @@
+/*
+ * ARM Generic Interrupt Controller support
+ *
+ * Tim Deegan <tim@xen.org>
+ * Copyright (c) 2011 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ASM_ARM_GIC_H__
+#define __ASM_ARM_GIC_H__
+
+#define GICD_CTLR       (0x000/4)
+#define GICD_TYPER      (0x004/4)
+#define GICD_IIDR       (0x008/4)
+#define GICD_IGROUPR    (0x080/4)
+#define GICD_IGROUPRN   (0x0FC/4)
+#define GICD_ISENABLER  (0x100/4)
+#define GICD_ISENABLERN (0x17C/4)
+#define GICD_ICENABLER  (0x180/4)
+#define GICD_ICENABLERN (0x1fC/4)
+#define GICD_ISPENDR    (0x200/4)
+#define GICD_ISPENDRN   (0x27C/4)
+#define GICD_ICPENDR    (0x280/4)
+#define GICD_ICPENDRN   (0x2FC/4)
+#define GICD_ISACTIVER  (0x300/4)
+#define GICD_ISACTIVERN (0x37C/4)
+#define GICD_ICACTIVER  (0x380/4)
+#define GICD_ICACTIVERN (0x3FC/4)
+#define GICD_IPRIORITYR (0x400/4)
+#define GICD_IPRIORITYRN (0x7F8/4)
+#define GICD_ITARGETSR  (0x800/4)
+#define GICD_ITARGETSRN (0xBF8/4)
+#define GICD_ICFGR      (0xC00/4)
+#define GICD_ICFGRN     (0xCFC/4)
+#define GICD_NSACR      (0xE00/4)
+#define GICD_NSACRN     (0xEFC/4)
+#define GICD_ICPIDR2    (0xFE8/4)
+#define GICD_SGIR       (0xF00/4)
+#define GICD_CPENDSGIR  (0xF10/4)
+#define GICD_CPENDSGIRN (0xF1C/4)
+#define GICD_SPENDSGIR  (0xF20/4)
+#define GICD_SPENDSGIRN (0xF2C/4)
+#define GICD_ICPIDR2    (0xFE8/4)
+
+#define GICC_CTLR       (0x0000/4)
+#define GICC_PMR        (0x0004/4)
+#define GICC_BPR        (0x0008/4)
+#define GICC_IAR        (0x000C/4)
+#define GICC_EOIR       (0x0010/4)
+#define GICC_RPR        (0x0014/4)
+#define GICC_HPPIR      (0x0018/4)
+#define GICC_APR        (0x00D0/4)
+#define GICC_NSAPR      (0x00E0/4)
+#define GICC_DIR        (0x1000/4)
+
+#define GICH_HCR        (0x00/4)
+#define GICH_VTR        (0x04/4)
+#define GICH_VMCR       (0x08/4)
+#define GICH_MISR       (0x10/4)
+#define GICH_EISR0      (0x20/4)
+#define GICH_EISR1      (0x24/4)
+#define GICH_ELSR0      (0x30/4)
+#define GICH_ELSR1      (0x34/4)
+#define GICH_APR        (0xF0/4)
+#define GICH_LR         (0x100/4)
+
+/* Register bits */
+#define GICD_CTL_ENABLE 0x1
+
+#define GICD_TYPE_LINES 0x01f
+#define GICD_TYPE_CPUS  0x0e0
+#define GICD_TYPE_SEC   0x400
+
+#define GICC_CTL_ENABLE 0x1
+#define GICC_CTL_EOI    (0x1 << 9)
+
+#define GICC_IA_IRQ     0x03ff
+#define GICC_IA_CPU     0x1c00
+
+#define GICH_HCR_EN       (1 << 0)
+#define GICH_HCR_UIE      (1 << 1)
+#define GICH_HCR_LRENPIE  (1 << 2)
+#define GICH_HCR_NPIE     (1 << 3)
+#define GICH_HCR_VGRP0EIE (1 << 4)
+#define GICH_HCR_VGRP0DIE (1 << 5)
+#define GICH_HCR_VGRP1EIE (1 << 6)
+#define GICH_HCR_VGRP1DIE (1 << 7)
+
+#define GICH_MISR_EOI     (1 << 0)
+#define GICH_MISR_U       (1 << 1)
+#define GICH_MISR_LRENP   (1 << 2)
+#define GICH_MISR_NP      (1 << 3)
+#define GICH_MISR_VGRP0E  (1 << 4)
+#define GICH_MISR_VGRP0D  (1 << 5)
+#define GICH_MISR_VGRP1E  (1 << 6)
+#define GICH_MISR_VGRP1D  (1 << 7)
+
+#define GICH_LR_VIRTUAL_MASK    0x3ff
+#define GICH_LR_VIRTUAL_SHIFT   0
+#define GICH_LR_PHYSICAL_MASK   0x3ff
+#define GICH_LR_PHYSICAL_SHIFT  10
+#define GICH_LR_STATE_MASK      0x3
+#define GICH_LR_STATE_SHIFT     28
+#define GICH_LR_PRIORITY_SHIFT  23
+#define GICH_LR_MAINTENANCE_IRQ (1<<19)
+#define GICH_LR_PENDING         (1<<28)
+#define GICH_LR_ACTIVE          (1<<29)
+#define GICH_LR_GRP1            (1<<30)
+#define GICH_LR_HW              (1<<31)
+#define GICH_LR_CPUID_SHIFT     9
+#define GICH_VTR_NRLRGS         0x3f
+
+/* XXX: write this into the DT */
+#define VGIC_IRQ_EVTCHN_CALLBACK 31
+
+#ifndef __ASSEMBLY__
+extern int domain_vgic_init(struct domain *d);
+extern void domain_vgic_free(struct domain *d);
+
+extern int vcpu_vgic_init(struct vcpu *v);
+
+extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual);
+extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
+
+extern void gic_route_ppis(void);
+extern void gic_route_spis(void);
+
+extern void gic_inject(void);
+
+extern void __cpuinit init_maintenance_interrupt(void);
+extern void gic_set_guest_irq(struct vcpu *v, unsigned int irq,
+        unsigned int state, unsigned int priority);
+extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
+                                  const char * devname);
+
+/* Accept an interrupt from the GIC and dispatch its handler */
+extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
+/* Bring up the interrupt controller, and report # cpus attached */
+extern void gic_init(void);
+/* Bring up a secondary CPU's per-CPU GIC interface */
+extern void gic_init_secondary_cpu(void);
+/* Take down a CPU's per-CPU GIC interface */
+extern void gic_disable_cpu(void);
+/* setup the gic virtual interface for a guest */
+extern int gicv_setup(struct domain *d);
+
+/* Context switch */
+extern void gic_save_state(struct vcpu *v);
+extern void gic_restore_state(struct vcpu *v);
+
+#endif /* __ASSEMBLY__ */
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:12:01 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:12:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tlij3-0007TP-EN; Thu, 20 Dec 2012 16:12:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tlij0-0007Rc-H5
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:59 +0000
Received: from [85.158.137.99:53895] by server-2.bemta-3.messagelabs.com id
	9C/CC-11239-DC833D05; Thu, 20 Dec 2012 16:11:57 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-217.messagelabs.com!1356019879!17973448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24843 invoked from network); 20 Dec 2012 16:11:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiN-0005gG-L5
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiN-0006CT-If
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:19 +0000
Message-Id: <E1TliiN-0006CT-If@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen: arm: introduce arm32 as a
	subarch of arm.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1355926590 0
# Node ID b094ba4bf9853e408a710664cb2995b4737cf165
# Parent  984086ca8ca0de17b5cd3253bc9579d072ec43bc
xen: arm: introduce arm32 as a subarch of arm.

- move 32-bit specific files into subarch specific arm32 subdirectory.
- move gic.h to xen/include/asm-arm (it is needed from both subarch
  and generic code).
- make the appropriate build and config file changes to support
  XEN_TARGET_ARCH=arm32.

This prepares us for an eventual 64-bit subarch.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 984086ca8ca0 -r b094ba4bf985 Config.mk
--- a/Config.mk	Wed Dec 19 14:16:29 2012 +0000
+++ b/Config.mk	Wed Dec 19 14:16:30 2012 +0000
@@ -14,7 +14,9 @@ debug ?= y
 debug_symbols ?= $(debug)
 
 XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
-                         -e s/i86pc/x86_32/ -e s/amd64/x86_64/ -e s/arm.*/arm/)
+                         -e s/i86pc/x86_32/ -e s/amd64/x86_64/ \
+                         -e s/armv7.*/arm32/)
+
 XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
 XEN_OS              ?= $(shell uname -s)
 
diff -r 984086ca8ca0 -r b094ba4bf985 config/arm.mk
--- a/config/arm.mk	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-CONFIG_ARM := y
-CONFIG_ARM_32 := y
-CONFIG_ARM_$(XEN_OS) := y
-
-# -march= -mcpu=
-
-# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
-CFLAGS += -marm
-
-HAS_PL011 := y
-
-# Use only if calling $(LD) directly.
-#LDFLAGS_DIRECT_OpenBSD = _obsd
-#LDFLAGS_DIRECT_FreeBSD = _fbsd
-LDFLAGS_DIRECT_Linux = _linux
-LDFLAGS_DIRECT += -marmelf$(LDFLAGS_DIRECT_$(XEN_OS))_eabi
-
-CONFIG_LOAD_ADDRESS ?= 0x80000000
diff -r 984086ca8ca0 -r b094ba4bf985 config/arm32.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/arm32.mk	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+CONFIG_ARM := y
+CONFIG_ARM_32 := y
+CONFIG_ARM_$(XEN_OS) := y
+
+# -march= -mcpu=
+
+# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
+CFLAGS += -marm
+
+HAS_PL011 := y
+
+# Use only if calling $(LD) directly.
+#LDFLAGS_DIRECT_OpenBSD = _obsd
+#LDFLAGS_DIRECT_FreeBSD = _fbsd
+LDFLAGS_DIRECT_Linux = _linux
+LDFLAGS_DIRECT += -marmelf$(LDFLAGS_DIRECT_$(XEN_OS))_eabi
+
+CONFIG_LOAD_ADDRESS ?= 0x80000000
diff -r 984086ca8ca0 -r b094ba4bf985 xen/Rules.mk
--- a/xen/Rules.mk	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/Rules.mk	Wed Dec 19 14:16:30 2012 +0000
@@ -28,7 +28,7 @@ endif
 # Set ARCH/SUBARCH appropriately.
 override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
 override TARGET_ARCH     := $(shell echo $(XEN_TARGET_ARCH) | \
-                              sed -e 's/x86.*/x86/')
+                              sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g')
 
 TARGET := $(BASEDIR)/xen
 
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/Makefile	Wed Dec 19 14:16:30 2012 +0000
@@ -1,8 +1,7 @@
-subdir-y += lib
+subdir-$(arm32) += arm32
 
 obj-y += dummy.o
 obj-y += early_printk.o
-obj-y += entry.o
 obj-y += domain.o
 obj-y += domctl.o
 obj-y += sysctl.o
@@ -12,8 +11,6 @@ obj-y += io.o
 obj-y += irq.o
 obj-y += kernel.o
 obj-y += mm.o
-obj-y += mode_switch.o
-obj-y += proc-ca15.o
 obj-y += p2m.o
 obj-y += percpu.o
 obj-y += guestcopy.o
@@ -36,7 +33,7 @@ obj-y += dtb.o
 AFLAGS += -DCONFIG_DTB_FILE=\"$(CONFIG_DTB_FILE)\"
 endif
 
-ALL_OBJS := head.o $(ALL_OBJS)
+ALL_OBJS := $(TARGET_SUBARCH)/head.o $(ALL_OBJS)
 
 $(TARGET): $(TARGET)-syms $(TARGET).bin
 	# XXX: VE model loads by VMA so instead of
@@ -81,7 +78,7 @@ endif
 	    $(@D)/.$(@F).1.o -o $@
 	rm -f $(@D)/.$(@F).[0-9]*
 
-asm-offsets.s: asm-offsets.c
+asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c
 	$(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $<
 
 xen.lds: xen.lds.S
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/Rules.mk
--- a/xen/arch/arm/Rules.mk	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/Rules.mk	Wed Dec 19 14:16:30 2012 +0000
@@ -12,16 +12,19 @@ CFLAGS += -fno-builtin -fno-common -Wred
 CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
 CFLAGS += -I$(BASEDIR)/include
 
-# Prevent floating-point variables from creeping into Xen.
-CFLAGS += -msoft-float
-
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 $(call cc-option-add,CFLAGS,CC,-Wnested-externs)
 
 arm := y
 
+ifeq ($(TARGET_SUBARCH),arm32)
+# Prevent floating-point variables from creeping into Xen.
+CFLAGS += -msoft-float
+CFLAGS += -mcpu=cortex-a15 -mfpu=vfpv3 -mfloat-abi=softfp
+arm32 := y
+arm64 := n
+endif
+
 ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
-
-CFLAGS += -mcpu=cortex-a15 -mfpu=vfpv3 -mfloat-abi=softfp
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/Makefile	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,5 @@
+subdir-y += lib
+
+obj-y += entry.o
+obj-y += mode_switch.o
+obj-y += proc-ca15.o
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/asm-offsets.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/asm-offsets.c	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,80 @@
+/*
+ * Generate definitions needed by assembly language modules.
+ * This code generates raw asm output which is post-processed
+ * to extract and format the required data.
+ */
+#define COMPILE_OFFSETS
+
+#include <xen/config.h>
+#include <xen/types.h>
+#include <xen/sched.h>
+#include <public/xen.h>
+#include <asm/current.h>
+
+#define DEFINE(_sym, _val) \
+    __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
+#define BLANK() \
+    __asm__ __volatile__ ( "\n->" : : )
+#define OFFSET(_sym, _str, _mem) \
+    DEFINE(_sym, offsetof(_str, _mem));
+
+/* base-2 logarithm */
+#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
+#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
+#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
+#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
+#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
+
+void __dummy__(void)
+{
+   OFFSET(UREGS_sp, struct cpu_user_regs, sp);
+   OFFSET(UREGS_lr, struct cpu_user_regs, lr);
+   OFFSET(UREGS_pc, struct cpu_user_regs, pc);
+   OFFSET(UREGS_cpsr, struct cpu_user_regs, cpsr);
+
+   OFFSET(UREGS_LR_usr, struct cpu_user_regs, lr_usr);
+   OFFSET(UREGS_SP_usr, struct cpu_user_regs, sp_usr);
+
+   OFFSET(UREGS_SP_svc, struct cpu_user_regs, sp_svc);
+   OFFSET(UREGS_LR_svc, struct cpu_user_regs, lr_svc);
+   OFFSET(UREGS_SPSR_svc, struct cpu_user_regs, spsr_svc);
+
+   OFFSET(UREGS_SP_abt, struct cpu_user_regs, sp_abt);
+   OFFSET(UREGS_LR_abt, struct cpu_user_regs, lr_abt);
+   OFFSET(UREGS_SPSR_abt, struct cpu_user_regs, spsr_abt);
+
+   OFFSET(UREGS_SP_und, struct cpu_user_regs, sp_und);
+   OFFSET(UREGS_LR_und, struct cpu_user_regs, lr_und);
+   OFFSET(UREGS_SPSR_und, struct cpu_user_regs, spsr_und);
+
+   OFFSET(UREGS_SP_irq, struct cpu_user_regs, sp_irq);
+   OFFSET(UREGS_LR_irq, struct cpu_user_regs, lr_irq);
+   OFFSET(UREGS_SPSR_irq, struct cpu_user_regs, spsr_irq);
+
+   OFFSET(UREGS_SP_fiq, struct cpu_user_regs, sp_fiq);
+   OFFSET(UREGS_LR_fiq, struct cpu_user_regs, lr_fiq);
+   OFFSET(UREGS_SPSR_fiq, struct cpu_user_regs, spsr_fiq);
+
+   OFFSET(UREGS_R8_fiq, struct cpu_user_regs, r8_fiq);
+   OFFSET(UREGS_R9_fiq, struct cpu_user_regs, r9_fiq);
+   OFFSET(UREGS_R10_fiq, struct cpu_user_regs, r10_fiq);
+   OFFSET(UREGS_R11_fiq, struct cpu_user_regs, r11_fiq);
+   OFFSET(UREGS_R12_fiq, struct cpu_user_regs, r12_fiq);
+
+   OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, cpsr);
+   DEFINE(UREGS_user_sizeof, sizeof(struct cpu_user_regs));
+   BLANK();
+
+   DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
+
+   OFFSET(VCPU_arch_saved_context, struct vcpu, arch.saved_context);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/entry.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/entry.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,141 @@
+#include <xen/config.h>
+#include <asm/asm_defns.h>
+#include <public/xen.h>
+
+#define SAVE_ONE_BANKED(reg)    mrs r11, reg; str r11, [sp, #UREGS_##reg]
+#define RESTORE_ONE_BANKED(reg) ldr r11, [sp, #UREGS_##reg]; msr reg, r11
+
+#define SAVE_BANKED(mode) \
+        SAVE_ONE_BANKED(SP_##mode) ; SAVE_ONE_BANKED(LR_##mode) ; SAVE_ONE_BANKED(SPSR_##mode)
+
+#define RESTORE_BANKED(mode) \
+        RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
+
+#define SAVE_ALL                                                        \
+        sub sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */      \
+        push {r0-r12}; /* Save R0-R12 */                                \
+                                                                        \
+        mrs r11, ELR_hyp;               /* ELR_hyp is return address. */\
+        str r11, [sp, #UREGS_pc];                                       \
+                                                                        \
+        str lr, [sp, #UREGS_lr];                                        \
+                                                                        \
+        add r11, sp, #UREGS_kernel_sizeof+4;                            \
+        str r11, [sp, #UREGS_sp];                                       \
+                                                                        \
+        mrs r11, SPSR_hyp;                                              \
+        str r11, [sp, #UREGS_cpsr];                                     \
+        and r11, #PSR_MODE_MASK;                                        \
+        cmp r11, #PSR_MODE_HYP;                                         \
+        blne save_guest_regs
+
+save_guest_regs:
+        ldr r11, =0xffffffff  /* Clobber SP which is only valid for hypervisor frames. */
+        str r11, [sp, #UREGS_sp]
+        SAVE_ONE_BANKED(SP_usr)
+        /* LR_usr is the same physical register as lr and is saved in SAVE_ALL */
+        SAVE_BANKED(svc)
+        SAVE_BANKED(abt)
+        SAVE_BANKED(und)
+        SAVE_BANKED(irq)
+        SAVE_BANKED(fiq)
+        SAVE_ONE_BANKED(R8_fiq); SAVE_ONE_BANKED(R9_fiq); SAVE_ONE_BANKED(R10_fiq)
+        SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
+        mov pc, lr
+
+#define DEFINE_TRAP_ENTRY(trap)                                         \
+        ALIGN;                                                          \
+trap_##trap:                                                            \
+        SAVE_ALL;                                                       \
+        cpsie i;        /* local_irq_enable */                          \
+        adr lr, return_from_trap;                                       \
+        mov r0, sp;                                                     \
+        mov r11, sp;                                                    \
+        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
+        b do_trap_##trap
+
+#define DEFINE_TRAP_ENTRY_NOIRQ(trap)                                   \
+        ALIGN;                                                          \
+trap_##trap:                                                            \
+        SAVE_ALL;                                                       \
+        adr lr, return_from_trap;                                       \
+        mov r0, sp;                                                     \
+        mov r11, sp;                                                    \
+        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
+        b do_trap_##trap
+
+.globl hyp_traps_vector
+        .align 5
+hyp_traps_vector:
+        .word 0                         /* 0x00 - Reset */
+        b trap_undefined_instruction    /* 0x04 - Undefined Instruction */
+        b trap_supervisor_call          /* 0x08 - Supervisor Call */
+        b trap_prefetch_abort           /* 0x0c - Prefetch Abort */
+        b trap_data_abort               /* 0x10 - Data Abort */
+        b trap_hypervisor               /* 0x14 - Hypervisor */
+        b trap_irq                      /* 0x18 - IRQ */
+        b trap_fiq                      /* 0x1c - FIQ */
+
+DEFINE_TRAP_ENTRY(undefined_instruction)
+DEFINE_TRAP_ENTRY(supervisor_call)
+DEFINE_TRAP_ENTRY(prefetch_abort)
+DEFINE_TRAP_ENTRY(data_abort)
+DEFINE_TRAP_ENTRY(hypervisor)
+DEFINE_TRAP_ENTRY_NOIRQ(irq)
+DEFINE_TRAP_ENTRY_NOIRQ(fiq)
+
+return_from_trap:
+        mov sp, r11
+ENTRY(return_to_new_vcpu)
+        ldr r11, [sp, #UREGS_cpsr]
+        and r11, #PSR_MODE_MASK
+        cmp r11, #PSR_MODE_HYP
+        beq return_to_hypervisor
+        /* Fall thru */
+ENTRY(return_to_guest)
+        mov r11, sp
+        bic sp, #7 /* Align the stack pointer */
+        bl leave_hypervisor_tail /* Disables interrupts on return */
+        mov sp, r11
+        RESTORE_ONE_BANKED(SP_usr)
+        /* LR_usr is the same physical register as lr and is restored below */
+        RESTORE_BANKED(svc)
+        RESTORE_BANKED(abt)
+        RESTORE_BANKED(und)
+        RESTORE_BANKED(irq)
+        RESTORE_BANKED(fiq)
+        RESTORE_ONE_BANKED(R8_fiq); RESTORE_ONE_BANKED(R9_fiq); RESTORE_ONE_BANKED(R10_fiq)
+        RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq);
+        /* Fall thru */
+ENTRY(return_to_hypervisor)
+        cpsid i
+        ldr lr, [sp, #UREGS_lr]
+        ldr r11, [sp, #UREGS_pc]
+        msr ELR_hyp, r11
+        ldr r11, [sp, #UREGS_cpsr]
+        msr SPSR_hyp, r11
+        pop {r0-r12}
+        add sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */
+        eret
+
+/*
+ * struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next)
+ *
+ * r0 - prev
+ * r1 - next
+ *
+ * Returns prev in r0
+ */
+ENTRY(__context_switch)
+        add     ip, r0, #VCPU_arch_saved_context
+        stmia   ip!, {r4 - sl, fp, sp, lr}      /* Save register state */
+
+        add     r4, r1, #VCPU_arch_saved_context
+        ldmia   r4, {r4 - sl, fp, sp, pc}       /* Load registers and return */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/head.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/head.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,415 @@
+/*
+ * xen/arch/arm/head.S
+ *
+ * Start-of-day code for an ARMv7-A with virt extensions.
+ *
+ * Tim Deegan <tim@xen.org>
+ * Copyright (c) 2011 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/config.h>
+#include <asm/page.h>
+#include <asm/processor-ca15.h>
+#include <asm/asm_defns.h>
+
+#define ZIMAGE_MAGIC_NUMBER 0x016f2818
+
+#define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
+#define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
+#define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
+#define PT_DEV_L3 0xe73 /* lev3: nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=1, P=1 */
+
+#define PT_UPPER(x) (PT_##x & 0xf00)
+#define PT_LOWER(x) (PT_##x & 0x0ff)
+
+/* Macro to print a string to the UART, if there is one.
+ * Clobbers r0-r3. */
+#ifdef EARLY_UART_ADDRESS
+#define PRINT(_s)       \
+        adr   r0, 98f ; \
+        bl    puts    ; \
+        b     99f     ; \
+98:     .asciz _s     ; \
+        .align 2      ; \
+99:
+#else
+#define PRINT(s)
+#endif
+
+        .arm
+
+        /* This must be the very first address in the loaded image.
+         * It should be linked at XEN_VIRT_START, and loaded at any
+         * 2MB-aligned address.  All of text+data+bss must fit in 2MB,
+         * or the initial pagetable code below will need adjustment. */
+        .global start
+start:
+
+        /* zImage magic header, see:
+         * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
+         */
+        .rept 8
+        mov   r0, r0
+        .endr
+        b     past_zImage
+
+        .word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
+        .word 0x00000000             /* absolute load/run zImage address or
+                                      * 0 for PiC */
+        .word (_end - start)         /* zImage end address */
+
+past_zImage:
+        cpsid aif                    /* Disable all interrupts */
+
+        /* Save the bootloader arguments in less-clobberable registers */
+        mov   r7, r1                 /* r7 := ARM-linux machine type */
+        mov   r8, r2                 /* r8 := ATAG base address */
+
+        /* Find out where we are */
+        ldr   r0, =start
+        adr   r9, start              /* r9  := paddr (start) */
+        sub   r10, r9, r0            /* r10 := phys-offset */
+
+        /* Using the DTB in the .dtb section? */
+#ifdef CONFIG_DTB_FILE
+        ldr   r8, =_sdtb
+        add   r8, r10                /* r8 := paddr(DTB) */
+#endif
+
+        /* Are we the boot CPU? */
+        mov   r12, #0                /* r12 := CPU ID */
+        mrc   CP32(r0, MPIDR)
+        tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
+        beq   boot_cpu
+        tst   r0, #(1<<30)           /* Uniprocessor system? */
+        bne   boot_cpu
+        bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
+        beq   boot_cpu               /* If we're CPU 0, boot now */
+
+        /* Non-boot CPUs wait here to be woken up one at a time. */
+1:      dsb
+        ldr   r0, =smp_up_cpu        /* VA of gate */
+        add   r0, r0, r10            /* PA of gate */
+        ldr   r1, [r0]               /* Which CPU is being booted? */
+        teq   r1, r12                /* Is it us? */
+        wfene
+        bne   1b
+
+boot_cpu:
+#ifdef EARLY_UART_ADDRESS
+        ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
+        teq   r12, #0                   /* CPU 0 sets up the UART too */
+        bleq  init_uart
+        PRINT("- CPU ")
+        mov   r0, r12
+        bl    putn
+        PRINT(" booting -\r\n")
+#endif
+
+        /* Wake up secondary cpus */
+        teq   r12, #0
+        bleq  kick_cpus
+
+        /* Check that this CPU has Hyp mode */
+        mrc   CP32(r0, ID_PFR1)
+        and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
+        teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
+        beq   1f
+        PRINT("- CPU doesn't support the virtualization extensions -\r\n")
+        b     fail
+1:
+        /* Check if we're already in it */
+        mrs   r0, cpsr
+        and   r0, r0, #0x1f          /* Mode is in the low 5 bits of CPSR */
+        teq   r0, #0x1a              /* Hyp Mode? */
+        bne   1f
+        PRINT("- Started in Hyp mode -\r\n")
+        b     hyp
+1:
+        /* Otherwise, it must have been Secure Supervisor mode */
+        mrc   CP32(r0, SCR)
+        tst   r0, #0x1               /* Not-Secure bit set? */
+        beq   1f
+        PRINT("- CPU is not in Hyp mode or Secure state -\r\n")
+        b     fail
+1:
+        /* OK, we're in Secure state. */
+        PRINT("- Started in Secure state -\r\n- Entering Hyp mode -\r\n")
+        ldr   r0, =enter_hyp_mode    /* VA of function */
+        adr   lr, hyp                /* Set return address for call */
+        add   pc, r0, r10            /* Call PA of function */
+
+hyp:
+
+        /* Zero BSS On the boot CPU to avoid nasty surprises */
+        teq   r12, #0
+        bne   skip_bss
+
+        PRINT("- Zero BSS -\r\n")
+        ldr   r0, =__bss_start       /* Load start & end of bss */
+        ldr   r1, =__bss_end
+        add   r0, r0, r10            /* Apply physical offset */
+        add   r1, r1, r10
+
+        mov   r2, #0
+1:      str   r2, [r0], #4
+        cmp   r0, r1
+        blo   1b
+
+skip_bss:
+
+        PRINT("- Setting up control registers -\r\n")
+
+        /* Read CPU ID */
+        mrc   CP32(r0, MIDR)
+        ldr   r1, =(MIDR_MASK)
+        and   r0, r0, r1
+        /* Is this a Cortex A15? */
+        ldr   r1, =(CORTEX_A15_ID)
+        teq   r0, r1
+        bleq  cortex_a15_init
+
+        /* Set up memory attribute type tables */
+        ldr   r0, =MAIR0VAL
+        ldr   r1, =MAIR1VAL
+        mcr   CP32(r0, MAIR0)
+        mcr   CP32(r1, MAIR1)
+        mcr   CP32(r0, HMAIR0)
+        mcr   CP32(r1, HMAIR1)
+
+        /* Set up the HTCR:
+         * PT walks use Outer-Shareable accesses,
+         * PT walks are write-back, no-write-allocate in both cache levels,
+         * Full 32-bit address space goes through this table. */
+        ldr   r0, =0x80002500
+        mcr   CP32(r0, HTCR)
+
+        /* Set up the HSCTLR:
+         * Exceptions in LE ARM,
+         * Low-latency IRQs disabled,
+         * Write-implies-XN disabled (for now),
+         * D-cache disabled (for now),
+         * I-cache enabled,
+         * Alignment checking enabled,
+         * MMU translation disabled (for now). */
+        ldr   r0, =(HSCTLR_BASE|SCTLR_A)
+        mcr   CP32(r0, HSCTLR)
+
+        /* Write Xen's PT's paddr into the HTTBR */
+        ldr   r4, =xen_pgtable
+        add   r4, r4, r10            /* r4 := paddr (xen_pagetable) */
+        mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
+        mcrr  CP64(r4, r5, HTTBR)
+
+        /* Non-boot CPUs don't need to rebuild the pagetable */
+        teq   r12, #0
+        bne   pt_ready
+
+        /* console fixmap */
+#ifdef EARLY_UART_ADDRESS
+        ldr   r1, =xen_fixmap
+        add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
+        mov   r3, #0
+        lsr   r2, r11, #12
+        lsl   r2, r2, #12            /* 4K aligned paddr of UART */
+        orr   r2, r2, #PT_UPPER(DEV_L3)
+        orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
+        strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
+#endif
+
+        /* Build the baseline idle pagetable's first-level entries */
+        ldr   r1, =xen_second
+        add   r1, r1, r10            /* r1 := paddr (xen_second) */
+        mov   r3, #0x0
+        orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 := table map of xen_second */
+        orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
+        strd  r2, r3, [r4, #0]       /* Map it in slot 0 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #8]       /* Map 2nd page in slot 1 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #16]      /* Map 3rd page in slot 2 */
+        add   r2, r2, #0x1000
+        strd  r2, r3, [r4, #24]      /* Map 4th page in slot 3 */
+
+        /* Now set up the second-level entries */
+        orr   r2, r9, #PT_UPPER(MEM)
+        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB normal map of Xen */
+        mov   r4, r9, lsr #18        /* Slot for paddr(start) */
+        strd  r2, r3, [r1, r4]       /* Map Xen there */
+        ldr   r4, =start
+        lsr   r4, #18                /* Slot for vaddr(start) */
+        strd  r2, r3, [r1, r4]       /* Map Xen there too */
+
+        /* xen_fixmap pagetable */
+        ldr   r2, =xen_fixmap
+        add   r2, r2, r10            /* r2 := paddr (xen_fixmap) */
+        orr   r2, r2, #PT_UPPER(PT)
+        orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 := table map of xen_fixmap */
+        add   r4, r4, #8
+        strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
+
+        mov   r3, #0x0
+        lsr   r2, r8, #21
+        lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
+        orr   r2, r2, #PT_UPPER(MEM)
+        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB RAM incl. DTB */
+        add   r4, r4, #8
+        strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
+
+pt_ready:
+        PRINT("- Turning on paging -\r\n")
+
+        ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
+        mrc   CP32(r0, HSCTLR)
+        orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
+        dsb                          /* Flush PTE writes and finish reads */
+        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
+        isb                          /* Now, flush the icache */
+        mov   pc, r1                 /* Get a proper vaddr into PC */
+paging:
+
+
+#ifdef EARLY_UART_ADDRESS
+        /* Use a virtual address to access the UART. */
+        ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+#endif
+
+        PRINT("- Ready -\r\n")
+
+        /* The boot CPU should go straight into C now */
+        teq   r12, #0
+        beq   launch
+
+        /* Non-boot CPUs need to move on to the relocated pagetables */
+        mov   r0, #0
+        ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
+        add   r4, r4, r10            /* PA of it */
+        ldrd  r4, r5, [r4]           /* Actual value */
+        dsb
+        mcrr  CP64(r4, r5, HTTBR)
+        dsb
+        isb
+        mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+        mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
+        mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
+        dsb                          /* Ensure completion of TLB+BP flush */
+        isb
+
+        /* Non-boot CPUs report that they've got this far */
+        ldr   r0, =ready_cpus
+1:      ldrex r1, [r0]               /*            { read # of ready CPUs } */
+        add   r1, r1, #1             /* Atomically { ++                   } */
+        strex r2, r1, [r0]           /*            { writeback            } */
+        teq   r2, #0
+        bne   1b
+        dsb
+        mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
+        dsb
+
+        /* Here, the non-boot CPUs must wait again -- they're now running on
+         * the boot CPU's pagetables so it's safe for the boot CPU to
+         * overwrite the non-relocated copy of Xen.  Once it's done that,
+         * and brought up the memory allocator, non-boot CPUs can get their
+         * own stacks and enter C. */
+1:      wfe
+        dsb
+        ldr   r0, =smp_up_cpu
+        ldr   r1, [r0]               /* Which CPU is being booted? */
+        teq   r1, r12                /* Is it us? */
+        bne   1b
+
+launch:
+        ldr   r0, =init_stack        /* Find the boot-time stack */
+        ldr   sp, [r0]
+        add   sp, #STACK_SIZE        /* (which grows down from the top). */
+        sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
+        mov   r0, r10                /* Marshal args: - phys_offset */
+        mov   r1, r7                 /*               - machine type */
+        mov   r2, r8                 /*               - ATAG address */
+        movs  r3, r12                /*               - CPU ID */
+        beq   start_xen              /* and disappear into the land of C */
+        b     start_secondary        /* (to the appropriate entry point) */
+
+/* Fail-stop
+ * r0: string explaining why */
+fail:   PRINT("- Boot failed -\r\n")
+1:      wfe
+        b     1b
+
+#ifdef EARLY_UART_ADDRESS
+
+/* Bring up the UART. Specific to the PL011 UART.
+ * Clobbers r0-r2 */
+init_uart:
+        mov   r1, #0x0
+        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor fraction) */
+        mov   r1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
+        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor integer) */
+        mov   r1, #0x60              /* 8n1 */
+        str   r1, [r11, #0x24]       /* -> UARTLCR_H (Line control) */
+        ldr   r1, =0x00000301        /* RXE | TXE | UARTEN */
+        str   r1, [r11, #0x30]       /* -> UARTCR (Control Register) */
+        adr   r0, 1f
+        b     puts
+1:      .asciz "- UART enabled -\r\n"
+        .align 4
+
+/* Print early debug messages.  Specific to the PL011 UART.
+ * r0: Nul-terminated string to print.
+ * Clobbers r0-r2 */
+puts:
+        ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
+        tst   r2, #0x8               /* Check BUSY bit */
+        bne   puts                   /* Wait for the UART to be ready */
+        ldrb  r2, [r0], #1           /* Load next char */
+        teq   r2, #0                 /* Exit on nul */
+        moveq pc, lr
+        str   r2, [r11]              /* -> UARTDR (Data Register) */
+        b     puts
+
+/* Print a 32-bit number in hex.  Specific to the PL011 UART.
+ * r0: Number to print.
+ * clobbers r0-r3 */
+putn:
+        adr   r1, hex
+        mov   r3, #8
+1:      ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
+        tst   r2, #0x8               /* Check BUSY bit */
+        bne   1b                     /* Wait for the UART to be ready */
+        and   r2, r0, #0xf0000000    /* Mask off the top nybble */
+        ldrb  r2, [r1, r2, lsr #28]  /* Convert to a char */
+        str   r2, [r11]              /* -> UARTDR (Data Register) */
+        lsl   r0, #4                 /* Roll it through one nybble at a time */
+        subs  r3, r3, #1
+        bne   1b
+        mov   pc, lr
+
+hex:    .ascii "0123456789abcdef"
+        .align 2
+
+#else  /* EARLY_UART_ADDRESS */
+
+init_uart:
+.global early_puts
+early_puts:
+puts:
+putn:   mov   pc, lr
+
+#endif /* EARLY_UART_ADDRESS */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/Makefile	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,5 @@
+obj-y += memcpy.o memmove.o memset.o memzero.o
+obj-y += findbit.o setbit.o
+obj-y += setbit.o clearbit.o changebit.o
+obj-y += testsetbit.o testclearbit.o testchangebit.o
+obj-y += lib1funcs.o lshrdi3.o div64.o
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/assembler.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/assembler.h	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,325 @@
+/* From Linux arch/arm/include/asm/assembler.h */
+/*
+ *  arch/arm/include/asm/assembler.h
+ *
+ *  Copyright (C) 1996-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  This file contains arm architecture specific defines
+ *  for the different processors.
+ *
+ *  Do not include any C declarations in this file - it is included by
+ *  assembler source.
+ */
+#ifndef __ASM_ASSEMBLER_H__
+#define __ASM_ASSEMBLER_H__
+
+#ifndef __ASSEMBLY__
+#error "Only include this from assembly code"
+#endif
+
+// No Thumb, hence:
+#define W(instr)        instr
+#define ARM(instr...)   instr
+#define THUMB(instr...)
+
+#ifdef CONFIG_ARM_UNWIND
+#define UNWIND(code...)         code
+#else
+#define UNWIND(code...)
+#endif
+
+/*
+ * Endian independent macros for shifting bytes within registers.
+ */
+#ifndef __ARMEB__
+#define pull            lsr
+#define push            lsl
+#define get_byte_0      lsl #0
+#define get_byte_1	lsr #8
+#define get_byte_2	lsr #16
+#define get_byte_3	lsr #24
+#define put_byte_0      lsl #0
+#define put_byte_1	lsl #8
+#define put_byte_2	lsl #16
+#define put_byte_3	lsl #24
+#else
+#define pull            lsl
+#define push            lsr
+#define get_byte_0	lsr #24
+#define get_byte_1	lsr #16
+#define get_byte_2	lsr #8
+#define get_byte_3      lsl #0
+#define put_byte_0	lsl #24
+#define put_byte_1	lsl #16
+#define put_byte_2	lsl #8
+#define put_byte_3      lsl #0
+#endif
+
+/*
+ * Data preload for architectures that support it
+ */
+#if __LINUX_ARM_ARCH__ >= 5
+#define PLD(code...)	code
+#else
+#define PLD(code...)
+#endif
+
+/*
+ * This can be used to enable code to cacheline align the destination
+ * pointer when bulk writing to memory.  Experiments on StrongARM and
+ * XScale didn't show this a worthwhile thing to do when the cache is not
+ * set to write-allocate (this would need further testing on XScale when WA
+ * is used).
+ *
+ * On Feroceon there is much to gain however, regardless of cache mode.
+ */
+#ifdef CONFIG_CPU_FEROCEON
+#define CALGN(code...) code
+#else
+#define CALGN(code...)
+#endif
+
+/*
+ * Enable and disable interrupts
+ */
+#if __LINUX_ARM_ARCH__ >= 6
+	.macro	disable_irq_notrace
+	cpsid	i
+	.endm
+
+	.macro	enable_irq_notrace
+	cpsie	i
+	.endm
+#else
+	.macro	disable_irq_notrace
+	msr	cpsr_c, #PSR_I_BIT | SVC_MODE
+	.endm
+
+	.macro	enable_irq_notrace
+	msr	cpsr_c, #SVC_MODE
+	.endm
+#endif
+
+	.macro asm_trace_hardirqs_off
+#if defined(CONFIG_TRACE_IRQFLAGS)
+	stmdb   sp!, {r0-r3, ip, lr}
+	bl	trace_hardirqs_off
+	ldmia	sp!, {r0-r3, ip, lr}
+#endif
+	.endm
+
+	.macro asm_trace_hardirqs_on_cond, cond
+#if defined(CONFIG_TRACE_IRQFLAGS)
+	/*
+	 * actually the registers should be pushed and pop'd conditionally, but
+	 * after bl the flags are certainly clobbered
+	 */
+	stmdb   sp!, {r0-r3, ip, lr}
+	bl\cond	trace_hardirqs_on
+	ldmia	sp!, {r0-r3, ip, lr}
+#endif
+	.endm
+
+	.macro asm_trace_hardirqs_on
+	asm_trace_hardirqs_on_cond al
+	.endm
+
+	.macro disable_irq
+	disable_irq_notrace
+	asm_trace_hardirqs_off
+	.endm
+
+	.macro enable_irq
+	asm_trace_hardirqs_on
+	enable_irq_notrace
+	.endm
+/*
+ * Save the current IRQ state and disable IRQs.  Note that this macro
+ * assumes FIQs are enabled, and that the processor is in SVC mode.
+ */
+	.macro	save_and_disable_irqs, oldcpsr
+	mrs	\oldcpsr, cpsr
+	disable_irq
+	.endm
+
+/*
+ * Restore interrupt state previously stored in a register.  We don't
+ * guarantee that this will preserve the flags.
+ */
+	.macro	restore_irqs_notrace, oldcpsr
+	msr	cpsr_c, \oldcpsr
+	.endm
+
+	.macro restore_irqs, oldcpsr
+	tst	\oldcpsr, #PSR_I_BIT
+	asm_trace_hardirqs_on_cond eq
+	restore_irqs_notrace \oldcpsr
+	.endm
+
+#define USER(x...)				\
+9999:	x;					\
+	.pushsection __ex_table,"a";		\
+	.align	3;				\
+	.long	9999b,9001f;			\
+	.popsection
+
+#ifdef CONFIG_SMP
+#define ALT_SMP(instr...)					\
+9998:	instr
+/*
+ * Note: if you get assembler errors from ALT_UP() when building with
+ * CONFIG_THUMB2_KERNEL, you almost certainly need to use
+ * ALT_SMP( W(instr) ... )
+ */
+#define ALT_UP(instr...)					\
+	.pushsection ".alt.smp.init", "a"			;\
+	.long	9998b						;\
+9997:	instr							;\
+	.if . - 9997b != 4					;\
+		.error "ALT_UP() content must assemble to exactly 4 bytes";\
+	.endif							;\
+	.popsection
+#define ALT_UP_B(label)					\
+	.equ	up_b_offset, label - 9998b			;\
+	.pushsection ".alt.smp.init", "a"			;\
+	.long	9998b						;\
+	W(b)	. + up_b_offset					;\
+	.popsection
+#else
+#define ALT_SMP(instr...)
+#define ALT_UP(instr...) instr
+#define ALT_UP_B(label) b label
+#endif
+
+/*
+ * Instruction barrier
+ */
+	.macro	instr_sync
+#if __LINUX_ARM_ARCH__ >= 7
+	isb
+#elif __LINUX_ARM_ARCH__ == 6
+	mcr	p15, 0, r0, c7, c5, 4
+#endif
+	.endm
+
+/*
+ * SMP data memory barrier
+ */
+	.macro	smp_dmb mode
+#ifdef CONFIG_SMP
+#if __LINUX_ARM_ARCH__ >= 7
+	.ifeqs "\mode","arm"
+	ALT_SMP(dmb)
+	.else
+	ALT_SMP(W(dmb))
+	.endif
+#elif __LINUX_ARM_ARCH__ == 6
+	ALT_SMP(mcr	p15, 0, r0, c7, c10, 5)	@ dmb
+#else
+#error Incompatible SMP platform
+#endif
+	.ifeqs "\mode","arm"
+	ALT_UP(nop)
+	.else
+	ALT_UP(W(nop))
+	.endif
+#endif
+	.endm
+
+#ifdef CONFIG_THUMB2_KERNEL
+	.macro	setmode, mode, reg
+	mov	\reg, #\mode
+	msr	cpsr_c, \reg
+	.endm
+#else
+	.macro	setmode, mode, reg
+	msr	cpsr_c, #\mode
+	.endm
+#endif
+
+/*
+ * STRT/LDRT access macros with ARM and Thumb-2 variants
+ */
+#ifdef CONFIG_THUMB2_KERNEL
+
+	.macro	usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T()
+9999:
+	.if	\inc == 1
+	\instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
+	.elseif	\inc == 4
+	\instr\cond\()\t\().w \reg, [\ptr, #\off]
+	.else
+	.error	"Unsupported inc macro argument"
+	.endif
+
+	.pushsection __ex_table,"a"
+	.align	3
+	.long	9999b, \abort
+	.popsection
+	.endm
+
+	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort
+	@ explicit IT instruction needed because of the label
+	@ introduced by the USER macro
+	.ifnc	\cond,al
+	.if	\rept == 1
+	itt	\cond
+	.elseif	\rept == 2
+	ittt	\cond
+	.else
+	.error	"Unsupported rept macro argument"
+	.endif
+	.endif
+
+	@ Slightly optimised to avoid incrementing the pointer twice
+	usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort
+	.if	\rept == 2
+	usraccoff \instr, \reg, \ptr, \inc, \inc, \cond, \abort
+	.endif
+
+	add\cond \ptr, #\rept * \inc
+	.endm
+
+#else	/* !CONFIG_THUMB2_KERNEL */
+
+	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort, t=T()
+	.rept	\rept
+9999:
+	.if	\inc == 1
+	\instr\cond\()b\()\t \reg, [\ptr], #\inc
+	.elseif	\inc == 4
+	\instr\cond\()\t \reg, [\ptr], #\inc
+	.else
+	.error	"Unsupported inc macro argument"
+	.endif
+
+	.pushsection __ex_table,"a"
+	.align	3
+	.long	9999b, \abort
+	.popsection
+	.endr
+	.endm
+
+#endif	/* CONFIG_THUMB2_KERNEL */
+
+	.macro	strusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
+	usracc	str, \reg, \ptr, \inc, \cond, \rept, \abort
+	.endm
+
+	.macro	ldrusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
+	usracc	ldr, \reg, \ptr, \inc, \cond, \rept, \abort
+	.endm
+
+/* Utility macro for declaring string literals */
+	.macro	string name:req, string
+	.type \name , #object
+\name:
+	.asciz "\string"
+	.size \name , . - \name
+	.endm
+
+#endif /* __ASM_ASSEMBLER_H__ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/bitops.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/bitops.h	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,87 @@
+#include <xen/config.h>
+
+#if __LINUX_ARM_ARCH__ >= 6
+	.macro	bitop, instr
+	ands	ip, r1, #3
+	strneb	r1, [ip]		@ assert word-aligned
+	mov	r2, #1
+	and	r3, r0, #31		@ Get bit offset
+	mov	r0, r0, lsr #5
+	add	r1, r1, r0, lsl #2	@ Get word offset
+	mov	r3, r2, lsl r3
+1:	ldrex	r2, [r1]
+	\instr	r2, r2, r3
+	strex	r0, r2, [r1]
+	cmp	r0, #0
+	bne	1b
+	bx	lr
+	.endm
+
+	.macro	testop, instr, store
+	ands	ip, r1, #3
+	strneb	r1, [ip]		@ assert word-aligned
+	mov	r2, #1
+	and	r3, r0, #31		@ Get bit offset
+	mov	r0, r0, lsr #5
+	add	r1, r1, r0, lsl #2	@ Get word offset
+	mov	r3, r2, lsl r3		@ create mask
+	smp_dmb
+1:	ldrex	r2, [r1]
+	ands	r0, r2, r3		@ save old value of bit
+	\instr	r2, r2, r3		@ toggle bit
+	strex	ip, r2, [r1]
+	cmp	ip, #0
+	bne	1b
+	smp_dmb
+	cmp	r0, #0
+	movne	r0, #1
+2:	bx	lr
+	.endm
+#else
+	.macro	bitop, name, instr
+ENTRY(	\name		)
+UNWIND(	.fnstart	)
+	ands	ip, r1, #3
+	strneb	r1, [ip]		@ assert word-aligned
+	and	r2, r0, #31
+	mov	r0, r0, lsr #5
+	mov	r3, #1
+	mov	r3, r3, lsl r2
+	save_and_disable_irqs ip
+	ldr	r2, [r1, r0, lsl #2]
+	\instr	r2, r2, r3
+	str	r2, [r1, r0, lsl #2]
+	restore_irqs ip
+	mov	pc, lr
+UNWIND(	.fnend		)
+ENDPROC(\name		)
+	.endm
+
+/**
+ * testop - implement a test_and_xxx_bit operation.
+ * @instr: operational instruction
+ * @store: store instruction
+ *
+ * Note: we can trivially conditionalise the store instruction
+ * to avoid dirtying the data cache.
+ */
+	.macro	testop, name, instr, store
+ENTRY(	\name		)
+UNWIND(	.fnstart	)
+	ands	ip, r1, #3
+	strneb	r1, [ip]		@ assert word-aligned
+	and	r3, r0, #31
+	mov	r0, r0, lsr #5
+	save_and_disable_irqs ip
+	ldr	r2, [r1, r0, lsl #2]!
+	mov	r0, #1
+	tst	r2, r0, lsl r3
+	\instr	r2, r2, r0, lsl r3
+	\store	r2, [r1]
+	moveq	r0, #0
+	restore_irqs ip
+	mov	pc, lr
+UNWIND(	.fnend		)
+ENDPROC(\name		)
+	.endm
+#endif
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/changebit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/changebit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/arm/lib/changebit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+                .text
+
+ENTRY(_change_bit)
+	bitop	eor
+ENDPROC(_change_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/clearbit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/clearbit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,19 @@
+/*
+ *  linux/arch/arm/lib/clearbit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+                .text
+
+ENTRY(_clear_bit)
+	bitop	bic
+ENDPROC(_clear_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/copy_template.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/copy_template.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,267 @@
+/*
+ *  linux/arch/arm/lib/copy_template.s
+ *
+ *  Code template for optimized memory copy functions
+ *
+ *  Author:	Nicolas Pitre
+ *  Created:	Sep 28, 2005
+ *  Copyright:	MontaVista Software, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+/*
+ * Theory of operation
+ * -------------------
+ *
+ * This file provides the core code for a forward memory copy used in
+ * the implementation of memcopy(), copy_to_user() and copy_from_user().
+ *
+ * The including file must define the following accessor macros
+ * according to the need of the given function:
+ *
+ * ldr1w ptr reg abort
+ *
+ *	This loads one word from 'ptr', stores it in 'reg' and increments
+ *	'ptr' to the next word. The 'abort' argument is used for fixup tables.
+ *
+ * ldr4w ptr reg1 reg2 reg3 reg4 abort
+ * ldr8w ptr, reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
+ *
+ *	This loads four or eight words starting from 'ptr', stores them
+ *	in provided registers and increments 'ptr' past those words.
+ *	The'abort' argument is used for fixup tables.
+ *
+ * ldr1b ptr reg cond abort
+ *
+ *	Similar to ldr1w, but it loads a byte and increments 'ptr' one byte.
+ *	It also must apply the condition code if provided, otherwise the
+ *	"al" condition is assumed by default.
+ *
+ * str1w ptr reg abort
+ * str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
+ * str1b ptr reg cond abort
+ *
+ *	Same as their ldr* counterparts, but data is stored to 'ptr' location
+ *	rather than being loaded.
+ *
+ * enter reg1 reg2
+ *
+ *	Preserve the provided registers on the stack plus any additional
+ *	data as needed by the implementation including this code. Called
+ *	upon code entry.
+ *
+ * exit reg1 reg2
+ *
+ *	Restore registers with the values previously saved with the
+ *	'preserv' macro. Called upon code termination.
+ *
+ * LDR1W_SHIFT
+ * STR1W_SHIFT
+ *
+ *	Correction to be applied to the "ip" register when branching into
+ *	the ldr1w or str1w instructions (some of these macros may expand to
+ *	than one 32bit instruction in Thumb-2)
+ */
+
+
+		enter	r4, lr
+
+		subs	r2, r2, #4
+		blt	8f
+		ands	ip, r0, #3
+	PLD(	pld	[r1, #0]		)
+		bne	9f
+		ands	ip, r1, #3
+		bne	10f
+
+1:		subs	r2, r2, #(28)
+		stmfd	sp!, {r5 - r8}
+		blt	5f
+
+	CALGN(	ands	ip, r0, #31		)
+	CALGN(	rsb	r3, ip, #32		)
+	CALGN(	sbcnes	r4, r3, r2		)  @ C is always set here
+	CALGN(	bcs	2f			)
+	CALGN(	adr	r4, 6f			)
+	CALGN(	subs	r2, r2, r3		)  @ C gets set
+	CALGN(	add	pc, r4, ip		)
+
+	PLD(	pld	[r1, #0]		)
+2:	PLD(	subs	r2, r2, #96		)
+	PLD(	pld	[r1, #28]		)
+	PLD(	blt	4f			)
+	PLD(	pld	[r1, #60]		)
+	PLD(	pld	[r1, #92]		)
+
+3:	PLD(	pld	[r1, #124]		)
+4:		ldr8w	r1, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f
+		subs	r2, r2, #32
+		str8w	r0, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f
+		bge	3b
+	PLD(	cmn	r2, #96			)
+	PLD(	bge	4b			)
+
+5:		ands	ip, r2, #28
+		rsb	ip, ip, #32
+#if LDR1W_SHIFT > 0
+		lsl	ip, ip, #LDR1W_SHIFT
+#endif
+		addne	pc, pc, ip		@ C is always clear here
+		b	7f
+6:
+		.rept	(1 << LDR1W_SHIFT)
+		W(nop)
+		.endr
+		ldr1w	r1, r3, abort=20f
+		ldr1w	r1, r4, abort=20f
+		ldr1w	r1, r5, abort=20f
+		ldr1w	r1, r6, abort=20f
+		ldr1w	r1, r7, abort=20f
+		ldr1w	r1, r8, abort=20f
+		ldr1w	r1, lr, abort=20f
+
+#if LDR1W_SHIFT < STR1W_SHIFT
+		lsl	ip, ip, #STR1W_SHIFT - LDR1W_SHIFT
+#elif LDR1W_SHIFT > STR1W_SHIFT
+		lsr	ip, ip, #LDR1W_SHIFT - STR1W_SHIFT
+#endif
+		add	pc, pc, ip
+		nop
+		.rept	(1 << STR1W_SHIFT)
+		W(nop)
+		.endr
+		str1w	r0, r3, abort=20f
+		str1w	r0, r4, abort=20f
+		str1w	r0, r5, abort=20f
+		str1w	r0, r6, abort=20f
+		str1w	r0, r7, abort=20f
+		str1w	r0, r8, abort=20f
+		str1w	r0, lr, abort=20f
+
+	CALGN(	bcs	2b			)
+
+7:		ldmfd	sp!, {r5 - r8}
+
+8:		movs	r2, r2, lsl #31
+		ldr1b	r1, r3, ne, abort=21f
+		ldr1b	r1, r4, cs, abort=21f
+		ldr1b	r1, ip, cs, abort=21f
+		str1b	r0, r3, ne, abort=21f
+		str1b	r0, r4, cs, abort=21f
+		str1b	r0, ip, cs, abort=21f
+
+		exit	r4, pc
+
+9:		rsb	ip, ip, #4
+		cmp	ip, #2
+		ldr1b	r1, r3, gt, abort=21f
+		ldr1b	r1, r4, ge, abort=21f
+		ldr1b	r1, lr, abort=21f
+		str1b	r0, r3, gt, abort=21f
+		str1b	r0, r4, ge, abort=21f
+		subs	r2, r2, ip
+		str1b	r0, lr, abort=21f
+		blt	8b
+		ands	ip, r1, #3
+		beq	1b
+
+10:		bic	r1, r1, #3
+		cmp	ip, #2
+		ldr1w	r1, lr, abort=21f
+		beq	17f
+		bgt	18f
+
+
+		.macro	forward_copy_shift pull push
+
+		subs	r2, r2, #28
+		blt	14f
+
+	CALGN(	ands	ip, r0, #31		)
+	CALGN(	rsb	ip, ip, #32		)
+	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
+	CALGN(	subcc	r2, r2, ip		)
+	CALGN(	bcc	15f			)
+
+11:		stmfd	sp!, {r5 - r9}
+
+	PLD(	pld	[r1, #0]		)
+	PLD(	subs	r2, r2, #96		)
+	PLD(	pld	[r1, #28]		)
+	PLD(	blt	13f			)
+	PLD(	pld	[r1, #60]		)
+	PLD(	pld	[r1, #92]		)
+
+12:	PLD(	pld	[r1, #124]		)
+13:		ldr4w	r1, r4, r5, r6, r7, abort=19f
+		mov	r3, lr, pull #\pull
+		subs	r2, r2, #32
+		ldr4w	r1, r8, r9, ip, lr, abort=19f
+		orr	r3, r3, r4, push #\push
+		mov	r4, r4, pull #\pull
+		orr	r4, r4, r5, push #\push
+		mov	r5, r5, pull #\pull
+		orr	r5, r5, r6, push #\push
+		mov	r6, r6, pull #\pull
+		orr	r6, r6, r7, push #\push
+		mov	r7, r7, pull #\pull
+		orr	r7, r7, r8, push #\push
+		mov	r8, r8, pull #\pull
+		orr	r8, r8, r9, push #\push
+		mov	r9, r9, pull #\pull
+		orr	r9, r9, ip, push #\push
+		mov	ip, ip, pull #\pull
+		orr	ip, ip, lr, push #\push
+		str8w	r0, r3, r4, r5, r6, r7, r8, r9, ip, , abort=19f
+		bge	12b
+	PLD(	cmn	r2, #96			)
+	PLD(	bge	13b			)
+
+		ldmfd	sp!, {r5 - r9}
+
+14:		ands	ip, r2, #28
+		beq	16f
+
+15:		mov	r3, lr, pull #\pull
+		ldr1w	r1, lr, abort=21f
+		subs	ip, ip, #4
+		orr	r3, r3, lr, push #\push
+		str1w	r0, r3, abort=21f
+		bgt	15b
+	CALGN(	cmp	r2, #0			)
+	CALGN(	bge	11b			)
+
+16:		sub	r1, r1, #(\push / 8)
+		b	8b
+
+		.endm
+
+
+		forward_copy_shift	pull=8	push=24
+
+17:		forward_copy_shift	pull=16	push=16
+
+18:		forward_copy_shift	pull=24	push=8
+
+
+/*
+ * Abort preamble and completion macros.
+ * If a fixup handler is required then those macros must surround it.
+ * It is assumed that the fixup code will handle the private part of
+ * the exit macro.
+ */
+
+	.macro	copy_abort_preamble
+19:	ldmfd	sp!, {r5 - r9}
+	b	21f
+20:	ldmfd	sp!, {r5 - r8}
+21:
+	.endm
+
+	.macro	copy_abort_end
+	ldmfd	sp!, {r4, pc}
+	.endm
+
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/div64.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/div64.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,211 @@
+/*
+ *  linux/arch/arm/lib/div64.S
+ *
+ *  Optimized computation of 64-bit dividend / 32-bit divisor
+ *
+ *  Author:	Nicolas Pitre
+ *  Created:	Oct 5, 2003
+ *  Copyright:	Monta Vista Software, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <xen/config.h>
+#include "assembler.h"
+	
+#ifdef __ARMEB__
+#define xh r0
+#define xl r1
+#define yh r2
+#define yl r3
+#else
+#define xl r0
+#define xh r1
+#define yl r2
+#define yh r3
+#endif
+
+/*
+ * __do_div64: perform a division with 64-bit dividend and 32-bit divisor.
+ *
+ * Note: Calling convention is totally non standard for optimal code.
+ *       This is meant to be used by do_div() from include/asm/div64.h only.
+ *
+ * Input parameters:
+ * 	xh-xl	= dividend (clobbered)
+ * 	r4	= divisor (preserved)
+ *
+ * Output values:
+ * 	yh-yl	= result
+ * 	xh	= remainder
+ *
+ * Clobbered regs: xl, ip
+ */
+
+ENTRY(__do_div64)
+UNWIND(.fnstart)
+
+	@ Test for easy paths first.
+	subs	ip, r4, #1
+	bls	9f			@ divisor is 0 or 1
+	tst	ip, r4
+	beq	8f			@ divisor is power of 2
+
+	@ See if we need to handle upper 32-bit result.
+	cmp	xh, r4
+	mov	yh, #0
+	blo	3f
+
+	@ Align divisor with upper part of dividend.
+	@ The aligned divisor is stored in yl preserving the original.
+	@ The bit position is stored in ip.
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	yl, r4
+	clz	ip, xh
+	sub	yl, yl, ip
+	mov	ip, #1
+	mov	ip, ip, lsl yl
+	mov	yl, r4, lsl yl
+
+#else
+
+	mov	yl, r4
+	mov	ip, #1
+1:	cmp	yl, #0x80000000
+	cmpcc	yl, xh
+	movcc	yl, yl, lsl #1
+	movcc	ip, ip, lsl #1
+	bcc	1b
+
+#endif
+
+	@ The division loop for needed upper bit positions.
+ 	@ Break out early if dividend reaches 0.
+2:	cmp	xh, yl
+	orrcs	yh, yh, ip
+	subcss	xh, xh, yl
+	movnes	ip, ip, lsr #1
+	mov	yl, yl, lsr #1
+	bne	2b
+
+	@ See if we need to handle lower 32-bit result.
+3:	cmp	xh, #0
+	mov	yl, #0
+	cmpeq	xl, r4
+	movlo	xh, xl
+	movlo	pc, lr
+
+	@ The division loop for lower bit positions.
+	@ Here we shift remainer bits leftwards rather than moving the
+	@ divisor for comparisons, considering the carry-out bit as well.
+	mov	ip, #0x80000000
+4:	movs	xl, xl, lsl #1
+	adcs	xh, xh, xh
+	beq	6f
+	cmpcc	xh, r4
+5:	orrcs	yl, yl, ip
+	subcs	xh, xh, r4
+	movs	ip, ip, lsr #1
+	bne	4b
+	mov	pc, lr
+
+	@ The top part of remainder became zero.  If carry is set
+	@ (the 33th bit) this is a false positive so resume the loop.
+	@ Otherwise, if lower part is also null then we are done.
+6:	bcs	5b
+	cmp	xl, #0
+	moveq	pc, lr
+
+	@ We still have remainer bits in the low part.  Bring them up.
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	xh, xl			@ we know xh is zero here so...
+	add	xh, xh, #1
+	mov	xl, xl, lsl xh
+	mov	ip, ip, lsr xh
+
+#else
+
+7:	movs	xl, xl, lsl #1
+	mov	ip, ip, lsr #1
+	bcc	7b
+
+#endif
+
+	@ Current remainder is now 1.  It is worthless to compare with
+	@ divisor at this point since divisor can not be smaller than 3 here.
+	@ If possible, branch for another shift in the division loop.
+	@ If no bit position left then we are done.
+	movs	ip, ip, lsr #1
+	mov	xh, #1
+	bne	4b
+	mov	pc, lr
+
+8:	@ Division by a power of 2: determine what that divisor order is
+	@ then simply shift values around
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	ip, r4
+	rsb	ip, ip, #31
+
+#else
+
+	mov	yl, r4
+	cmp	r4, #(1 << 16)
+	mov	ip, #0
+	movhs	yl, yl, lsr #16
+	movhs	ip, #16
+
+	cmp	yl, #(1 << 8)
+	movhs	yl, yl, lsr #8
+	addhs	ip, ip, #8
+
+	cmp	yl, #(1 << 4)
+	movhs	yl, yl, lsr #4
+	addhs	ip, ip, #4
+
+	cmp	yl, #(1 << 2)
+	addhi	ip, ip, #3
+	addls	ip, ip, yl, lsr #1
+
+#endif
+
+	mov	yh, xh, lsr ip
+	mov	yl, xl, lsr ip
+	rsb	ip, ip, #32
+ ARM(	orr	yl, yl, xh, lsl ip	)
+ THUMB(	lsl	xh, xh, ip		)
+ THUMB(	orr	yl, yl, xh		)
+	mov	xh, xl, lsl ip
+	mov	xh, xh, lsr ip
+	mov	pc, lr
+
+	@ eq -> division by 1: obvious enough...
+9:	moveq	yl, xl
+	moveq	yh, xh
+	moveq	xh, #0
+	moveq	pc, lr
+UNWIND(.fnend)
+
+UNWIND(.fnstart)
+UNWIND(.pad #4)
+UNWIND(.save {lr})
+Ldiv0_64:
+	@ Division by 0:
+	str	lr, [sp, #-8]!
+	bl	__div0
+
+	@ as wrong as it could be...
+	mov	yl, #0
+	mov	yh, #0
+	mov	xh, #0
+	ldr	pc, [sp], #8
+
+UNWIND(.fnend)
+ENDPROC(__do_div64)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/findbit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/findbit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,198 @@
+/*
+ *  linux/arch/arm/lib/findbit.S
+ *
+ *  Copyright (C) 1995-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 16th March 2001 - John Ripley <jripley@sonicblue.com>
+ *   Fixed so that "size" is an exclusive not an inclusive quantity.
+ *   All users of these functions expect exclusive sizes, and may
+ *   also call with zero size.
+ * Reworked by rmk.
+ */
+
+#include <xen/config.h>
+
+#include "assembler.h"
+                .text
+
+/*
+ * Purpose  : Find a 'zero' bit
+ * Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit);
+ */
+ENTRY(_find_first_zero_bit_le)
+		teq	r1, #0	
+		beq	3f
+		mov	r2, #0
+1:
+ ARM(		ldrb	r3, [r0, r2, lsr #3]	)
+ THUMB(		lsr	r3, r2, #3		)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		eors	r3, r3, #0xff		@ invert bits
+		bne	.L_found		@ any now set - found zero bit
+		add	r2, r2, #8		@ next bit pointer
+2:		cmp	r2, r1			@ any more?
+		blo	1b
+3:		mov	r0, r1			@ no free bits
+		mov	pc, lr
+ENDPROC(_find_first_zero_bit_le)
+
+/*
+ * Purpose  : Find next 'zero' bit
+ * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
+ */
+ENTRY(_find_next_zero_bit_le)
+		teq	r1, #0
+		beq	3b
+		ands	ip, r2, #7
+		beq	1b			@ If new byte, goto old routine
+ ARM(		ldrb	r3, [r0, r2, lsr #3]	)
+ THUMB(		lsr	r3, r2, #3		)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		eor	r3, r3, #0xff		@ now looking for a 1 bit
+		movs	r3, r3, lsr ip		@ shift off unused bits
+		bne	.L_found
+		orr	r2, r2, #7		@ if zero, then no bits here
+		add	r2, r2, #1		@ align bit pointer
+		b	2b			@ loop for next bit
+ENDPROC(_find_next_zero_bit_le)
+
+/*
+ * Purpose  : Find a 'one' bit
+ * Prototype: int find_first_bit(const unsigned long *addr, unsigned int maxbit);
+ */
+ENTRY(_find_first_bit_le)
+		teq	r1, #0	
+		beq	3f
+		mov	r2, #0
+1:
+ ARM(		ldrb	r3, [r0, r2, lsr #3]	)
+ THUMB(		lsr	r3, r2, #3		)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		movs	r3, r3
+		bne	.L_found		@ any now set - found zero bit
+		add	r2, r2, #8		@ next bit pointer
+2:		cmp	r2, r1			@ any more?
+		blo	1b
+3:		mov	r0, r1			@ no free bits
+		mov	pc, lr
+ENDPROC(_find_first_bit_le)
+
+/*
+ * Purpose  : Find next 'one' bit
+ * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
+ */
+ENTRY(_find_next_bit_le)
+		teq	r1, #0
+		beq	3b
+		ands	ip, r2, #7
+		beq	1b			@ If new byte, goto old routine
+ ARM(		ldrb	r3, [r0, r2, lsr #3]	)
+ THUMB(		lsr	r3, r2, #3		)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		movs	r3, r3, lsr ip		@ shift off unused bits
+		bne	.L_found
+		orr	r2, r2, #7		@ if zero, then no bits here
+		add	r2, r2, #1		@ align bit pointer
+		b	2b			@ loop for next bit
+ENDPROC(_find_next_bit_le)
+
+#ifdef __ARMEB__
+
+ENTRY(_find_first_zero_bit_be)
+		teq	r1, #0
+		beq	3f
+		mov	r2, #0
+1:		eor	r3, r2, #0x18		@ big endian byte ordering
+ ARM(		ldrb	r3, [r0, r3, lsr #3]	)
+ THUMB(		lsr	r3, #3			)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		eors	r3, r3, #0xff		@ invert bits
+		bne	.L_found		@ any now set - found zero bit
+		add	r2, r2, #8		@ next bit pointer
+2:		cmp	r2, r1			@ any more?
+		blo	1b
+3:		mov	r0, r1			@ no free bits
+		mov	pc, lr
+ENDPROC(_find_first_zero_bit_be)
+
+ENTRY(_find_next_zero_bit_be)
+		teq	r1, #0
+		beq	3b
+		ands	ip, r2, #7
+		beq	1b			@ If new byte, goto old routine
+		eor	r3, r2, #0x18		@ big endian byte ordering
+ ARM(		ldrb	r3, [r0, r3, lsr #3]	)
+ THUMB(		lsr	r3, #3			)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		eor	r3, r3, #0xff		@ now looking for a 1 bit
+		movs	r3, r3, lsr ip		@ shift off unused bits
+		bne	.L_found
+		orr	r2, r2, #7		@ if zero, then no bits here
+		add	r2, r2, #1		@ align bit pointer
+		b	2b			@ loop for next bit
+ENDPROC(_find_next_zero_bit_be)
+
+ENTRY(_find_first_bit_be)
+		teq	r1, #0
+		beq	3f
+		mov	r2, #0
+1:		eor	r3, r2, #0x18		@ big endian byte ordering
+ ARM(		ldrb	r3, [r0, r3, lsr #3]	)
+ THUMB(		lsr	r3, #3			)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		movs	r3, r3
+		bne	.L_found		@ any now set - found zero bit
+		add	r2, r2, #8		@ next bit pointer
+2:		cmp	r2, r1			@ any more?
+		blo	1b
+3:		mov	r0, r1			@ no free bits
+		mov	pc, lr
+ENDPROC(_find_first_bit_be)
+
+ENTRY(_find_next_bit_be)
+		teq	r1, #0
+		beq	3b
+		ands	ip, r2, #7
+		beq	1b			@ If new byte, goto old routine
+		eor	r3, r2, #0x18		@ big endian byte ordering
+ ARM(		ldrb	r3, [r0, r3, lsr #3]	)
+ THUMB(		lsr	r3, #3			)
+ THUMB(		ldrb	r3, [r0, r3]		)
+		movs	r3, r3, lsr ip		@ shift off unused bits
+		bne	.L_found
+		orr	r2, r2, #7		@ if zero, then no bits here
+		add	r2, r2, #1		@ align bit pointer
+		b	2b			@ loop for next bit
+ENDPROC(_find_next_bit_be)
+
+#endif
+
+/*
+ * One or more bits in the LSB of r3 are assumed to be set.
+ */
+.L_found:
+#if __LINUX_ARM_ARCH__ >= 5
+		rsb	r0, r3, #0
+		and	r3, r3, r0
+		clz	r3, r3
+		rsb	r3, r3, #31
+		add	r0, r2, r3
+#else
+		tst	r3, #0x0f
+		addeq	r2, r2, #4
+		movne	r3, r3, lsl #4
+		tst	r3, #0x30
+		addeq	r2, r2, #2
+		movne	r3, r3, lsl #2
+		tst	r3, #0x40
+		addeq	r2, r2, #1
+		mov	r0, r2
+#endif
+		cmp	r1, r0			@ Clamp to maxbit
+		movlo	r0, r1
+		mov	pc, lr
+
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/lib1funcs.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/lib1funcs.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,389 @@
+/*
+ * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
+ *
+ * Author: Nicolas Pitre <nico@fluxnic.net>
+ *   - contributed to gcc-3.4 on Sep 30, 2003
+ *   - adapted for the Linux kernel on Oct 2, 2003
+ */
+
+/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+
+This file is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file.  (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+This file is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+
+#include <xen/config.h>
+#include "assembler.h"
+
+.macro ARM_DIV_BODY dividend, divisor, result, curbit
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	\curbit, \divisor
+	clz	\result, \dividend
+	sub	\result, \curbit, \result
+	mov	\curbit, #1
+	mov	\divisor, \divisor, lsl \result
+	mov	\curbit, \curbit, lsl \result
+	mov	\result, #0
+	
+#else
+
+	@ Initially shift the divisor left 3 bits if possible,
+	@ set curbit accordingly.  This allows for curbit to be located
+	@ at the left end of each 4 bit nibbles in the division loop
+	@ to save one loop in most cases.
+	tst	\divisor, #0xe0000000
+	moveq	\divisor, \divisor, lsl #3
+	moveq	\curbit, #8
+	movne	\curbit, #1
+
+	@ Unless the divisor is very big, shift it up in multiples of
+	@ four bits, since this is the amount of unwinding in the main
+	@ division loop.  Continue shifting until the divisor is 
+	@ larger than the dividend.
+1:	cmp	\divisor, #0x10000000
+	cmplo	\divisor, \dividend
+	movlo	\divisor, \divisor, lsl #4
+	movlo	\curbit, \curbit, lsl #4
+	blo	1b
+
+	@ For very big divisors, we must shift it a bit at a time, or
+	@ we will be in danger of overflowing.
+1:	cmp	\divisor, #0x80000000
+	cmplo	\divisor, \dividend
+	movlo	\divisor, \divisor, lsl #1
+	movlo	\curbit, \curbit, lsl #1
+	blo	1b
+
+	mov	\result, #0
+
+#endif
+
+	@ Division loop
+1:	cmp	\dividend, \divisor
+	subhs	\dividend, \dividend, \divisor
+	orrhs	\result,   \result,   \curbit
+	cmp	\dividend, \divisor,  lsr #1
+	subhs	\dividend, \dividend, \divisor, lsr #1
+	orrhs	\result,   \result,   \curbit,  lsr #1
+	cmp	\dividend, \divisor,  lsr #2
+	subhs	\dividend, \dividend, \divisor, lsr #2
+	orrhs	\result,   \result,   \curbit,  lsr #2
+	cmp	\dividend, \divisor,  lsr #3
+	subhs	\dividend, \dividend, \divisor, lsr #3
+	orrhs	\result,   \result,   \curbit,  lsr #3
+	cmp	\dividend, #0			@ Early termination?
+	movnes	\curbit,   \curbit,  lsr #4	@ No, any more bits to do?
+	movne	\divisor,  \divisor, lsr #4
+	bne	1b
+
+.endm
+
+
+.macro ARM_DIV2_ORDER divisor, order
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	\order, \divisor
+	rsb	\order, \order, #31
+
+#else
+
+	cmp	\divisor, #(1 << 16)
+	movhs	\divisor, \divisor, lsr #16
+	movhs	\order, #16
+	movlo	\order, #0
+
+	cmp	\divisor, #(1 << 8)
+	movhs	\divisor, \divisor, lsr #8
+	addhs	\order, \order, #8
+
+	cmp	\divisor, #(1 << 4)
+	movhs	\divisor, \divisor, lsr #4
+	addhs	\order, \order, #4
+
+	cmp	\divisor, #(1 << 2)
+	addhi	\order, \order, #3
+	addls	\order, \order, \divisor, lsr #1
+
+#endif
+
+.endm
+
+
+.macro ARM_MOD_BODY dividend, divisor, order, spare
+
+#if __LINUX_ARM_ARCH__ >= 5
+
+	clz	\order, \divisor
+	clz	\spare, \dividend
+	sub	\order, \order, \spare
+	mov	\divisor, \divisor, lsl \order
+
+#else
+
+	mov	\order, #0
+
+	@ Unless the divisor is very big, shift it up in multiples of
+	@ four bits, since this is the amount of unwinding in the main
+	@ division loop.  Continue shifting until the divisor is 
+	@ larger than the dividend.
+1:	cmp	\divisor, #0x10000000
+	cmplo	\divisor, \dividend
+	movlo	\divisor, \divisor, lsl #4
+	addlo	\order, \order, #4
+	blo	1b
+
+	@ For very big divisors, we must shift it a bit at a time, or
+	@ we will be in danger of overflowing.
+1:	cmp	\divisor, #0x80000000
+	cmplo	\divisor, \dividend
+	movlo	\divisor, \divisor, lsl #1
+	addlo	\order, \order, #1
+	blo	1b
+
+#endif
+
+	@ Perform all needed substractions to keep only the reminder.
+	@ Do comparisons in batch of 4 first.
+	subs	\order, \order, #3		@ yes, 3 is intended here
+	blt	2f
+
+1:	cmp	\dividend, \divisor
+	subhs	\dividend, \dividend, \divisor
+	cmp	\dividend, \divisor,  lsr #1
+	subhs	\dividend, \dividend, \divisor, lsr #1
+	cmp	\dividend, \divisor,  lsr #2
+	subhs	\dividend, \dividend, \divisor, lsr #2
+	cmp	\dividend, \divisor,  lsr #3
+	subhs	\dividend, \dividend, \divisor, lsr #3
+	cmp	\dividend, #1
+	mov	\divisor, \divisor, lsr #4
+	subges	\order, \order, #4
+	bge	1b
+
+	tst	\order, #3
+	teqne	\dividend, #0
+	beq	5f
+
+	@ Either 1, 2 or 3 comparison/substractions are left.
+2:	cmn	\order, #2
+	blt	4f
+	beq	3f
+	cmp	\dividend, \divisor
+	subhs	\dividend, \dividend, \divisor
+	mov	\divisor,  \divisor,  lsr #1
+3:	cmp	\dividend, \divisor
+	subhs	\dividend, \dividend, \divisor
+	mov	\divisor,  \divisor,  lsr #1
+4:	cmp	\dividend, \divisor
+	subhs	\dividend, \dividend, \divisor
+5:
+.endm
+
+
+ENTRY(__udivsi3)
+ENTRY(__aeabi_uidiv)
+UNWIND(.fnstart)
+
+	subs	r2, r1, #1
+	moveq	pc, lr
+	bcc	Ldiv0
+	cmp	r0, r1
+	bls	11f
+	tst	r1, r2
+	beq	12f
+
+	ARM_DIV_BODY r0, r1, r2, r3
+
+	mov	r0, r2
+	mov	pc, lr
+
+11:	moveq	r0, #1
+	movne	r0, #0
+	mov	pc, lr
+
+12:	ARM_DIV2_ORDER r1, r2
+
+	mov	r0, r0, lsr r2
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__udivsi3)
+ENDPROC(__aeabi_uidiv)
+
+ENTRY(__umodsi3)
+UNWIND(.fnstart)
+
+	subs	r2, r1, #1			@ compare divisor with 1
+	bcc	Ldiv0
+	cmpne	r0, r1				@ compare dividend with divisor
+	moveq   r0, #0
+	tsthi	r1, r2				@ see if divisor is power of 2
+	andeq	r0, r0, r2
+	movls	pc, lr
+
+	ARM_MOD_BODY r0, r1, r2, r3
+
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__umodsi3)
+
+ENTRY(__divsi3)
+ENTRY(__aeabi_idiv)
+UNWIND(.fnstart)
+
+	cmp	r1, #0
+	eor	ip, r0, r1			@ save the sign of the result.
+	beq	Ldiv0
+	rsbmi	r1, r1, #0			@ loops below use unsigned.
+	subs	r2, r1, #1			@ division by 1 or -1 ?
+	beq	10f
+	movs	r3, r0
+	rsbmi	r3, r0, #0			@ positive dividend value
+	cmp	r3, r1
+	bls	11f
+	tst	r1, r2				@ divisor is power of 2 ?
+	beq	12f
+
+	ARM_DIV_BODY r3, r1, r0, r2
+
+	cmp	ip, #0
+	rsbmi	r0, r0, #0
+	mov	pc, lr
+
+10:	teq	ip, r0				@ same sign ?
+	rsbmi	r0, r0, #0
+	mov	pc, lr
+
+11:	movlo	r0, #0
+	moveq	r0, ip, asr #31
+	orreq	r0, r0, #1
+	mov	pc, lr
+
+12:	ARM_DIV2_ORDER r1, r2
+
+	cmp	ip, #0
+	mov	r0, r3, lsr r2
+	rsbmi	r0, r0, #0
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__divsi3)
+ENDPROC(__aeabi_idiv)
+
+ENTRY(__modsi3)
+UNWIND(.fnstart)
+
+	cmp	r1, #0
+	beq	Ldiv0
+	rsbmi	r1, r1, #0			@ loops below use unsigned.
+	movs	ip, r0				@ preserve sign of dividend
+	rsbmi	r0, r0, #0			@ if negative make positive
+	subs	r2, r1, #1			@ compare divisor with 1
+	cmpne	r0, r1				@ compare dividend with divisor
+	moveq	r0, #0
+	tsthi	r1, r2				@ see if divisor is power of 2
+	andeq	r0, r0, r2
+	bls	10f
+
+	ARM_MOD_BODY r0, r1, r2, r3
+
+10:	cmp	ip, #0
+	rsbmi	r0, r0, #0
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__modsi3)
+
+#ifdef CONFIG_AEABI
+
+ENTRY(__aeabi_uidivmod)
+UNWIND(.fnstart)
+UNWIND(.save {r0, r1, ip, lr}	)
+
+	stmfd	sp!, {r0, r1, ip, lr}
+	bl	__aeabi_uidiv
+	ldmfd	sp!, {r1, r2, ip, lr}
+	mul	r3, r0, r2
+	sub	r1, r1, r3
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__aeabi_uidivmod)
+
+ENTRY(__aeabi_idivmod)
+UNWIND(.fnstart)
+UNWIND(.save {r0, r1, ip, lr}	)
+	stmfd	sp!, {r0, r1, ip, lr}
+	bl	__aeabi_idiv
+	ldmfd	sp!, {r1, r2, ip, lr}
+	mul	r3, r0, r2
+	sub	r1, r1, r3
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__aeabi_idivmod)
+
+ENTRY(__aeabi_uldivmod)
+UNWIND(.fnstart)
+UNWIND(.save {lr}	)
+	sub sp, sp, #8
+	stmfd   sp!, {sp, lr}
+	bl __qdivrem
+	ldr lr, [sp, #4]
+	add sp, sp, #8
+	ldmfd sp!, {r2, r3}
+	mov	pc, lr
+
+UNWIND(.fnend)
+ENDPROC(__aeabi_uldivmod)
+
+ENTRY(__aeabi_ldivmod)
+UNWIND(.fnstart)
+UNWIND(.save {lr}	)
+	sub sp, sp, #16
+	stmfd   sp!, {sp, lr}
+	bl __ldivmod_helper
+	ldr lr, [sp, #4]
+	add sp, sp, #16
+	ldmfd	sp!, {r2, r3}
+	mov	pc, lr
+	
+UNWIND(.fnend)
+ENDPROC(__aeabi_ldivmod)
+#endif
+
+Ldiv0:
+UNWIND(.fnstart)
+UNWIND(.pad #4)
+UNWIND(.save {lr})
+	str	lr, [sp, #-8]!
+	bl	__div0
+	mov	r0, #0			@ About as wrong as it could be.
+	ldr	pc, [sp], #8
+UNWIND(.fnend)
+ENDPROC(Ldiv0)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/lshrdi3.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/lshrdi3.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,54 @@
+/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
+   Free Software Foundation, Inc.
+
+This file is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file.  (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+This file is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+
+#include <xen/config.h>
+#include "assembler.h"
+
+#ifdef __ARMEB__
+#define al r1
+#define ah r0
+#else
+#define al r0
+#define ah r1
+#endif
+
+ENTRY(__lshrdi3)
+ENTRY(__aeabi_llsr)
+
+	subs	r3, r2, #32
+	rsb	ip, r2, #32
+	movmi	al, al, lsr r2
+	movpl	al, ah, lsr r3
+ ARM(	orrmi	al, al, ah, lsl ip	)
+ THUMB(	lslmi	r3, ah, ip		)
+ THUMB(	orrmi	al, al, r3		)
+	mov	ah, ah, lsr r2
+	mov	pc, lr
+
+ENDPROC(__lshrdi3)
+ENDPROC(__aeabi_llsr)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/memcpy.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/memcpy.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,63 @@
+/*
+ *  linux/arch/arm/lib/memcpy.S
+ *
+ *  Author:	Nicolas Pitre
+ *  Created:	Sep 28, 2005
+ *  Copyright:	MontaVista Software, Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <xen/config.h>
+#include "assembler.h"
+
+#define LDR1W_SHIFT	0
+#define STR1W_SHIFT	0
+
+	.macro ldr1w ptr reg abort
+	W(ldr) \reg, [\ptr], #4
+	.endm
+
+	.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
+	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
+	.endm
+
+	.macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
+	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
+	.endm
+
+	.macro ldr1b ptr reg cond=al abort
+	ldr\cond\()b \reg, [\ptr], #1
+	.endm
+
+	.macro str1w ptr reg abort
+	W(str) \reg, [\ptr], #4
+	.endm
+
+	.macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
+	stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
+	.endm
+
+	.macro str1b ptr reg cond=al abort
+	str\cond\()b \reg, [\ptr], #1
+	.endm
+
+	.macro enter reg1 reg2
+	stmdb sp!, {r0, \reg1, \reg2}
+	.endm
+
+	.macro exit reg1 reg2
+	ldmfd sp!, {r0, \reg1, \reg2}
+	.endm
+
+	.text
+
+/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
+
+ENTRY(memcpy)
+
+#include "copy_template.S"
+
+ENDPROC(memcpy)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/memmove.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/memmove.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,200 @@
+/*
+ *  linux/arch/arm/lib/memmove.S
+ *
+ *  Author:	Nicolas Pitre
+ *  Created:	Sep 28, 2005
+ *  Copyright:	(C) MontaVista Software Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <xen/config.h>
+
+#include "assembler.h"
+
+		.text
+
+/*
+ * Prototype: void *memmove(void *dest, const void *src, size_t n);
+ *
+ * Note:
+ *
+ * If the memory regions don't overlap, we simply branch to memcpy which is
+ * normally a bit faster. Otherwise the copy is done going downwards.  This
+ * is a transposition of the code from copy_template.S but with the copy
+ * occurring in the opposite direction.
+ */
+
+ENTRY(memmove)
+
+		subs	ip, r0, r1
+		cmphi	r2, ip
+		bls	memcpy
+
+		stmfd	sp!, {r0, r4, lr}
+		add	r1, r1, r2
+		add	r0, r0, r2
+		subs	r2, r2, #4
+		blt	8f
+		ands	ip, r0, #3
+	PLD(	pld	[r1, #-4]		)
+		bne	9f
+		ands	ip, r1, #3
+		bne	10f
+
+1:		subs	r2, r2, #(28)
+		stmfd	sp!, {r5 - r8}
+		blt	5f
+
+	CALGN(	ands	ip, r0, #31		)
+	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
+	CALGN(	bcs	2f			)
+	CALGN(	adr	r4, 6f			)
+	CALGN(	subs	r2, r2, ip		)  @ C is set here
+	CALGN(	rsb	ip, ip, #32		)
+	CALGN(	add	pc, r4, ip		)
+
+	PLD(	pld	[r1, #-4]		)
+2:	PLD(	subs	r2, r2, #96		)
+	PLD(	pld	[r1, #-32]		)
+	PLD(	blt	4f			)
+	PLD(	pld	[r1, #-64]		)
+	PLD(	pld	[r1, #-96]		)
+
+3:	PLD(	pld	[r1, #-128]		)
+4:		ldmdb	r1!, {r3, r4, r5, r6, r7, r8, ip, lr}
+		subs	r2, r2, #32
+		stmdb	r0!, {r3, r4, r5, r6, r7, r8, ip, lr}
+		bge	3b
+	PLD(	cmn	r2, #96			)
+	PLD(	bge	4b			)
+
+5:		ands	ip, r2, #28
+		rsb	ip, ip, #32
+		addne	pc, pc, ip		@ C is always clear here
+		b	7f
+6:		W(nop)
+		W(ldr)	r3, [r1, #-4]!
+		W(ldr)	r4, [r1, #-4]!
+		W(ldr)	r5, [r1, #-4]!
+		W(ldr)	r6, [r1, #-4]!
+		W(ldr)	r7, [r1, #-4]!
+		W(ldr)	r8, [r1, #-4]!
+		W(ldr)	lr, [r1, #-4]!
+
+		add	pc, pc, ip
+		nop
+		W(nop)
+		W(str)	r3, [r0, #-4]!
+		W(str)	r4, [r0, #-4]!
+		W(str)	r5, [r0, #-4]!
+		W(str)	r6, [r0, #-4]!
+		W(str)	r7, [r0, #-4]!
+		W(str)	r8, [r0, #-4]!
+		W(str)	lr, [r0, #-4]!
+
+	CALGN(	bcs	2b			)
+
+7:		ldmfd	sp!, {r5 - r8}
+
+8:		movs	r2, r2, lsl #31
+		ldrneb	r3, [r1, #-1]!
+		ldrcsb	r4, [r1, #-1]!
+		ldrcsb	ip, [r1, #-1]
+		strneb	r3, [r0, #-1]!
+		strcsb	r4, [r0, #-1]!
+		strcsb	ip, [r0, #-1]
+		ldmfd	sp!, {r0, r4, pc}
+
+9:		cmp	ip, #2
+		ldrgtb	r3, [r1, #-1]!
+		ldrgeb	r4, [r1, #-1]!
+		ldrb	lr, [r1, #-1]!
+		strgtb	r3, [r0, #-1]!
+		strgeb	r4, [r0, #-1]!
+		subs	r2, r2, ip
+		strb	lr, [r0, #-1]!
+		blt	8b
+		ands	ip, r1, #3
+		beq	1b
+
+10:		bic	r1, r1, #3
+		cmp	ip, #2
+		ldr	r3, [r1, #0]
+		beq	17f
+		blt	18f
+
+
+		.macro	backward_copy_shift push pull
+
+		subs	r2, r2, #28
+		blt	14f
+
+	CALGN(	ands	ip, r0, #31		)
+	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
+	CALGN(	subcc	r2, r2, ip		)
+	CALGN(	bcc	15f			)
+
+11:		stmfd	sp!, {r5 - r9}
+
+	PLD(	pld	[r1, #-4]		)
+	PLD(	subs	r2, r2, #96		)
+	PLD(	pld	[r1, #-32]		)
+	PLD(	blt	13f			)
+	PLD(	pld	[r1, #-64]		)
+	PLD(	pld	[r1, #-96]		)
+
+12:	PLD(	pld	[r1, #-128]		)
+13:		ldmdb   r1!, {r7, r8, r9, ip}
+		mov     lr, r3, push #\push
+		subs    r2, r2, #32
+		ldmdb   r1!, {r3, r4, r5, r6}
+		orr     lr, lr, ip, pull #\pull
+		mov     ip, ip, push #\push
+		orr     ip, ip, r9, pull #\pull
+		mov     r9, r9, push #\push
+		orr     r9, r9, r8, pull #\pull
+		mov     r8, r8, push #\push
+		orr     r8, r8, r7, pull #\pull
+		mov     r7, r7, push #\push
+		orr     r7, r7, r6, pull #\pull
+		mov     r6, r6, push #\push
+		orr     r6, r6, r5, pull #\pull
+		mov     r5, r5, push #\push
+		orr     r5, r5, r4, pull #\pull
+		mov     r4, r4, push #\push
+		orr     r4, r4, r3, pull #\pull
+		stmdb   r0!, {r4 - r9, ip, lr}
+		bge	12b
+	PLD(	cmn	r2, #96			)
+	PLD(	bge	13b			)
+
+		ldmfd	sp!, {r5 - r9}
+
+14:		ands	ip, r2, #28
+		beq	16f
+
+15:		mov     lr, r3, push #\push
+		ldr	r3, [r1, #-4]!
+		subs	ip, ip, #4
+		orr	lr, lr, r3, pull #\pull
+		str	lr, [r0, #-4]!
+		bgt	15b
+	CALGN(	cmp	r2, #0			)
+	CALGN(	bge	11b			)
+
+16:		add	r1, r1, #(\pull / 8)
+		b	8b
+
+		.endm
+
+
+		backward_copy_shift	push=8	pull=24
+
+17:		backward_copy_shift	push=16	pull=16
+
+18:		backward_copy_shift	push=24	pull=8
+
+ENDPROC(memmove)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/memset.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/memset.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,129 @@
+/*
+ *  linux/arch/arm/lib/memset.S
+ *
+ *  Copyright (C) 1995-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  ASM optimised string functions
+ */
+
+#include <xen/config.h>
+
+#include "assembler.h"
+
+	.text
+	.align	5
+	.word	0
+
+1:	subs	r2, r2, #4		@ 1 do we have enough
+	blt	5f			@ 1 bytes to align with?
+	cmp	r3, #2			@ 1
+	strltb	r1, [r0], #1		@ 1
+	strleb	r1, [r0], #1		@ 1
+	strb	r1, [r0], #1		@ 1
+	add	r2, r2, r3		@ 1 (r2 = r2 - (4 - r3))
+/*
+ * The pointer is now aligned and the length is adjusted.  Try doing the
+ * memset again.
+ */
+
+ENTRY(memset)
+	ands	r3, r0, #3		@ 1 unaligned?
+	bne	1b			@ 1
+/*
+ * we know that the pointer in r0 is aligned to a word boundary.
+ */
+	orr	r1, r1, r1, lsl #8
+	orr	r1, r1, r1, lsl #16
+	mov	r3, r1
+	cmp	r2, #16
+	blt	4f
+
+#if ! CALGN(1)+0
+
+/*
+ * We need an extra register for this loop - save the return address and
+ * use the LR
+ */
+	str	lr, [sp, #-4]!
+	mov	ip, r1
+	mov	lr, r1
+
+2:	subs	r2, r2, #64
+	stmgeia	r0!, {r1, r3, ip, lr}	@ 64 bytes at a time.
+	stmgeia	r0!, {r1, r3, ip, lr}
+	stmgeia	r0!, {r1, r3, ip, lr}
+	stmgeia	r0!, {r1, r3, ip, lr}
+	bgt	2b
+	ldmeqfd	sp!, {pc}		@ Now <64 bytes to go.
+/*
+ * No need to correct the count; we're only testing bits from now on
+ */
+	tst	r2, #32
+	stmneia	r0!, {r1, r3, ip, lr}
+	stmneia	r0!, {r1, r3, ip, lr}
+	tst	r2, #16
+	stmneia	r0!, {r1, r3, ip, lr}
+	ldr	lr, [sp], #4
+
+#else
+
+/*
+ * This version aligns the destination pointer in order to write
+ * whole cache lines at once.
+ */
+
+	stmfd	sp!, {r4-r7, lr}
+	mov	r4, r1
+	mov	r5, r1
+	mov	r6, r1
+	mov	r7, r1
+	mov	ip, r1
+	mov	lr, r1
+
+	cmp	r2, #96
+	tstgt	r0, #31
+	ble	3f
+
+	and	ip, r0, #31
+	rsb	ip, ip, #32
+	sub	r2, r2, ip
+	movs	ip, ip, lsl #(32 - 4)
+	stmcsia	r0!, {r4, r5, r6, r7}
+	stmmiia	r0!, {r4, r5}
+	tst	ip, #(1 << 30)
+	mov	ip, r1
+	strne	r1, [r0], #4
+
+3:	subs	r2, r2, #64
+	stmgeia	r0!, {r1, r3-r7, ip, lr}
+	stmgeia	r0!, {r1, r3-r7, ip, lr}
+	bgt	3b
+	ldmeqfd	sp!, {r4-r7, pc}
+
+	tst	r2, #32
+	stmneia	r0!, {r1, r3-r7, ip, lr}
+	tst	r2, #16
+	stmneia	r0!, {r4-r7}
+	ldmfd	sp!, {r4-r7, lr}
+
+#endif
+
+4:	tst	r2, #8
+	stmneia	r0!, {r1, r3}
+	tst	r2, #4
+	strne	r1, [r0], #4
+/*
+ * When we get here, we've got less than 4 bytes to zero.  We
+ * may have an unaligned pointer as well.
+ */
+5:	tst	r2, #2
+	strneb	r1, [r0], #1
+	strneb	r1, [r0], #1
+	tst	r2, #1
+	strneb	r1, [r0], #1
+	mov	pc, lr
+ENDPROC(memset)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/memzero.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/memzero.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,127 @@
+/*
+ *  linux/arch/arm/lib/memzero.S
+ *
+ *  Copyright (C) 1995-2000 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <xen/config.h>
+
+#include "assembler.h"
+
+	.text
+	.align	5
+	.word	0
+/*
+ * Align the pointer in r0.  r3 contains the number of bytes that we are
+ * mis-aligned by, and r1 is the number of bytes.  If r1 < 4, then we
+ * don't bother; we use byte stores instead.
+ */
+1:	subs	r1, r1, #4		@ 1 do we have enough
+	blt	5f			@ 1 bytes to align with?
+	cmp	r3, #2			@ 1
+	strltb	r2, [r0], #1		@ 1
+	strleb	r2, [r0], #1		@ 1
+	strb	r2, [r0], #1		@ 1
+	add	r1, r1, r3		@ 1 (r1 = r1 - (4 - r3))
+/*
+ * The pointer is now aligned and the length is adjusted.  Try doing the
+ * memzero again.
+ */
+
+ENTRY(__memzero)
+	mov	r2, #0			@ 1
+	ands	r3, r0, #3		@ 1 unaligned?
+	bne	1b			@ 1
+/*
+ * r3 = 0, and we know that the pointer in r0 is aligned to a word boundary.
+ */
+	cmp	r1, #16			@ 1 we can skip this chunk if we
+	blt	4f			@ 1 have < 16 bytes
+
+#if ! CALGN(1)+0
+
+/*
+ * We need an extra register for this loop - save the return address and
+ * use the LR
+ */
+	str	lr, [sp, #-4]!		@ 1
+	mov	ip, r2			@ 1
+	mov	lr, r2			@ 1
+
+3:	subs	r1, r1, #64		@ 1 write 32 bytes out per loop
+	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
+	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
+	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
+	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
+	bgt	3b			@ 1
+	ldmeqfd	sp!, {pc}		@ 1/2 quick exit
+/*
+ * No need to correct the count; we're only testing bits from now on
+ */
+	tst	r1, #32			@ 1
+	stmneia	r0!, {r2, r3, ip, lr}	@ 4
+	stmneia	r0!, {r2, r3, ip, lr}	@ 4
+	tst	r1, #16			@ 1 16 bytes or more?
+	stmneia	r0!, {r2, r3, ip, lr}	@ 4
+	ldr	lr, [sp], #4		@ 1
+
+#else
+
+/*
+ * This version aligns the destination pointer in order to write
+ * whole cache lines at once.
+ */
+
+	stmfd	sp!, {r4-r7, lr}
+	mov	r4, r2
+	mov	r5, r2
+	mov	r6, r2
+	mov	r7, r2
+	mov	ip, r2
+	mov	lr, r2
+
+	cmp	r1, #96
+	andgts	ip, r0, #31
+	ble	3f
+
+	rsb	ip, ip, #32
+	sub	r1, r1, ip
+	movs	ip, ip, lsl #(32 - 4)
+	stmcsia	r0!, {r4, r5, r6, r7}
+	stmmiia	r0!, {r4, r5}
+	movs	ip, ip, lsl #2
+	strcs	r2, [r0], #4
+
+3:	subs	r1, r1, #64
+	stmgeia	r0!, {r2-r7, ip, lr}
+	stmgeia	r0!, {r2-r7, ip, lr}
+	bgt	3b
+	ldmeqfd	sp!, {r4-r7, pc}
+
+	tst	r1, #32
+	stmneia	r0!, {r2-r7, ip, lr}
+	tst	r1, #16
+	stmneia	r0!, {r4-r7}
+	ldmfd	sp!, {r4-r7, lr}
+
+#endif
+
+4:	tst	r1, #8			@ 1 8 bytes or more?
+	stmneia	r0!, {r2, r3}		@ 2
+	tst	r1, #4			@ 1 4 bytes or more?
+	strne	r2, [r0], #4		@ 1
+/*
+ * When we get here, we've got less than 4 bytes to zero.  We
+ * may have an unaligned pointer as well.
+ */
+5:	tst	r1, #2			@ 1 2 bytes or more?
+	strneb	r2, [r0], #1		@ 1
+	strneb	r2, [r0], #1		@ 1
+	tst	r1, #1			@ 1 a byte left over
+	strneb	r2, [r0], #1		@ 1
+	mov	pc, lr			@ 1
+ENDPROC(__memzero)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/setbit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/setbit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/arm/lib/setbit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+	.text
+
+ENTRY(_set_bit)
+	bitop	orr
+ENDPROC(_set_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/testchangebit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/testchangebit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/arm/lib/testchangebit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+                .text
+
+ENTRY(_test_and_change_bit)
+	testop	eor, str
+ENDPROC(_test_and_change_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/testclearbit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/testclearbit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/arm/lib/testclearbit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+                .text
+
+ENTRY(_test_and_clear_bit)
+	testop	bicne, strne
+ENDPROC(_test_and_clear_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/lib/testsetbit.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/lib/testsetbit.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,18 @@
+/*
+ *  linux/arch/arm/lib/testsetbit.S
+ *
+ *  Copyright (C) 1995-1996 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <xen/config.h>
+
+#include "assembler.h"
+#include "bitops.h"
+                .text
+
+ENTRY(_test_and_set_bit)
+	testop	orreq, streq
+ENDPROC(_test_and_set_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/mode_switch.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/mode_switch.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,121 @@
+/*
+ * xen/arch/arm/mode_switch.S
+ *
+ * Start-of day code to take a CPU from Secure mode to Hyp mode.
+ *
+ * Tim Deegan <tim@xen.org>
+ * Copyright (c) 2011-2012 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/config.h>
+#include <asm/page.h>
+#include <asm/platform_vexpress.h>
+#include <asm/asm_defns.h>
+#include <asm/gic.h>
+
+
+/* XXX: Versatile Express specific code */
+/* wake up secondary cpus */
+.globl kick_cpus
+kick_cpus:
+        /* write start paddr to v2m sysreg FLAGSSET register */
+        ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
+        dsb
+        mov   r2, #0xffffffff
+        str   r2, [r0, #(V2M_SYS_FLAGSCLR)]
+        dsb
+        ldr   r2, =start
+        add   r2, r2, r10
+        str   r2, [r0, #(V2M_SYS_FLAGSSET)]
+        dsb
+        /* send an interrupt */
+        ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
+        mov   r2, #0x1
+        str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
+        mov   r2, #0xfe0000
+        str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
+        dsb
+        str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
+        mov   pc, lr
+
+
+/* Get up a CPU into Hyp mode.  Clobbers r0-r3.
+ *
+ * Expects r12 == CPU number
+ *
+ * This code is specific to the VE model, and not intended to be used
+ * on production systems.  As such it's a bit hackier than the main
+ * boot code in head.S.  In future it will be replaced by better
+ * integration with the bootloader/firmware so that Xen always starts
+ * in Hyp mode. */
+
+.globl enter_hyp_mode
+enter_hyp_mode:
+        mov   r3, lr                 /* Put return address in non-banked reg */
+        cpsid aif, #0x16             /* Enter Monitor mode */
+        mrc   CP32(r0, SCR)
+        orr   r0, r0, #0x100         /* Set HCE */
+        orr   r0, r0, #0xb1          /* Set SCD, AW, FW and NS */
+        bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
+        mcr   CP32(r0, SCR)
+        /* Ugly: the system timer's frequency register is only
+         * programmable in Secure state.  Since we don't know where its
+         * memory-mapped control registers live, we can't find out the
+         * right frequency.  Use the VE model's default frequency here. */
+        ldr   r0, =0x5f5e100         /* 100 MHz */
+        mcr   CP32(r0, CNTFRQ)
+        ldr   r0, =0x40c00           /* SMP, c11, c10 in non-secure mode */
+        mcr   CP32(r0, NSACR)
+        mov   r0, #GIC_BASE_ADDRESS
+        add   r0, r0, #GIC_DR_OFFSET
+        /* Disable the GIC distributor, on the boot CPU only */
+        mov   r1, #0
+        teq   r12, #0                /* Is this the boot CPU? */
+        streq r1, [r0]
+        /* Continuing ugliness: Set up the GIC so NS state owns interrupts,
+         * The first 32 interrupts (SGIs & PPIs) must be configured on all
+         * CPUs while the remainder are SPIs and only need to be done one, on
+         * the boot CPU. */
+        add   r0, r0, #0x80          /* GICD_IGROUP0 */
+        mov   r2, #0xffffffff        /* All interrupts to group 1 */
+        teq   r12, #0                /* Boot CPU? */
+        str   r2, [r0]               /* Interrupts  0-31 (SGI & PPI) */
+        streq r2, [r0, #4]           /* Interrupts 32-63 (SPI) */
+        streq r2, [r0, #8]           /* Interrupts 64-95 (SPI) */
+        /* Disable the GIC CPU interface on all processors */
+        mov   r0, #GIC_BASE_ADDRESS
+        add   r0, r0, #GIC_CR_OFFSET
+        mov   r1, #0
+        str   r1, [r0]
+        /* Must drop priority mask below 0x80 before entering NS state */
+        ldr   r1, =0xff
+        str   r1, [r0, #0x4]         /* -> GICC_PMR */
+        /* Reset a few config registers */
+        mov   r0, #0
+        mcr   CP32(r0, FCSEIDR)
+        mcr   CP32(r0, CONTEXTIDR)
+        /* Allow non-secure access to coprocessors, FIQs, VFP and NEON */
+        ldr   r1, =0x3fff            /* 14 CP bits set, all others clear */
+        mcr   CP32(r1, NSACR)
+
+        mrs   r0, cpsr               /* Copy the CPSR */
+        add   r0, r0, #0x4           /* 0x16 (Monitor) -> 0x1a (Hyp) */
+        msr   spsr_cxsf, r0          /* into the SPSR */
+        movs  pc, r3                 /* Exception-return into Hyp mode */
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/arm32/proc-ca15.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/arm32/proc-ca15.S	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,35 @@
+/*
+ * xen/arch/arm/proc-ca15.S
+ *
+ * Cortex A15 specific initializations
+ *
+ * Copyright (c) 2011 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/asm_defns.h>
+#include <asm/processor-ca15.h>
+
+.globl cortex_a15_init
+cortex_a15_init:
+        /* Set up the SMP bit in ACTLR */
+        mrc   CP32(r0, ACTLR)
+        orr   r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit */
+        mcr   CP32(r0, ACTLR)
+        mov   pc, lr
+
+/*
+ * Local variables:
+ * mode: ASM
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/asm-offsets.c
--- a/xen/arch/arm/asm-offsets.c	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Generate definitions needed by assembly language modules.
- * This code generates raw asm output which is post-processed
- * to extract and format the required data.
- */
-#define COMPILE_OFFSETS
-
-#include <xen/config.h>
-#include <xen/types.h>
-#include <xen/sched.h>
-#include <public/xen.h>
-#include <asm/current.h>
-
-#define DEFINE(_sym, _val) \
-    __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
-#define BLANK() \
-    __asm__ __volatile__ ( "\n->" : : )
-#define OFFSET(_sym, _str, _mem) \
-    DEFINE(_sym, offsetof(_str, _mem));
-
-/* base-2 logarithm */
-#define __L2(_x)  (((_x) & 0x00000002) ?   1 : 0)
-#define __L4(_x)  (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
-#define __L8(_x)  (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
-#define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
-#define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
-
-void __dummy__(void)
-{
-   OFFSET(UREGS_sp, struct cpu_user_regs, sp);
-   OFFSET(UREGS_lr, struct cpu_user_regs, lr);
-   OFFSET(UREGS_pc, struct cpu_user_regs, pc);
-   OFFSET(UREGS_cpsr, struct cpu_user_regs, cpsr);
-
-   OFFSET(UREGS_LR_usr, struct cpu_user_regs, lr_usr);
-   OFFSET(UREGS_SP_usr, struct cpu_user_regs, sp_usr);
-
-   OFFSET(UREGS_SP_svc, struct cpu_user_regs, sp_svc);
-   OFFSET(UREGS_LR_svc, struct cpu_user_regs, lr_svc);
-   OFFSET(UREGS_SPSR_svc, struct cpu_user_regs, spsr_svc);
-
-   OFFSET(UREGS_SP_abt, struct cpu_user_regs, sp_abt);
-   OFFSET(UREGS_LR_abt, struct cpu_user_regs, lr_abt);
-   OFFSET(UREGS_SPSR_abt, struct cpu_user_regs, spsr_abt);
-
-   OFFSET(UREGS_SP_und, struct cpu_user_regs, sp_und);
-   OFFSET(UREGS_LR_und, struct cpu_user_regs, lr_und);
-   OFFSET(UREGS_SPSR_und, struct cpu_user_regs, spsr_und);
-
-   OFFSET(UREGS_SP_irq, struct cpu_user_regs, sp_irq);
-   OFFSET(UREGS_LR_irq, struct cpu_user_regs, lr_irq);
-   OFFSET(UREGS_SPSR_irq, struct cpu_user_regs, spsr_irq);
-
-   OFFSET(UREGS_SP_fiq, struct cpu_user_regs, sp_fiq);
-   OFFSET(UREGS_LR_fiq, struct cpu_user_regs, lr_fiq);
-   OFFSET(UREGS_SPSR_fiq, struct cpu_user_regs, spsr_fiq);
-
-   OFFSET(UREGS_R8_fiq, struct cpu_user_regs, r8_fiq);
-   OFFSET(UREGS_R9_fiq, struct cpu_user_regs, r9_fiq);
-   OFFSET(UREGS_R10_fiq, struct cpu_user_regs, r10_fiq);
-   OFFSET(UREGS_R11_fiq, struct cpu_user_regs, r11_fiq);
-   OFFSET(UREGS_R12_fiq, struct cpu_user_regs, r12_fiq);
-
-   OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, cpsr);
-   DEFINE(UREGS_user_sizeof, sizeof(struct cpu_user_regs));
-   BLANK();
-
-   DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
-
-   OFFSET(VCPU_arch_saved_context, struct vcpu, arch.saved_context);
-}
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/domain.c	Wed Dec 19 14:16:30 2012 +0000
@@ -12,7 +12,7 @@
 #include <asm/p2m.h>
 #include <asm/irq.h>
 
-#include "gic.h"
+#include <asm/gic.h>
 #include "vtimer.h"
 #include "vpl011.h"
 
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/domain_build.c
--- a/xen/arch/arm/domain_build.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/domain_build.c	Wed Dec 19 14:16:30 2012 +0000
@@ -11,7 +11,7 @@
 #include <xen/libfdt/libfdt.h>
 #include <xen/guest_access.h>
 
-#include "gic.h"
+#include <asm/gic.h>
 #include "kernel.h"
 
 static unsigned int __initdata opt_dom0_max_vcpus;
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-#include <xen/config.h>
-#include <asm/asm_defns.h>
-#include <public/xen.h>
-
-#define SAVE_ONE_BANKED(reg)    mrs r11, reg; str r11, [sp, #UREGS_##reg]
-#define RESTORE_ONE_BANKED(reg) ldr r11, [sp, #UREGS_##reg]; msr reg, r11
-
-#define SAVE_BANKED(mode) \
-        SAVE_ONE_BANKED(SP_##mode) ; SAVE_ONE_BANKED(LR_##mode) ; SAVE_ONE_BANKED(SPSR_##mode)
-
-#define RESTORE_BANKED(mode) \
-        RESTORE_ONE_BANKED(SP_##mode) ; RESTORE_ONE_BANKED(LR_##mode) ; RESTORE_ONE_BANKED(SPSR_##mode)
-
-#define SAVE_ALL                                                        \
-        sub sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */      \
-        push {r0-r12}; /* Save R0-R12 */                                \
-                                                                        \
-        mrs r11, ELR_hyp;               /* ELR_hyp is return address. */\
-        str r11, [sp, #UREGS_pc];                                       \
-                                                                        \
-        str lr, [sp, #UREGS_lr];                                        \
-                                                                        \
-        add r11, sp, #UREGS_kernel_sizeof+4;                            \
-        str r11, [sp, #UREGS_sp];                                       \
-                                                                        \
-        mrs r11, SPSR_hyp;                                              \
-        str r11, [sp, #UREGS_cpsr];                                     \
-        and r11, #PSR_MODE_MASK;                                        \
-        cmp r11, #PSR_MODE_HYP;                                         \
-        blne save_guest_regs
-
-save_guest_regs:
-        ldr r11, =0xffffffff  /* Clobber SP which is only valid for hypervisor frames. */
-        str r11, [sp, #UREGS_sp]
-        SAVE_ONE_BANKED(SP_usr)
-        /* LR_usr is the same physical register as lr and is saved in SAVE_ALL */
-        SAVE_BANKED(svc)
-        SAVE_BANKED(abt)
-        SAVE_BANKED(und)
-        SAVE_BANKED(irq)
-        SAVE_BANKED(fiq)
-        SAVE_ONE_BANKED(R8_fiq); SAVE_ONE_BANKED(R9_fiq); SAVE_ONE_BANKED(R10_fiq)
-        SAVE_ONE_BANKED(R11_fiq); SAVE_ONE_BANKED(R12_fiq);
-        mov pc, lr
-
-#define DEFINE_TRAP_ENTRY(trap)                                         \
-        ALIGN;                                                          \
-trap_##trap:                                                            \
-        SAVE_ALL;                                                       \
-        cpsie i;        /* local_irq_enable */                          \
-        adr lr, return_from_trap;                                       \
-        mov r0, sp;                                                     \
-        mov r11, sp;                                                    \
-        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
-        b do_trap_##trap
-
-#define DEFINE_TRAP_ENTRY_NOIRQ(trap)                                   \
-        ALIGN;                                                          \
-trap_##trap:                                                            \
-        SAVE_ALL;                                                       \
-        adr lr, return_from_trap;                                       \
-        mov r0, sp;                                                     \
-        mov r11, sp;                                                    \
-        bic sp, #7; /* Align the stack pointer (noop on guest trap) */  \
-        b do_trap_##trap
-
-.globl hyp_traps_vector
-        .align 5
-hyp_traps_vector:
-        .word 0                         /* 0x00 - Reset */
-        b trap_undefined_instruction    /* 0x04 - Undefined Instruction */
-        b trap_supervisor_call          /* 0x08 - Supervisor Call */
-        b trap_prefetch_abort           /* 0x0c - Prefetch Abort */
-        b trap_data_abort               /* 0x10 - Data Abort */
-        b trap_hypervisor               /* 0x14 - Hypervisor */
-        b trap_irq                      /* 0x18 - IRQ */
-        b trap_fiq                      /* 0x1c - FIQ */
-
-DEFINE_TRAP_ENTRY(undefined_instruction)
-DEFINE_TRAP_ENTRY(supervisor_call)
-DEFINE_TRAP_ENTRY(prefetch_abort)
-DEFINE_TRAP_ENTRY(data_abort)
-DEFINE_TRAP_ENTRY(hypervisor)
-DEFINE_TRAP_ENTRY_NOIRQ(irq)
-DEFINE_TRAP_ENTRY_NOIRQ(fiq)
-
-return_from_trap:
-        mov sp, r11
-ENTRY(return_to_new_vcpu)
-        ldr r11, [sp, #UREGS_cpsr]
-        and r11, #PSR_MODE_MASK
-        cmp r11, #PSR_MODE_HYP
-        beq return_to_hypervisor
-        /* Fall thru */
-ENTRY(return_to_guest)
-        mov r11, sp
-        bic sp, #7 /* Align the stack pointer */
-        bl leave_hypervisor_tail /* Disables interrupts on return */
-        mov sp, r11
-        RESTORE_ONE_BANKED(SP_usr)
-        /* LR_usr is the same physical register as lr and is restored below */
-        RESTORE_BANKED(svc)
-        RESTORE_BANKED(abt)
-        RESTORE_BANKED(und)
-        RESTORE_BANKED(irq)
-        RESTORE_BANKED(fiq)
-        RESTORE_ONE_BANKED(R8_fiq); RESTORE_ONE_BANKED(R9_fiq); RESTORE_ONE_BANKED(R10_fiq)
-        RESTORE_ONE_BANKED(R11_fiq); RESTORE_ONE_BANKED(R12_fiq);
-        /* Fall thru */
-ENTRY(return_to_hypervisor)
-        cpsid i
-        ldr lr, [sp, #UREGS_lr]
-        ldr r11, [sp, #UREGS_pc]
-        msr ELR_hyp, r11
-        ldr r11, [sp, #UREGS_cpsr]
-        msr SPSR_hyp, r11
-        pop {r0-r12}
-        add sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */
-        eret
-
-/*
- * struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next)
- *
- * r0 - prev
- * r1 - next
- *
- * Returns prev in r0
- */
-ENTRY(__context_switch)
-        add     ip, r0, #VCPU_arch_saved_context
-        stmia   ip!, {r4 - sl, fp, sp, lr}      /* Save register state */
-
-        add     r4, r1, #VCPU_arch_saved_context
-        ldmia   r4, {r4 - sl, fp, sp, pc}       /* Load registers and return */
-
-/*
- * Local variables:
- * mode: ASM
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/gic.c	Wed Dec 19 14:16:30 2012 +0000
@@ -30,7 +30,7 @@
 #include <asm/p2m.h>
 #include <asm/domain.h>
 
-#include "gic.h"
+#include <asm/gic.h>
 
 /* Access to the GIC Distributor registers through the fixmap */
 #define GICD ((volatile uint32_t *) FIXMAP_ADDR(FIXMAP_GICD))
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
- * xen/arch/arm/gic.h
- *
- * ARM Generic Interrupt Controller support
- *
- * Tim Deegan <tim@xen.org>
- * Copyright (c) 2011 Citrix Systems.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ARCH_ARM_GIC_H__
-#define __ARCH_ARM_GIC_H__
-
-#define GICD_CTLR       (0x000/4)
-#define GICD_TYPER      (0x004/4)
-#define GICD_IIDR       (0x008/4)
-#define GICD_IGROUPR    (0x080/4)
-#define GICD_IGROUPRN   (0x0FC/4)
-#define GICD_ISENABLER  (0x100/4)
-#define GICD_ISENABLERN (0x17C/4)
-#define GICD_ICENABLER  (0x180/4)
-#define GICD_ICENABLERN (0x1fC/4)
-#define GICD_ISPENDR    (0x200/4)
-#define GICD_ISPENDRN   (0x27C/4)
-#define GICD_ICPENDR    (0x280/4)
-#define GICD_ICPENDRN   (0x2FC/4)
-#define GICD_ISACTIVER  (0x300/4)
-#define GICD_ISACTIVERN (0x37C/4)
-#define GICD_ICACTIVER  (0x380/4)
-#define GICD_ICACTIVERN (0x3FC/4)
-#define GICD_IPRIORITYR (0x400/4)
-#define GICD_IPRIORITYRN (0x7F8/4)
-#define GICD_ITARGETSR  (0x800/4)
-#define GICD_ITARGETSRN (0xBF8/4)
-#define GICD_ICFGR      (0xC00/4)
-#define GICD_ICFGRN     (0xCFC/4)
-#define GICD_NSACR      (0xE00/4)
-#define GICD_NSACRN     (0xEFC/4)
-#define GICD_ICPIDR2    (0xFE8/4)
-#define GICD_SGIR       (0xF00/4)
-#define GICD_CPENDSGIR  (0xF10/4)
-#define GICD_CPENDSGIRN (0xF1C/4)
-#define GICD_SPENDSGIR  (0xF20/4)
-#define GICD_SPENDSGIRN (0xF2C/4)
-#define GICD_ICPIDR2    (0xFE8/4)
-
-#define GICC_CTLR       (0x0000/4)
-#define GICC_PMR        (0x0004/4)
-#define GICC_BPR        (0x0008/4)
-#define GICC_IAR        (0x000C/4)
-#define GICC_EOIR       (0x0010/4)
-#define GICC_RPR        (0x0014/4)
-#define GICC_HPPIR      (0x0018/4)
-#define GICC_APR        (0x00D0/4)
-#define GICC_NSAPR      (0x00E0/4)
-#define GICC_DIR        (0x1000/4)
-
-#define GICH_HCR        (0x00/4)
-#define GICH_VTR        (0x04/4)
-#define GICH_VMCR       (0x08/4)
-#define GICH_MISR       (0x10/4)
-#define GICH_EISR0      (0x20/4)
-#define GICH_EISR1      (0x24/4)
-#define GICH_ELSR0      (0x30/4)
-#define GICH_ELSR1      (0x34/4)
-#define GICH_APR        (0xF0/4)
-#define GICH_LR         (0x100/4)
-
-/* Register bits */
-#define GICD_CTL_ENABLE 0x1
-
-#define GICD_TYPE_LINES 0x01f
-#define GICD_TYPE_CPUS  0x0e0
-#define GICD_TYPE_SEC   0x400
-
-#define GICC_CTL_ENABLE 0x1
-#define GICC_CTL_EOI    (0x1 << 9)
-
-#define GICC_IA_IRQ     0x03ff
-#define GICC_IA_CPU     0x1c00
-
-#define GICH_HCR_EN       (1 << 0)
-#define GICH_HCR_UIE      (1 << 1)
-#define GICH_HCR_LRENPIE  (1 << 2)
-#define GICH_HCR_NPIE     (1 << 3)
-#define GICH_HCR_VGRP0EIE (1 << 4)
-#define GICH_HCR_VGRP0DIE (1 << 5)
-#define GICH_HCR_VGRP1EIE (1 << 6)
-#define GICH_HCR_VGRP1DIE (1 << 7)
-
-#define GICH_MISR_EOI     (1 << 0)
-#define GICH_MISR_U       (1 << 1)
-#define GICH_MISR_LRENP   (1 << 2)
-#define GICH_MISR_NP      (1 << 3)
-#define GICH_MISR_VGRP0E  (1 << 4)
-#define GICH_MISR_VGRP0D  (1 << 5)
-#define GICH_MISR_VGRP1E  (1 << 6)
-#define GICH_MISR_VGRP1D  (1 << 7)
-
-#define GICH_LR_VIRTUAL_MASK    0x3ff
-#define GICH_LR_VIRTUAL_SHIFT   0
-#define GICH_LR_PHYSICAL_MASK   0x3ff
-#define GICH_LR_PHYSICAL_SHIFT  10
-#define GICH_LR_STATE_MASK      0x3
-#define GICH_LR_STATE_SHIFT     28
-#define GICH_LR_PRIORITY_SHIFT  23
-#define GICH_LR_MAINTENANCE_IRQ (1<<19)
-#define GICH_LR_PENDING         (1<<28)
-#define GICH_LR_ACTIVE          (1<<29)
-#define GICH_LR_GRP1            (1<<30)
-#define GICH_LR_HW              (1<<31)
-#define GICH_LR_CPUID_SHIFT     9
-#define GICH_VTR_NRLRGS         0x3f
-
-/* XXX: write this into the DT */
-#define VGIC_IRQ_EVTCHN_CALLBACK 31
-
-#ifndef __ASSEMBLY__
-extern int domain_vgic_init(struct domain *d);
-extern void domain_vgic_free(struct domain *d);
-
-extern int vcpu_vgic_init(struct vcpu *v);
-
-extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual);
-extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
-
-extern void gic_route_ppis(void);
-extern void gic_route_spis(void);
-
-extern void gic_inject(void);
-
-extern void __cpuinit init_maintenance_interrupt(void);
-extern void gic_set_guest_irq(struct vcpu *v, unsigned int irq,
-        unsigned int state, unsigned int priority);
-extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
-                                  const char * devname);
-
-/* Accept an interrupt from the GIC and dispatch its handler */
-extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
-/* Bring up the interrupt controller, and report # cpus attached */
-extern void gic_init(void);
-/* Bring up a secondary CPU's per-CPU GIC interface */
-extern void gic_init_secondary_cpu(void);
-/* Take down a CPU's per-CPU GIC interface */
-extern void gic_disable_cpu(void);
-/* setup the gic virtual interface for a guest */
-extern int gicv_setup(struct domain *d);
-
-/* Context switch */
-extern void gic_save_state(struct vcpu *v);
-extern void gic_restore_state(struct vcpu *v);
-
-#endif /* __ASSEMBLY__ */
-#endif
-
-/*
- * Local variables:
- * mode: C
- * c-set-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,415 +0,0 @@
-/*
- * xen/arch/arm/head.S
- *
- * Start-of-day code for an ARMv7-A with virt extensions.
- *
- * Tim Deegan <tim@xen.org>
- * Copyright (c) 2011 Citrix Systems.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <asm/config.h>
-#include <asm/page.h>
-#include <asm/processor-ca15.h>
-#include <asm/asm_defns.h>
-
-#define ZIMAGE_MAGIC_NUMBER 0x016f2818
-
-#define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
-#define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
-#define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
-#define PT_DEV_L3 0xe73 /* lev3: nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=1, P=1 */
-
-#define PT_UPPER(x) (PT_##x & 0xf00)
-#define PT_LOWER(x) (PT_##x & 0x0ff)
-
-/* Macro to print a string to the UART, if there is one.
- * Clobbers r0-r3. */
-#ifdef EARLY_UART_ADDRESS
-#define PRINT(_s)       \
-        adr   r0, 98f ; \
-        bl    puts    ; \
-        b     99f     ; \
-98:     .asciz _s     ; \
-        .align 2      ; \
-99:
-#else
-#define PRINT(s)
-#endif
-
-        .arm
-
-        /* This must be the very first address in the loaded image.
-         * It should be linked at XEN_VIRT_START, and loaded at any
-         * 2MB-aligned address.  All of text+data+bss must fit in 2MB,
-         * or the initial pagetable code below will need adjustment. */
-        .global start
-start:
-
-        /* zImage magic header, see:
-         * http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309
-         */
-        .rept 8
-        mov   r0, r0
-        .endr
-        b     past_zImage
-
-        .word ZIMAGE_MAGIC_NUMBER    /* Magic numbers to help the loader */
-        .word 0x00000000             /* absolute load/run zImage address or
-                                      * 0 for PiC */
-        .word (_end - start)         /* zImage end address */
-
-past_zImage:
-        cpsid aif                    /* Disable all interrupts */
-
-        /* Save the bootloader arguments in less-clobberable registers */
-        mov   r7, r1                 /* r7 := ARM-linux machine type */
-        mov   r8, r2                 /* r8 := ATAG base address */
-
-        /* Find out where we are */
-        ldr   r0, =start
-        adr   r9, start              /* r9  := paddr (start) */
-        sub   r10, r9, r0            /* r10 := phys-offset */
-
-        /* Using the DTB in the .dtb section? */
-#ifdef CONFIG_DTB_FILE
-        ldr   r8, =_sdtb
-        add   r8, r10                /* r8 := paddr(DTB) */
-#endif
-
-        /* Are we the boot CPU? */
-        mov   r12, #0                /* r12 := CPU ID */
-        mrc   CP32(r0, MPIDR)
-        tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
-        beq   boot_cpu
-        tst   r0, #(1<<30)           /* Uniprocessor system? */
-        bne   boot_cpu
-        bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
-        beq   boot_cpu               /* If we're CPU 0, boot now */
-
-        /* Non-boot CPUs wait here to be woken up one at a time. */
-1:      dsb
-        ldr   r0, =smp_up_cpu        /* VA of gate */
-        add   r0, r0, r10            /* PA of gate */
-        ldr   r1, [r0]               /* Which CPU is being booted? */
-        teq   r1, r12                /* Is it us? */
-        wfene
-        bne   1b
-
-boot_cpu:
-#ifdef EARLY_UART_ADDRESS
-        ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
-        teq   r12, #0                   /* CPU 0 sets up the UART too */
-        bleq  init_uart
-        PRINT("- CPU ")
-        mov   r0, r12
-        bl    putn
-        PRINT(" booting -\r\n")
-#endif
-
-        /* Wake up secondary cpus */
-        teq   r12, #0
-        bleq  kick_cpus
-
-        /* Check that this CPU has Hyp mode */
-        mrc   CP32(r0, ID_PFR1)
-        and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
-        teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
-        beq   1f
-        PRINT("- CPU doesn't support the virtualization extensions -\r\n")
-        b     fail
-1:
-        /* Check if we're already in it */
-        mrs   r0, cpsr
-        and   r0, r0, #0x1f          /* Mode is in the low 5 bits of CPSR */
-        teq   r0, #0x1a              /* Hyp Mode? */
-        bne   1f
-        PRINT("- Started in Hyp mode -\r\n")
-        b     hyp
-1:
-        /* Otherwise, it must have been Secure Supervisor mode */
-        mrc   CP32(r0, SCR)
-        tst   r0, #0x1               /* Not-Secure bit set? */
-        beq   1f
-        PRINT("- CPU is not in Hyp mode or Secure state -\r\n")
-        b     fail
-1:
-        /* OK, we're in Secure state. */
-        PRINT("- Started in Secure state -\r\n- Entering Hyp mode -\r\n")
-        ldr   r0, =enter_hyp_mode    /* VA of function */
-        adr   lr, hyp                /* Set return address for call */
-        add   pc, r0, r10            /* Call PA of function */
-
-hyp:
-
-        /* Zero BSS On the boot CPU to avoid nasty surprises */
-        teq   r12, #0
-        bne   skip_bss
-
-        PRINT("- Zero BSS -\r\n")
-        ldr   r0, =__bss_start       /* Load start & end of bss */
-        ldr   r1, =__bss_end
-        add   r0, r0, r10            /* Apply physical offset */
-        add   r1, r1, r10
-
-        mov   r2, #0
-1:      str   r2, [r0], #4
-        cmp   r0, r1
-        blo   1b
-
-skip_bss:
-
-        PRINT("- Setting up control registers -\r\n")
-
-        /* Read CPU ID */
-        mrc   CP32(r0, MIDR)
-        ldr   r1, =(MIDR_MASK)
-        and   r0, r0, r1
-        /* Is this a Cortex A15? */
-        ldr   r1, =(CORTEX_A15_ID)
-        teq   r0, r1
-        bleq  cortex_a15_init
-
-        /* Set up memory attribute type tables */
-        ldr   r0, =MAIR0VAL
-        ldr   r1, =MAIR1VAL
-        mcr   CP32(r0, MAIR0)
-        mcr   CP32(r1, MAIR1)
-        mcr   CP32(r0, HMAIR0)
-        mcr   CP32(r1, HMAIR1)
-
-        /* Set up the HTCR:
-         * PT walks use Outer-Shareable accesses,
-         * PT walks are write-back, no-write-allocate in both cache levels,
-         * Full 32-bit address space goes through this table. */
-        ldr   r0, =0x80002500
-        mcr   CP32(r0, HTCR)
-
-        /* Set up the HSCTLR:
-         * Exceptions in LE ARM,
-         * Low-latency IRQs disabled,
-         * Write-implies-XN disabled (for now),
-         * D-cache disabled (for now),
-         * I-cache enabled,
-         * Alignment checking enabled,
-         * MMU translation disabled (for now). */
-        ldr   r0, =(HSCTLR_BASE|SCTLR_A)
-        mcr   CP32(r0, HSCTLR)
-
-        /* Write Xen's PT's paddr into the HTTBR */
-        ldr   r4, =xen_pgtable
-        add   r4, r4, r10            /* r4 := paddr (xen_pagetable) */
-        mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
-        mcrr  CP64(r4, r5, HTTBR)
-
-        /* Non-boot CPUs don't need to rebuild the pagetable */
-        teq   r12, #0
-        bne   pt_ready
-
-        /* console fixmap */
-#ifdef EARLY_UART_ADDRESS
-        ldr   r1, =xen_fixmap
-        add   r1, r1, r10            /* r1 := paddr (xen_fixmap) */
-        mov   r3, #0
-        lsr   r2, r11, #12
-        lsl   r2, r2, #12            /* 4K aligned paddr of UART */
-        orr   r2, r2, #PT_UPPER(DEV_L3)
-        orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 := 4K dev map including UART */
-        strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap's slot */
-#endif
-
-        /* Build the baseline idle pagetable's first-level entries */
-        ldr   r1, =xen_second
-        add   r1, r1, r10            /* r1 := paddr (xen_second) */
-        mov   r3, #0x0
-        orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 := table map of xen_second */
-        orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
-        strd  r2, r3, [r4, #0]       /* Map it in slot 0 */
-        add   r2, r2, #0x1000
-        strd  r2, r3, [r4, #8]       /* Map 2nd page in slot 1 */
-        add   r2, r2, #0x1000
-        strd  r2, r3, [r4, #16]      /* Map 3rd page in slot 2 */
-        add   r2, r2, #0x1000
-        strd  r2, r3, [r4, #24]      /* Map 4th page in slot 3 */
-
-        /* Now set up the second-level entries */
-        orr   r2, r9, #PT_UPPER(MEM)
-        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB normal map of Xen */
-        mov   r4, r9, lsr #18        /* Slot for paddr(start) */
-        strd  r2, r3, [r1, r4]       /* Map Xen there */
-        ldr   r4, =start
-        lsr   r4, #18                /* Slot for vaddr(start) */
-        strd  r2, r3, [r1, r4]       /* Map Xen there too */
-
-        /* xen_fixmap pagetable */
-        ldr   r2, =xen_fixmap
-        add   r2, r2, r10            /* r2 := paddr (xen_fixmap) */
-        orr   r2, r2, #PT_UPPER(PT)
-        orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 := table map of xen_fixmap */
-        add   r4, r4, #8
-        strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
-
-        mov   r3, #0x0
-        lsr   r2, r8, #21
-        lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
-        orr   r2, r2, #PT_UPPER(MEM)
-        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB RAM incl. DTB */
-        add   r4, r4, #8
-        strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
-
-pt_ready:
-        PRINT("- Turning on paging -\r\n")
-
-        ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
-        mrc   CP32(r0, HSCTLR)
-        orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
-        dsb                          /* Flush PTE writes and finish reads */
-        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
-        isb                          /* Now, flush the icache */
-        mov   pc, r1                 /* Get a proper vaddr into PC */
-paging:
-
-
-#ifdef EARLY_UART_ADDRESS
-        /* Use a virtual address to access the UART. */
-        ldr   r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
-#endif
-
-        PRINT("- Ready -\r\n")
-
-        /* The boot CPU should go straight into C now */
-        teq   r12, #0
-        beq   launch
-
-        /* Non-boot CPUs need to move on to the relocated pagetables */
-        mov   r0, #0
-        ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
-        add   r4, r4, r10            /* PA of it */
-        ldrd  r4, r5, [r4]           /* Actual value */
-        dsb
-        mcrr  CP64(r4, r5, HTTBR)
-        dsb
-        isb
-        mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
-        mcr   CP32(r0, ICIALLU)      /* Flush I-cache */
-        mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
-        dsb                          /* Ensure completion of TLB+BP flush */
-        isb
-
-        /* Non-boot CPUs report that they've got this far */
-        ldr   r0, =ready_cpus
-1:      ldrex r1, [r0]               /*            { read # of ready CPUs } */
-        add   r1, r1, #1             /* Atomically { ++                   } */
-        strex r2, r1, [r0]           /*            { writeback            } */
-        teq   r2, #0
-        bne   1b
-        dsb
-        mcr   CP32(r0, DCCMVAC)      /* flush D-Cache */
-        dsb
-
-        /* Here, the non-boot CPUs must wait again -- they're now running on
-         * the boot CPU's pagetables so it's safe for the boot CPU to
-         * overwrite the non-relocated copy of Xen.  Once it's done that,
-         * and brought up the memory allocator, non-boot CPUs can get their
-         * own stacks and enter C. */
-1:      wfe
-        dsb
-        ldr   r0, =smp_up_cpu
-        ldr   r1, [r0]               /* Which CPU is being booted? */
-        teq   r1, r12                /* Is it us? */
-        bne   1b
-
-launch:
-        ldr   r0, =init_stack        /* Find the boot-time stack */
-        ldr   sp, [r0]
-        add   sp, #STACK_SIZE        /* (which grows down from the top). */
-        sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
-        mov   r0, r10                /* Marshal args: - phys_offset */
-        mov   r1, r7                 /*               - machine type */
-        mov   r2, r8                 /*               - ATAG address */
-        movs  r3, r12                /*               - CPU ID */
-        beq   start_xen              /* and disappear into the land of C */
-        b     start_secondary        /* (to the appropriate entry point) */
-
-/* Fail-stop
- * r0: string explaining why */
-fail:   PRINT("- Boot failed -\r\n")
-1:      wfe
-        b     1b
-
-#ifdef EARLY_UART_ADDRESS
-
-/* Bring up the UART. Specific to the PL011 UART.
- * Clobbers r0-r2 */
-init_uart:
-        mov   r1, #0x0
-        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor fraction) */
-        mov   r1, #0x4               /* 7.3728MHz / 0x4 == 16 * 115200 */
-        str   r1, [r11, #0x24]       /* -> UARTIBRD (Baud divisor integer) */
-        mov   r1, #0x60              /* 8n1 */
-        str   r1, [r11, #0x24]       /* -> UARTLCR_H (Line control) */
-        ldr   r1, =0x00000301        /* RXE | TXE | UARTEN */
-        str   r1, [r11, #0x30]       /* -> UARTCR (Control Register) */
-        adr   r0, 1f
-        b     puts
-1:      .asciz "- UART enabled -\r\n"
-        .align 4
-
-/* Print early debug messages.  Specific to the PL011 UART.
- * r0: Nul-terminated string to print.
- * Clobbers r0-r2 */
-puts:
-        ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
-        tst   r2, #0x8               /* Check BUSY bit */
-        bne   puts                   /* Wait for the UART to be ready */
-        ldrb  r2, [r0], #1           /* Load next char */
-        teq   r2, #0                 /* Exit on nul */
-        moveq pc, lr
-        str   r2, [r11]              /* -> UARTDR (Data Register) */
-        b     puts
-
-/* Print a 32-bit number in hex.  Specific to the PL011 UART.
- * r0: Number to print.
- * clobbers r0-r3 */
-putn:
-        adr   r1, hex
-        mov   r3, #8
-1:      ldr   r2, [r11, #0x18]       /* <- UARTFR (Flag register) */
-        tst   r2, #0x8               /* Check BUSY bit */
-        bne   1b                     /* Wait for the UART to be ready */
-        and   r2, r0, #0xf0000000    /* Mask off the top nybble */
-        ldrb  r2, [r1, r2, lsr #28]  /* Convert to a char */
-        str   r2, [r11]              /* -> UARTDR (Data Register) */
-        lsl   r0, #4                 /* Roll it through one nybble at a time */
-        subs  r3, r3, #1
-        bne   1b
-        mov   pc, lr
-
-hex:    .ascii "0123456789abcdef"
-        .align 2
-
-#else  /* EARLY_UART_ADDRESS */
-
-init_uart:
-.global early_puts
-early_puts:
-puts:
-putn:   mov   pc, lr
-
-#endif /* EARLY_UART_ADDRESS */
-
-/*
- * Local variables:
- * mode: ASM
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/irq.c
--- a/xen/arch/arm/irq.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/irq.c	Wed Dec 19 14:16:30 2012 +0000
@@ -25,7 +25,7 @@
 #include <xen/errno.h>
 #include <xen/sched.h>
 
-#include "gic.h"
+#include <asm/gic.h>
 
 static void enable_none(struct irq_desc *irq) { }
 static unsigned int startup_none(struct irq_desc *irq) { return 0; }
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/Makefile
--- a/xen/arch/arm/lib/Makefile	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-obj-y += memcpy.o memmove.o memset.o memzero.o
-obj-y += findbit.o setbit.o
-obj-y += setbit.o clearbit.o changebit.o
-obj-y += testsetbit.o testclearbit.o testchangebit.o
-obj-y += lib1funcs.o lshrdi3.o div64.o
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/assembler.h
--- a/xen/arch/arm/lib/assembler.h	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,325 +0,0 @@
-/* From Linux arch/arm/include/asm/assembler.h */
-/*
- *  arch/arm/include/asm/assembler.h
- *
- *  Copyright (C) 1996-2000 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- *  This file contains arm architecture specific defines
- *  for the different processors.
- *
- *  Do not include any C declarations in this file - it is included by
- *  assembler source.
- */
-#ifndef __ASM_ASSEMBLER_H__
-#define __ASM_ASSEMBLER_H__
-
-#ifndef __ASSEMBLY__
-#error "Only include this from assembly code"
-#endif
-
-// No Thumb, hence:
-#define W(instr)        instr
-#define ARM(instr...)   instr
-#define THUMB(instr...)
-
-#ifdef CONFIG_ARM_UNWIND
-#define UNWIND(code...)         code
-#else
-#define UNWIND(code...)
-#endif
-
-/*
- * Endian independent macros for shifting bytes within registers.
- */
-#ifndef __ARMEB__
-#define pull            lsr
-#define push            lsl
-#define get_byte_0      lsl #0
-#define get_byte_1	lsr #8
-#define get_byte_2	lsr #16
-#define get_byte_3	lsr #24
-#define put_byte_0      lsl #0
-#define put_byte_1	lsl #8
-#define put_byte_2	lsl #16
-#define put_byte_3	lsl #24
-#else
-#define pull            lsl
-#define push            lsr
-#define get_byte_0	lsr #24
-#define get_byte_1	lsr #16
-#define get_byte_2	lsr #8
-#define get_byte_3      lsl #0
-#define put_byte_0	lsl #24
-#define put_byte_1	lsl #16
-#define put_byte_2	lsl #8
-#define put_byte_3      lsl #0
-#endif
-
-/*
- * Data preload for architectures that support it
- */
-#if __LINUX_ARM_ARCH__ >= 5
-#define PLD(code...)	code
-#else
-#define PLD(code...)
-#endif
-
-/*
- * This can be used to enable code to cacheline align the destination
- * pointer when bulk writing to memory.  Experiments on StrongARM and
- * XScale didn't show this a worthwhile thing to do when the cache is not
- * set to write-allocate (this would need further testing on XScale when WA
- * is used).
- *
- * On Feroceon there is much to gain however, regardless of cache mode.
- */
-#ifdef CONFIG_CPU_FEROCEON
-#define CALGN(code...) code
-#else
-#define CALGN(code...)
-#endif
-
-/*
- * Enable and disable interrupts
- */
-#if __LINUX_ARM_ARCH__ >= 6
-	.macro	disable_irq_notrace
-	cpsid	i
-	.endm
-
-	.macro	enable_irq_notrace
-	cpsie	i
-	.endm
-#else
-	.macro	disable_irq_notrace
-	msr	cpsr_c, #PSR_I_BIT | SVC_MODE
-	.endm
-
-	.macro	enable_irq_notrace
-	msr	cpsr_c, #SVC_MODE
-	.endm
-#endif
-
-	.macro asm_trace_hardirqs_off
-#if defined(CONFIG_TRACE_IRQFLAGS)
-	stmdb   sp!, {r0-r3, ip, lr}
-	bl	trace_hardirqs_off
-	ldmia	sp!, {r0-r3, ip, lr}
-#endif
-	.endm
-
-	.macro asm_trace_hardirqs_on_cond, cond
-#if defined(CONFIG_TRACE_IRQFLAGS)
-	/*
-	 * actually the registers should be pushed and pop'd conditionally, but
-	 * after bl the flags are certainly clobbered
-	 */
-	stmdb   sp!, {r0-r3, ip, lr}
-	bl\cond	trace_hardirqs_on
-	ldmia	sp!, {r0-r3, ip, lr}
-#endif
-	.endm
-
-	.macro asm_trace_hardirqs_on
-	asm_trace_hardirqs_on_cond al
-	.endm
-
-	.macro disable_irq
-	disable_irq_notrace
-	asm_trace_hardirqs_off
-	.endm
-
-	.macro enable_irq
-	asm_trace_hardirqs_on
-	enable_irq_notrace
-	.endm
-/*
- * Save the current IRQ state and disable IRQs.  Note that this macro
- * assumes FIQs are enabled, and that the processor is in SVC mode.
- */
-	.macro	save_and_disable_irqs, oldcpsr
-	mrs	\oldcpsr, cpsr
-	disable_irq
-	.endm
-
-/*
- * Restore interrupt state previously stored in a register.  We don't
- * guarantee that this will preserve the flags.
- */
-	.macro	restore_irqs_notrace, oldcpsr
-	msr	cpsr_c, \oldcpsr
-	.endm
-
-	.macro restore_irqs, oldcpsr
-	tst	\oldcpsr, #PSR_I_BIT
-	asm_trace_hardirqs_on_cond eq
-	restore_irqs_notrace \oldcpsr
-	.endm
-
-#define USER(x...)				\
-9999:	x;					\
-	.pushsection __ex_table,"a";		\
-	.align	3;				\
-	.long	9999b,9001f;			\
-	.popsection
-
-#ifdef CONFIG_SMP
-#define ALT_SMP(instr...)					\
-9998:	instr
-/*
- * Note: if you get assembler errors from ALT_UP() when building with
- * CONFIG_THUMB2_KERNEL, you almost certainly need to use
- * ALT_SMP( W(instr) ... )
- */
-#define ALT_UP(instr...)					\
-	.pushsection ".alt.smp.init", "a"			;\
-	.long	9998b						;\
-9997:	instr							;\
-	.if . - 9997b != 4					;\
-		.error "ALT_UP() content must assemble to exactly 4 bytes";\
-	.endif							;\
-	.popsection
-#define ALT_UP_B(label)					\
-	.equ	up_b_offset, label - 9998b			;\
-	.pushsection ".alt.smp.init", "a"			;\
-	.long	9998b						;\
-	W(b)	. + up_b_offset					;\
-	.popsection
-#else
-#define ALT_SMP(instr...)
-#define ALT_UP(instr...) instr
-#define ALT_UP_B(label) b label
-#endif
-
-/*
- * Instruction barrier
- */
-	.macro	instr_sync
-#if __LINUX_ARM_ARCH__ >= 7
-	isb
-#elif __LINUX_ARM_ARCH__ == 6
-	mcr	p15, 0, r0, c7, c5, 4
-#endif
-	.endm
-
-/*
- * SMP data memory barrier
- */
-	.macro	smp_dmb mode
-#ifdef CONFIG_SMP
-#if __LINUX_ARM_ARCH__ >= 7
-	.ifeqs "\mode","arm"
-	ALT_SMP(dmb)
-	.else
-	ALT_SMP(W(dmb))
-	.endif
-#elif __LINUX_ARM_ARCH__ == 6
-	ALT_SMP(mcr	p15, 0, r0, c7, c10, 5)	@ dmb
-#else
-#error Incompatible SMP platform
-#endif
-	.ifeqs "\mode","arm"
-	ALT_UP(nop)
-	.else
-	ALT_UP(W(nop))
-	.endif
-#endif
-	.endm
-
-#ifdef CONFIG_THUMB2_KERNEL
-	.macro	setmode, mode, reg
-	mov	\reg, #\mode
-	msr	cpsr_c, \reg
-	.endm
-#else
-	.macro	setmode, mode, reg
-	msr	cpsr_c, #\mode
-	.endm
-#endif
-
-/*
- * STRT/LDRT access macros with ARM and Thumb-2 variants
- */
-#ifdef CONFIG_THUMB2_KERNEL
-
-	.macro	usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T()
-9999:
-	.if	\inc == 1
-	\instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
-	.elseif	\inc == 4
-	\instr\cond\()\t\().w \reg, [\ptr, #\off]
-	.else
-	.error	"Unsupported inc macro argument"
-	.endif
-
-	.pushsection __ex_table,"a"
-	.align	3
-	.long	9999b, \abort
-	.popsection
-	.endm
-
-	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort
-	@ explicit IT instruction needed because of the label
-	@ introduced by the USER macro
-	.ifnc	\cond,al
-	.if	\rept == 1
-	itt	\cond
-	.elseif	\rept == 2
-	ittt	\cond
-	.else
-	.error	"Unsupported rept macro argument"
-	.endif
-	.endif
-
-	@ Slightly optimised to avoid incrementing the pointer twice
-	usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort
-	.if	\rept == 2
-	usraccoff \instr, \reg, \ptr, \inc, \inc, \cond, \abort
-	.endif
-
-	add\cond \ptr, #\rept * \inc
-	.endm
-
-#else	/* !CONFIG_THUMB2_KERNEL */
-
-	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort, t=T()
-	.rept	\rept
-9999:
-	.if	\inc == 1
-	\instr\cond\()b\()\t \reg, [\ptr], #\inc
-	.elseif	\inc == 4
-	\instr\cond\()\t \reg, [\ptr], #\inc
-	.else
-	.error	"Unsupported inc macro argument"
-	.endif
-
-	.pushsection __ex_table,"a"
-	.align	3
-	.long	9999b, \abort
-	.popsection
-	.endr
-	.endm
-
-#endif	/* CONFIG_THUMB2_KERNEL */
-
-	.macro	strusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
-	usracc	str, \reg, \ptr, \inc, \cond, \rept, \abort
-	.endm
-
-	.macro	ldrusr, reg, ptr, inc, cond=al, rept=1, abort=9001f
-	usracc	ldr, \reg, \ptr, \inc, \cond, \rept, \abort
-	.endm
-
-/* Utility macro for declaring string literals */
-	.macro	string name:req, string
-	.type \name , #object
-\name:
-	.asciz "\string"
-	.size \name , . - \name
-	.endm
-
-#endif /* __ASM_ASSEMBLER_H__ */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/bitops.h
--- a/xen/arch/arm/lib/bitops.h	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-#include <xen/config.h>
-
-#if __LINUX_ARM_ARCH__ >= 6
-	.macro	bitop, instr
-	ands	ip, r1, #3
-	strneb	r1, [ip]		@ assert word-aligned
-	mov	r2, #1
-	and	r3, r0, #31		@ Get bit offset
-	mov	r0, r0, lsr #5
-	add	r1, r1, r0, lsl #2	@ Get word offset
-	mov	r3, r2, lsl r3
-1:	ldrex	r2, [r1]
-	\instr	r2, r2, r3
-	strex	r0, r2, [r1]
-	cmp	r0, #0
-	bne	1b
-	bx	lr
-	.endm
-
-	.macro	testop, instr, store
-	ands	ip, r1, #3
-	strneb	r1, [ip]		@ assert word-aligned
-	mov	r2, #1
-	and	r3, r0, #31		@ Get bit offset
-	mov	r0, r0, lsr #5
-	add	r1, r1, r0, lsl #2	@ Get word offset
-	mov	r3, r2, lsl r3		@ create mask
-	smp_dmb
-1:	ldrex	r2, [r1]
-	ands	r0, r2, r3		@ save old value of bit
-	\instr	r2, r2, r3		@ toggle bit
-	strex	ip, r2, [r1]
-	cmp	ip, #0
-	bne	1b
-	smp_dmb
-	cmp	r0, #0
-	movne	r0, #1
-2:	bx	lr
-	.endm
-#else
-	.macro	bitop, name, instr
-ENTRY(	\name		)
-UNWIND(	.fnstart	)
-	ands	ip, r1, #3
-	strneb	r1, [ip]		@ assert word-aligned
-	and	r2, r0, #31
-	mov	r0, r0, lsr #5
-	mov	r3, #1
-	mov	r3, r3, lsl r2
-	save_and_disable_irqs ip
-	ldr	r2, [r1, r0, lsl #2]
-	\instr	r2, r2, r3
-	str	r2, [r1, r0, lsl #2]
-	restore_irqs ip
-	mov	pc, lr
-UNWIND(	.fnend		)
-ENDPROC(\name		)
-	.endm
-
-/**
- * testop - implement a test_and_xxx_bit operation.
- * @instr: operational instruction
- * @store: store instruction
- *
- * Note: we can trivially conditionalise the store instruction
- * to avoid dirtying the data cache.
- */
-	.macro	testop, name, instr, store
-ENTRY(	\name		)
-UNWIND(	.fnstart	)
-	ands	ip, r1, #3
-	strneb	r1, [ip]		@ assert word-aligned
-	and	r3, r0, #31
-	mov	r0, r0, lsr #5
-	save_and_disable_irqs ip
-	ldr	r2, [r1, r0, lsl #2]!
-	mov	r0, #1
-	tst	r2, r0, lsl r3
-	\instr	r2, r2, r0, lsl r3
-	\store	r2, [r1]
-	moveq	r0, #0
-	restore_irqs ip
-	mov	pc, lr
-UNWIND(	.fnend		)
-ENDPROC(\name		)
-	.endm
-#endif
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/changebit.S
--- a/xen/arch/arm/lib/changebit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- *  linux/arch/arm/lib/changebit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-                .text
-
-ENTRY(_change_bit)
-	bitop	eor
-ENDPROC(_change_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/clearbit.S
--- a/xen/arch/arm/lib/clearbit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/*
- *  linux/arch/arm/lib/clearbit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-                .text
-
-ENTRY(_clear_bit)
-	bitop	bic
-ENDPROC(_clear_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/copy_template.S
--- a/xen/arch/arm/lib/copy_template.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +0,0 @@
-/*
- *  linux/arch/arm/lib/copy_template.s
- *
- *  Code template for optimized memory copy functions
- *
- *  Author:	Nicolas Pitre
- *  Created:	Sep 28, 2005
- *  Copyright:	MontaVista Software, Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- */
-
-/*
- * Theory of operation
- * -------------------
- *
- * This file provides the core code for a forward memory copy used in
- * the implementation of memcopy(), copy_to_user() and copy_from_user().
- *
- * The including file must define the following accessor macros
- * according to the need of the given function:
- *
- * ldr1w ptr reg abort
- *
- *	This loads one word from 'ptr', stores it in 'reg' and increments
- *	'ptr' to the next word. The 'abort' argument is used for fixup tables.
- *
- * ldr4w ptr reg1 reg2 reg3 reg4 abort
- * ldr8w ptr, reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
- *
- *	This loads four or eight words starting from 'ptr', stores them
- *	in provided registers and increments 'ptr' past those words.
- *	The'abort' argument is used for fixup tables.
- *
- * ldr1b ptr reg cond abort
- *
- *	Similar to ldr1w, but it loads a byte and increments 'ptr' one byte.
- *	It also must apply the condition code if provided, otherwise the
- *	"al" condition is assumed by default.
- *
- * str1w ptr reg abort
- * str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
- * str1b ptr reg cond abort
- *
- *	Same as their ldr* counterparts, but data is stored to 'ptr' location
- *	rather than being loaded.
- *
- * enter reg1 reg2
- *
- *	Preserve the provided registers on the stack plus any additional
- *	data as needed by the implementation including this code. Called
- *	upon code entry.
- *
- * exit reg1 reg2
- *
- *	Restore registers with the values previously saved with the
- *	'preserv' macro. Called upon code termination.
- *
- * LDR1W_SHIFT
- * STR1W_SHIFT
- *
- *	Correction to be applied to the "ip" register when branching into
- *	the ldr1w or str1w instructions (some of these macros may expand to
- *	than one 32bit instruction in Thumb-2)
- */
-
-
-		enter	r4, lr
-
-		subs	r2, r2, #4
-		blt	8f
-		ands	ip, r0, #3
-	PLD(	pld	[r1, #0]		)
-		bne	9f
-		ands	ip, r1, #3
-		bne	10f
-
-1:		subs	r2, r2, #(28)
-		stmfd	sp!, {r5 - r8}
-		blt	5f
-
-	CALGN(	ands	ip, r0, #31		)
-	CALGN(	rsb	r3, ip, #32		)
-	CALGN(	sbcnes	r4, r3, r2		)  @ C is always set here
-	CALGN(	bcs	2f			)
-	CALGN(	adr	r4, 6f			)
-	CALGN(	subs	r2, r2, r3		)  @ C gets set
-	CALGN(	add	pc, r4, ip		)
-
-	PLD(	pld	[r1, #0]		)
-2:	PLD(	subs	r2, r2, #96		)
-	PLD(	pld	[r1, #28]		)
-	PLD(	blt	4f			)
-	PLD(	pld	[r1, #60]		)
-	PLD(	pld	[r1, #92]		)
-
-3:	PLD(	pld	[r1, #124]		)
-4:		ldr8w	r1, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f
-		subs	r2, r2, #32
-		str8w	r0, r3, r4, r5, r6, r7, r8, ip, lr, abort=20f
-		bge	3b
-	PLD(	cmn	r2, #96			)
-	PLD(	bge	4b			)
-
-5:		ands	ip, r2, #28
-		rsb	ip, ip, #32
-#if LDR1W_SHIFT > 0
-		lsl	ip, ip, #LDR1W_SHIFT
-#endif
-		addne	pc, pc, ip		@ C is always clear here
-		b	7f
-6:
-		.rept	(1 << LDR1W_SHIFT)
-		W(nop)
-		.endr
-		ldr1w	r1, r3, abort=20f
-		ldr1w	r1, r4, abort=20f
-		ldr1w	r1, r5, abort=20f
-		ldr1w	r1, r6, abort=20f
-		ldr1w	r1, r7, abort=20f
-		ldr1w	r1, r8, abort=20f
-		ldr1w	r1, lr, abort=20f
-
-#if LDR1W_SHIFT < STR1W_SHIFT
-		lsl	ip, ip, #STR1W_SHIFT - LDR1W_SHIFT
-#elif LDR1W_SHIFT > STR1W_SHIFT
-		lsr	ip, ip, #LDR1W_SHIFT - STR1W_SHIFT
-#endif
-		add	pc, pc, ip
-		nop
-		.rept	(1 << STR1W_SHIFT)
-		W(nop)
-		.endr
-		str1w	r0, r3, abort=20f
-		str1w	r0, r4, abort=20f
-		str1w	r0, r5, abort=20f
-		str1w	r0, r6, abort=20f
-		str1w	r0, r7, abort=20f
-		str1w	r0, r8, abort=20f
-		str1w	r0, lr, abort=20f
-
-	CALGN(	bcs	2b			)
-
-7:		ldmfd	sp!, {r5 - r8}
-
-8:		movs	r2, r2, lsl #31
-		ldr1b	r1, r3, ne, abort=21f
-		ldr1b	r1, r4, cs, abort=21f
-		ldr1b	r1, ip, cs, abort=21f
-		str1b	r0, r3, ne, abort=21f
-		str1b	r0, r4, cs, abort=21f
-		str1b	r0, ip, cs, abort=21f
-
-		exit	r4, pc
-
-9:		rsb	ip, ip, #4
-		cmp	ip, #2
-		ldr1b	r1, r3, gt, abort=21f
-		ldr1b	r1, r4, ge, abort=21f
-		ldr1b	r1, lr, abort=21f
-		str1b	r0, r3, gt, abort=21f
-		str1b	r0, r4, ge, abort=21f
-		subs	r2, r2, ip
-		str1b	r0, lr, abort=21f
-		blt	8b
-		ands	ip, r1, #3
-		beq	1b
-
-10:		bic	r1, r1, #3
-		cmp	ip, #2
-		ldr1w	r1, lr, abort=21f
-		beq	17f
-		bgt	18f
-
-
-		.macro	forward_copy_shift pull push
-
-		subs	r2, r2, #28
-		blt	14f
-
-	CALGN(	ands	ip, r0, #31		)
-	CALGN(	rsb	ip, ip, #32		)
-	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
-	CALGN(	subcc	r2, r2, ip		)
-	CALGN(	bcc	15f			)
-
-11:		stmfd	sp!, {r5 - r9}
-
-	PLD(	pld	[r1, #0]		)
-	PLD(	subs	r2, r2, #96		)
-	PLD(	pld	[r1, #28]		)
-	PLD(	blt	13f			)
-	PLD(	pld	[r1, #60]		)
-	PLD(	pld	[r1, #92]		)
-
-12:	PLD(	pld	[r1, #124]		)
-13:		ldr4w	r1, r4, r5, r6, r7, abort=19f
-		mov	r3, lr, pull #\pull
-		subs	r2, r2, #32
-		ldr4w	r1, r8, r9, ip, lr, abort=19f
-		orr	r3, r3, r4, push #\push
-		mov	r4, r4, pull #\pull
-		orr	r4, r4, r5, push #\push
-		mov	r5, r5, pull #\pull
-		orr	r5, r5, r6, push #\push
-		mov	r6, r6, pull #\pull
-		orr	r6, r6, r7, push #\push
-		mov	r7, r7, pull #\pull
-		orr	r7, r7, r8, push #\push
-		mov	r8, r8, pull #\pull
-		orr	r8, r8, r9, push #\push
-		mov	r9, r9, pull #\pull
-		orr	r9, r9, ip, push #\push
-		mov	ip, ip, pull #\pull
-		orr	ip, ip, lr, push #\push
-		str8w	r0, r3, r4, r5, r6, r7, r8, r9, ip, , abort=19f
-		bge	12b
-	PLD(	cmn	r2, #96			)
-	PLD(	bge	13b			)
-
-		ldmfd	sp!, {r5 - r9}
-
-14:		ands	ip, r2, #28
-		beq	16f
-
-15:		mov	r3, lr, pull #\pull
-		ldr1w	r1, lr, abort=21f
-		subs	ip, ip, #4
-		orr	r3, r3, lr, push #\push
-		str1w	r0, r3, abort=21f
-		bgt	15b
-	CALGN(	cmp	r2, #0			)
-	CALGN(	bge	11b			)
-
-16:		sub	r1, r1, #(\push / 8)
-		b	8b
-
-		.endm
-
-
-		forward_copy_shift	pull=8	push=24
-
-17:		forward_copy_shift	pull=16	push=16
-
-18:		forward_copy_shift	pull=24	push=8
-
-
-/*
- * Abort preamble and completion macros.
- * If a fixup handler is required then those macros must surround it.
- * It is assumed that the fixup code will handle the private part of
- * the exit macro.
- */
-
-	.macro	copy_abort_preamble
-19:	ldmfd	sp!, {r5 - r9}
-	b	21f
-20:	ldmfd	sp!, {r5 - r8}
-21:
-	.endm
-
-	.macro	copy_abort_end
-	ldmfd	sp!, {r4, pc}
-	.endm
-
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/div64.S
--- a/xen/arch/arm/lib/div64.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +0,0 @@
-/*
- *  linux/arch/arm/lib/div64.S
- *
- *  Optimized computation of 64-bit dividend / 32-bit divisor
- *
- *  Author:	Nicolas Pitre
- *  Created:	Oct 5, 2003
- *  Copyright:	Monta Vista Software, Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- */
-
-#include <xen/config.h>
-#include "assembler.h"
-	
-#ifdef __ARMEB__
-#define xh r0
-#define xl r1
-#define yh r2
-#define yl r3
-#else
-#define xl r0
-#define xh r1
-#define yl r2
-#define yh r3
-#endif
-
-/*
- * __do_div64: perform a division with 64-bit dividend and 32-bit divisor.
- *
- * Note: Calling convention is totally non standard for optimal code.
- *       This is meant to be used by do_div() from include/asm/div64.h only.
- *
- * Input parameters:
- * 	xh-xl	= dividend (clobbered)
- * 	r4	= divisor (preserved)
- *
- * Output values:
- * 	yh-yl	= result
- * 	xh	= remainder
- *
- * Clobbered regs: xl, ip
- */
-
-ENTRY(__do_div64)
-UNWIND(.fnstart)
-
-	@ Test for easy paths first.
-	subs	ip, r4, #1
-	bls	9f			@ divisor is 0 or 1
-	tst	ip, r4
-	beq	8f			@ divisor is power of 2
-
-	@ See if we need to handle upper 32-bit result.
-	cmp	xh, r4
-	mov	yh, #0
-	blo	3f
-
-	@ Align divisor with upper part of dividend.
-	@ The aligned divisor is stored in yl preserving the original.
-	@ The bit position is stored in ip.
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	yl, r4
-	clz	ip, xh
-	sub	yl, yl, ip
-	mov	ip, #1
-	mov	ip, ip, lsl yl
-	mov	yl, r4, lsl yl
-
-#else
-
-	mov	yl, r4
-	mov	ip, #1
-1:	cmp	yl, #0x80000000
-	cmpcc	yl, xh
-	movcc	yl, yl, lsl #1
-	movcc	ip, ip, lsl #1
-	bcc	1b
-
-#endif
-
-	@ The division loop for needed upper bit positions.
- 	@ Break out early if dividend reaches 0.
-2:	cmp	xh, yl
-	orrcs	yh, yh, ip
-	subcss	xh, xh, yl
-	movnes	ip, ip, lsr #1
-	mov	yl, yl, lsr #1
-	bne	2b
-
-	@ See if we need to handle lower 32-bit result.
-3:	cmp	xh, #0
-	mov	yl, #0
-	cmpeq	xl, r4
-	movlo	xh, xl
-	movlo	pc, lr
-
-	@ The division loop for lower bit positions.
-	@ Here we shift remainer bits leftwards rather than moving the
-	@ divisor for comparisons, considering the carry-out bit as well.
-	mov	ip, #0x80000000
-4:	movs	xl, xl, lsl #1
-	adcs	xh, xh, xh
-	beq	6f
-	cmpcc	xh, r4
-5:	orrcs	yl, yl, ip
-	subcs	xh, xh, r4
-	movs	ip, ip, lsr #1
-	bne	4b
-	mov	pc, lr
-
-	@ The top part of remainder became zero.  If carry is set
-	@ (the 33th bit) this is a false positive so resume the loop.
-	@ Otherwise, if lower part is also null then we are done.
-6:	bcs	5b
-	cmp	xl, #0
-	moveq	pc, lr
-
-	@ We still have remainer bits in the low part.  Bring them up.
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	xh, xl			@ we know xh is zero here so...
-	add	xh, xh, #1
-	mov	xl, xl, lsl xh
-	mov	ip, ip, lsr xh
-
-#else
-
-7:	movs	xl, xl, lsl #1
-	mov	ip, ip, lsr #1
-	bcc	7b
-
-#endif
-
-	@ Current remainder is now 1.  It is worthless to compare with
-	@ divisor at this point since divisor can not be smaller than 3 here.
-	@ If possible, branch for another shift in the division loop.
-	@ If no bit position left then we are done.
-	movs	ip, ip, lsr #1
-	mov	xh, #1
-	bne	4b
-	mov	pc, lr
-
-8:	@ Division by a power of 2: determine what that divisor order is
-	@ then simply shift values around
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	ip, r4
-	rsb	ip, ip, #31
-
-#else
-
-	mov	yl, r4
-	cmp	r4, #(1 << 16)
-	mov	ip, #0
-	movhs	yl, yl, lsr #16
-	movhs	ip, #16
-
-	cmp	yl, #(1 << 8)
-	movhs	yl, yl, lsr #8
-	addhs	ip, ip, #8
-
-	cmp	yl, #(1 << 4)
-	movhs	yl, yl, lsr #4
-	addhs	ip, ip, #4
-
-	cmp	yl, #(1 << 2)
-	addhi	ip, ip, #3
-	addls	ip, ip, yl, lsr #1
-
-#endif
-
-	mov	yh, xh, lsr ip
-	mov	yl, xl, lsr ip
-	rsb	ip, ip, #32
- ARM(	orr	yl, yl, xh, lsl ip	)
- THUMB(	lsl	xh, xh, ip		)
- THUMB(	orr	yl, yl, xh		)
-	mov	xh, xl, lsl ip
-	mov	xh, xh, lsr ip
-	mov	pc, lr
-
-	@ eq -> division by 1: obvious enough...
-9:	moveq	yl, xl
-	moveq	yh, xh
-	moveq	xh, #0
-	moveq	pc, lr
-UNWIND(.fnend)
-
-UNWIND(.fnstart)
-UNWIND(.pad #4)
-UNWIND(.save {lr})
-Ldiv0_64:
-	@ Division by 0:
-	str	lr, [sp, #-8]!
-	bl	__div0
-
-	@ as wrong as it could be...
-	mov	yl, #0
-	mov	yh, #0
-	mov	xh, #0
-	ldr	pc, [sp], #8
-
-UNWIND(.fnend)
-ENDPROC(__do_div64)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/findbit.S
--- a/xen/arch/arm/lib/findbit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +0,0 @@
-/*
- *  linux/arch/arm/lib/findbit.S
- *
- *  Copyright (C) 1995-2000 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * 16th March 2001 - John Ripley <jripley@sonicblue.com>
- *   Fixed so that "size" is an exclusive not an inclusive quantity.
- *   All users of these functions expect exclusive sizes, and may
- *   also call with zero size.
- * Reworked by rmk.
- */
-
-#include <xen/config.h>
-
-#include "assembler.h"
-                .text
-
-/*
- * Purpose  : Find a 'zero' bit
- * Prototype: int find_first_zero_bit(void *addr, unsigned int maxbit);
- */
-ENTRY(_find_first_zero_bit_le)
-		teq	r1, #0	
-		beq	3f
-		mov	r2, #0
-1:
- ARM(		ldrb	r3, [r0, r2, lsr #3]	)
- THUMB(		lsr	r3, r2, #3		)
- THUMB(		ldrb	r3, [r0, r3]		)
-		eors	r3, r3, #0xff		@ invert bits
-		bne	.L_found		@ any now set - found zero bit
-		add	r2, r2, #8		@ next bit pointer
-2:		cmp	r2, r1			@ any more?
-		blo	1b
-3:		mov	r0, r1			@ no free bits
-		mov	pc, lr
-ENDPROC(_find_first_zero_bit_le)
-
-/*
- * Purpose  : Find next 'zero' bit
- * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
- */
-ENTRY(_find_next_zero_bit_le)
-		teq	r1, #0
-		beq	3b
-		ands	ip, r2, #7
-		beq	1b			@ If new byte, goto old routine
- ARM(		ldrb	r3, [r0, r2, lsr #3]	)
- THUMB(		lsr	r3, r2, #3		)
- THUMB(		ldrb	r3, [r0, r3]		)
-		eor	r3, r3, #0xff		@ now looking for a 1 bit
-		movs	r3, r3, lsr ip		@ shift off unused bits
-		bne	.L_found
-		orr	r2, r2, #7		@ if zero, then no bits here
-		add	r2, r2, #1		@ align bit pointer
-		b	2b			@ loop for next bit
-ENDPROC(_find_next_zero_bit_le)
-
-/*
- * Purpose  : Find a 'one' bit
- * Prototype: int find_first_bit(const unsigned long *addr, unsigned int maxbit);
- */
-ENTRY(_find_first_bit_le)
-		teq	r1, #0	
-		beq	3f
-		mov	r2, #0
-1:
- ARM(		ldrb	r3, [r0, r2, lsr #3]	)
- THUMB(		lsr	r3, r2, #3		)
- THUMB(		ldrb	r3, [r0, r3]		)
-		movs	r3, r3
-		bne	.L_found		@ any now set - found zero bit
-		add	r2, r2, #8		@ next bit pointer
-2:		cmp	r2, r1			@ any more?
-		blo	1b
-3:		mov	r0, r1			@ no free bits
-		mov	pc, lr
-ENDPROC(_find_first_bit_le)
-
-/*
- * Purpose  : Find next 'one' bit
- * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
- */
-ENTRY(_find_next_bit_le)
-		teq	r1, #0
-		beq	3b
-		ands	ip, r2, #7
-		beq	1b			@ If new byte, goto old routine
- ARM(		ldrb	r3, [r0, r2, lsr #3]	)
- THUMB(		lsr	r3, r2, #3		)
- THUMB(		ldrb	r3, [r0, r3]		)
-		movs	r3, r3, lsr ip		@ shift off unused bits
-		bne	.L_found
-		orr	r2, r2, #7		@ if zero, then no bits here
-		add	r2, r2, #1		@ align bit pointer
-		b	2b			@ loop for next bit
-ENDPROC(_find_next_bit_le)
-
-#ifdef __ARMEB__
-
-ENTRY(_find_first_zero_bit_be)
-		teq	r1, #0
-		beq	3f
-		mov	r2, #0
-1:		eor	r3, r2, #0x18		@ big endian byte ordering
- ARM(		ldrb	r3, [r0, r3, lsr #3]	)
- THUMB(		lsr	r3, #3			)
- THUMB(		ldrb	r3, [r0, r3]		)
-		eors	r3, r3, #0xff		@ invert bits
-		bne	.L_found		@ any now set - found zero bit
-		add	r2, r2, #8		@ next bit pointer
-2:		cmp	r2, r1			@ any more?
-		blo	1b
-3:		mov	r0, r1			@ no free bits
-		mov	pc, lr
-ENDPROC(_find_first_zero_bit_be)
-
-ENTRY(_find_next_zero_bit_be)
-		teq	r1, #0
-		beq	3b
-		ands	ip, r2, #7
-		beq	1b			@ If new byte, goto old routine
-		eor	r3, r2, #0x18		@ big endian byte ordering
- ARM(		ldrb	r3, [r0, r3, lsr #3]	)
- THUMB(		lsr	r3, #3			)
- THUMB(		ldrb	r3, [r0, r3]		)
-		eor	r3, r3, #0xff		@ now looking for a 1 bit
-		movs	r3, r3, lsr ip		@ shift off unused bits
-		bne	.L_found
-		orr	r2, r2, #7		@ if zero, then no bits here
-		add	r2, r2, #1		@ align bit pointer
-		b	2b			@ loop for next bit
-ENDPROC(_find_next_zero_bit_be)
-
-ENTRY(_find_first_bit_be)
-		teq	r1, #0
-		beq	3f
-		mov	r2, #0
-1:		eor	r3, r2, #0x18		@ big endian byte ordering
- ARM(		ldrb	r3, [r0, r3, lsr #3]	)
- THUMB(		lsr	r3, #3			)
- THUMB(		ldrb	r3, [r0, r3]		)
-		movs	r3, r3
-		bne	.L_found		@ any now set - found zero bit
-		add	r2, r2, #8		@ next bit pointer
-2:		cmp	r2, r1			@ any more?
-		blo	1b
-3:		mov	r0, r1			@ no free bits
-		mov	pc, lr
-ENDPROC(_find_first_bit_be)
-
-ENTRY(_find_next_bit_be)
-		teq	r1, #0
-		beq	3b
-		ands	ip, r2, #7
-		beq	1b			@ If new byte, goto old routine
-		eor	r3, r2, #0x18		@ big endian byte ordering
- ARM(		ldrb	r3, [r0, r3, lsr #3]	)
- THUMB(		lsr	r3, #3			)
- THUMB(		ldrb	r3, [r0, r3]		)
-		movs	r3, r3, lsr ip		@ shift off unused bits
-		bne	.L_found
-		orr	r2, r2, #7		@ if zero, then no bits here
-		add	r2, r2, #1		@ align bit pointer
-		b	2b			@ loop for next bit
-ENDPROC(_find_next_bit_be)
-
-#endif
-
-/*
- * One or more bits in the LSB of r3 are assumed to be set.
- */
-.L_found:
-#if __LINUX_ARM_ARCH__ >= 5
-		rsb	r0, r3, #0
-		and	r3, r3, r0
-		clz	r3, r3
-		rsb	r3, r3, #31
-		add	r0, r2, r3
-#else
-		tst	r3, #0x0f
-		addeq	r2, r2, #4
-		movne	r3, r3, lsl #4
-		tst	r3, #0x30
-		addeq	r2, r2, #2
-		movne	r3, r3, lsl #2
-		tst	r3, #0x40
-		addeq	r2, r2, #1
-		mov	r0, r2
-#endif
-		cmp	r1, r0			@ Clamp to maxbit
-		movlo	r0, r1
-		mov	pc, lr
-
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/lib1funcs.S
--- a/xen/arch/arm/lib/lib1funcs.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,389 +0,0 @@
-/*
- * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
- *
- * Author: Nicolas Pitre <nico@fluxnic.net>
- *   - contributed to gcc-3.4 on Sep 30, 2003
- *   - adapted for the Linux kernel on Oct 2, 2003
- */
-
-/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
-
-This file is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file into combinations with other programs,
-and to distribute those combinations without any restriction coming
-from the use of this file.  (The General Public License restrictions
-do apply in other respects; for example, they cover modification of
-the file, and distribution when not linked into a combine
-executable.)
-
-This file is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-
-#include <xen/config.h>
-#include "assembler.h"
-
-.macro ARM_DIV_BODY dividend, divisor, result, curbit
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	\curbit, \divisor
-	clz	\result, \dividend
-	sub	\result, \curbit, \result
-	mov	\curbit, #1
-	mov	\divisor, \divisor, lsl \result
-	mov	\curbit, \curbit, lsl \result
-	mov	\result, #0
-	
-#else
-
-	@ Initially shift the divisor left 3 bits if possible,
-	@ set curbit accordingly.  This allows for curbit to be located
-	@ at the left end of each 4 bit nibbles in the division loop
-	@ to save one loop in most cases.
-	tst	\divisor, #0xe0000000
-	moveq	\divisor, \divisor, lsl #3
-	moveq	\curbit, #8
-	movne	\curbit, #1
-
-	@ Unless the divisor is very big, shift it up in multiples of
-	@ four bits, since this is the amount of unwinding in the main
-	@ division loop.  Continue shifting until the divisor is 
-	@ larger than the dividend.
-1:	cmp	\divisor, #0x10000000
-	cmplo	\divisor, \dividend
-	movlo	\divisor, \divisor, lsl #4
-	movlo	\curbit, \curbit, lsl #4
-	blo	1b
-
-	@ For very big divisors, we must shift it a bit at a time, or
-	@ we will be in danger of overflowing.
-1:	cmp	\divisor, #0x80000000
-	cmplo	\divisor, \dividend
-	movlo	\divisor, \divisor, lsl #1
-	movlo	\curbit, \curbit, lsl #1
-	blo	1b
-
-	mov	\result, #0
-
-#endif
-
-	@ Division loop
-1:	cmp	\dividend, \divisor
-	subhs	\dividend, \dividend, \divisor
-	orrhs	\result,   \result,   \curbit
-	cmp	\dividend, \divisor,  lsr #1
-	subhs	\dividend, \dividend, \divisor, lsr #1
-	orrhs	\result,   \result,   \curbit,  lsr #1
-	cmp	\dividend, \divisor,  lsr #2
-	subhs	\dividend, \dividend, \divisor, lsr #2
-	orrhs	\result,   \result,   \curbit,  lsr #2
-	cmp	\dividend, \divisor,  lsr #3
-	subhs	\dividend, \dividend, \divisor, lsr #3
-	orrhs	\result,   \result,   \curbit,  lsr #3
-	cmp	\dividend, #0			@ Early termination?
-	movnes	\curbit,   \curbit,  lsr #4	@ No, any more bits to do?
-	movne	\divisor,  \divisor, lsr #4
-	bne	1b
-
-.endm
-
-
-.macro ARM_DIV2_ORDER divisor, order
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	\order, \divisor
-	rsb	\order, \order, #31
-
-#else
-
-	cmp	\divisor, #(1 << 16)
-	movhs	\divisor, \divisor, lsr #16
-	movhs	\order, #16
-	movlo	\order, #0
-
-	cmp	\divisor, #(1 << 8)
-	movhs	\divisor, \divisor, lsr #8
-	addhs	\order, \order, #8
-
-	cmp	\divisor, #(1 << 4)
-	movhs	\divisor, \divisor, lsr #4
-	addhs	\order, \order, #4
-
-	cmp	\divisor, #(1 << 2)
-	addhi	\order, \order, #3
-	addls	\order, \order, \divisor, lsr #1
-
-#endif
-
-.endm
-
-
-.macro ARM_MOD_BODY dividend, divisor, order, spare
-
-#if __LINUX_ARM_ARCH__ >= 5
-
-	clz	\order, \divisor
-	clz	\spare, \dividend
-	sub	\order, \order, \spare
-	mov	\divisor, \divisor, lsl \order
-
-#else
-
-	mov	\order, #0
-
-	@ Unless the divisor is very big, shift it up in multiples of
-	@ four bits, since this is the amount of unwinding in the main
-	@ division loop.  Continue shifting until the divisor is 
-	@ larger than the dividend.
-1:	cmp	\divisor, #0x10000000
-	cmplo	\divisor, \dividend
-	movlo	\divisor, \divisor, lsl #4
-	addlo	\order, \order, #4
-	blo	1b
-
-	@ For very big divisors, we must shift it a bit at a time, or
-	@ we will be in danger of overflowing.
-1:	cmp	\divisor, #0x80000000
-	cmplo	\divisor, \dividend
-	movlo	\divisor, \divisor, lsl #1
-	addlo	\order, \order, #1
-	blo	1b
-
-#endif
-
-	@ Perform all needed substractions to keep only the reminder.
-	@ Do comparisons in batch of 4 first.
-	subs	\order, \order, #3		@ yes, 3 is intended here
-	blt	2f
-
-1:	cmp	\dividend, \divisor
-	subhs	\dividend, \dividend, \divisor
-	cmp	\dividend, \divisor,  lsr #1
-	subhs	\dividend, \dividend, \divisor, lsr #1
-	cmp	\dividend, \divisor,  lsr #2
-	subhs	\dividend, \dividend, \divisor, lsr #2
-	cmp	\dividend, \divisor,  lsr #3
-	subhs	\dividend, \dividend, \divisor, lsr #3
-	cmp	\dividend, #1
-	mov	\divisor, \divisor, lsr #4
-	subges	\order, \order, #4
-	bge	1b
-
-	tst	\order, #3
-	teqne	\dividend, #0
-	beq	5f
-
-	@ Either 1, 2 or 3 comparison/substractions are left.
-2:	cmn	\order, #2
-	blt	4f
-	beq	3f
-	cmp	\dividend, \divisor
-	subhs	\dividend, \dividend, \divisor
-	mov	\divisor,  \divisor,  lsr #1
-3:	cmp	\dividend, \divisor
-	subhs	\dividend, \dividend, \divisor
-	mov	\divisor,  \divisor,  lsr #1
-4:	cmp	\dividend, \divisor
-	subhs	\dividend, \dividend, \divisor
-5:
-.endm
-
-
-ENTRY(__udivsi3)
-ENTRY(__aeabi_uidiv)
-UNWIND(.fnstart)
-
-	subs	r2, r1, #1
-	moveq	pc, lr
-	bcc	Ldiv0
-	cmp	r0, r1
-	bls	11f
-	tst	r1, r2
-	beq	12f
-
-	ARM_DIV_BODY r0, r1, r2, r3
-
-	mov	r0, r2
-	mov	pc, lr
-
-11:	moveq	r0, #1
-	movne	r0, #0
-	mov	pc, lr
-
-12:	ARM_DIV2_ORDER r1, r2
-
-	mov	r0, r0, lsr r2
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__udivsi3)
-ENDPROC(__aeabi_uidiv)
-
-ENTRY(__umodsi3)
-UNWIND(.fnstart)
-
-	subs	r2, r1, #1			@ compare divisor with 1
-	bcc	Ldiv0
-	cmpne	r0, r1				@ compare dividend with divisor
-	moveq   r0, #0
-	tsthi	r1, r2				@ see if divisor is power of 2
-	andeq	r0, r0, r2
-	movls	pc, lr
-
-	ARM_MOD_BODY r0, r1, r2, r3
-
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__umodsi3)
-
-ENTRY(__divsi3)
-ENTRY(__aeabi_idiv)
-UNWIND(.fnstart)
-
-	cmp	r1, #0
-	eor	ip, r0, r1			@ save the sign of the result.
-	beq	Ldiv0
-	rsbmi	r1, r1, #0			@ loops below use unsigned.
-	subs	r2, r1, #1			@ division by 1 or -1 ?
-	beq	10f
-	movs	r3, r0
-	rsbmi	r3, r0, #0			@ positive dividend value
-	cmp	r3, r1
-	bls	11f
-	tst	r1, r2				@ divisor is power of 2 ?
-	beq	12f
-
-	ARM_DIV_BODY r3, r1, r0, r2
-
-	cmp	ip, #0
-	rsbmi	r0, r0, #0
-	mov	pc, lr
-
-10:	teq	ip, r0				@ same sign ?
-	rsbmi	r0, r0, #0
-	mov	pc, lr
-
-11:	movlo	r0, #0
-	moveq	r0, ip, asr #31
-	orreq	r0, r0, #1
-	mov	pc, lr
-
-12:	ARM_DIV2_ORDER r1, r2
-
-	cmp	ip, #0
-	mov	r0, r3, lsr r2
-	rsbmi	r0, r0, #0
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__divsi3)
-ENDPROC(__aeabi_idiv)
-
-ENTRY(__modsi3)
-UNWIND(.fnstart)
-
-	cmp	r1, #0
-	beq	Ldiv0
-	rsbmi	r1, r1, #0			@ loops below use unsigned.
-	movs	ip, r0				@ preserve sign of dividend
-	rsbmi	r0, r0, #0			@ if negative make positive
-	subs	r2, r1, #1			@ compare divisor with 1
-	cmpne	r0, r1				@ compare dividend with divisor
-	moveq	r0, #0
-	tsthi	r1, r2				@ see if divisor is power of 2
-	andeq	r0, r0, r2
-	bls	10f
-
-	ARM_MOD_BODY r0, r1, r2, r3
-
-10:	cmp	ip, #0
-	rsbmi	r0, r0, #0
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__modsi3)
-
-#ifdef CONFIG_AEABI
-
-ENTRY(__aeabi_uidivmod)
-UNWIND(.fnstart)
-UNWIND(.save {r0, r1, ip, lr}	)
-
-	stmfd	sp!, {r0, r1, ip, lr}
-	bl	__aeabi_uidiv
-	ldmfd	sp!, {r1, r2, ip, lr}
-	mul	r3, r0, r2
-	sub	r1, r1, r3
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__aeabi_uidivmod)
-
-ENTRY(__aeabi_idivmod)
-UNWIND(.fnstart)
-UNWIND(.save {r0, r1, ip, lr}	)
-	stmfd	sp!, {r0, r1, ip, lr}
-	bl	__aeabi_idiv
-	ldmfd	sp!, {r1, r2, ip, lr}
-	mul	r3, r0, r2
-	sub	r1, r1, r3
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__aeabi_idivmod)
-
-ENTRY(__aeabi_uldivmod)
-UNWIND(.fnstart)
-UNWIND(.save {lr}	)
-	sub sp, sp, #8
-	stmfd   sp!, {sp, lr}
-	bl __qdivrem
-	ldr lr, [sp, #4]
-	add sp, sp, #8
-	ldmfd sp!, {r2, r3}
-	mov	pc, lr
-
-UNWIND(.fnend)
-ENDPROC(__aeabi_uldivmod)
-
-ENTRY(__aeabi_ldivmod)
-UNWIND(.fnstart)
-UNWIND(.save {lr}	)
-	sub sp, sp, #16
-	stmfd   sp!, {sp, lr}
-	bl __ldivmod_helper
-	ldr lr, [sp, #4]
-	add sp, sp, #16
-	ldmfd	sp!, {r2, r3}
-	mov	pc, lr
-	
-UNWIND(.fnend)
-ENDPROC(__aeabi_ldivmod)
-#endif
-
-Ldiv0:
-UNWIND(.fnstart)
-UNWIND(.pad #4)
-UNWIND(.save {lr})
-	str	lr, [sp, #-8]!
-	bl	__div0
-	mov	r0, #0			@ About as wrong as it could be.
-	ldr	pc, [sp], #8
-UNWIND(.fnend)
-ENDPROC(Ldiv0)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/lshrdi3.S
--- a/xen/arch/arm/lib/lshrdi3.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
-   Free Software Foundation, Inc.
-
-This file is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file into combinations with other programs,
-and to distribute those combinations without any restriction coming
-from the use of this file.  (The General Public License restrictions
-do apply in other respects; for example, they cover modification of
-the file, and distribution when not linked into a combine
-executable.)
-
-This file is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; see the file COPYING.  If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
-
-
-#include <xen/config.h>
-#include "assembler.h"
-
-#ifdef __ARMEB__
-#define al r1
-#define ah r0
-#else
-#define al r0
-#define ah r1
-#endif
-
-ENTRY(__lshrdi3)
-ENTRY(__aeabi_llsr)
-
-	subs	r3, r2, #32
-	rsb	ip, r2, #32
-	movmi	al, al, lsr r2
-	movpl	al, ah, lsr r3
- ARM(	orrmi	al, al, ah, lsl ip	)
- THUMB(	lslmi	r3, ah, ip		)
- THUMB(	orrmi	al, al, r3		)
-	mov	ah, ah, lsr r2
-	mov	pc, lr
-
-ENDPROC(__lshrdi3)
-ENDPROC(__aeabi_llsr)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/memcpy.S
--- a/xen/arch/arm/lib/memcpy.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- *  linux/arch/arm/lib/memcpy.S
- *
- *  Author:	Nicolas Pitre
- *  Created:	Sep 28, 2005
- *  Copyright:	MontaVista Software, Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- */
-
-#include <xen/config.h>
-#include "assembler.h"
-
-#define LDR1W_SHIFT	0
-#define STR1W_SHIFT	0
-
-	.macro ldr1w ptr reg abort
-	W(ldr) \reg, [\ptr], #4
-	.endm
-
-	.macro ldr4w ptr reg1 reg2 reg3 reg4 abort
-	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4}
-	.endm
-
-	.macro ldr8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
-	ldmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
-	.endm
-
-	.macro ldr1b ptr reg cond=al abort
-	ldr\cond\()b \reg, [\ptr], #1
-	.endm
-
-	.macro str1w ptr reg abort
-	W(str) \reg, [\ptr], #4
-	.endm
-
-	.macro str8w ptr reg1 reg2 reg3 reg4 reg5 reg6 reg7 reg8 abort
-	stmia \ptr!, {\reg1, \reg2, \reg3, \reg4, \reg5, \reg6, \reg7, \reg8}
-	.endm
-
-	.macro str1b ptr reg cond=al abort
-	str\cond\()b \reg, [\ptr], #1
-	.endm
-
-	.macro enter reg1 reg2
-	stmdb sp!, {r0, \reg1, \reg2}
-	.endm
-
-	.macro exit reg1 reg2
-	ldmfd sp!, {r0, \reg1, \reg2}
-	.endm
-
-	.text
-
-/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
-
-ENTRY(memcpy)
-
-#include "copy_template.S"
-
-ENDPROC(memcpy)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/memmove.S
--- a/xen/arch/arm/lib/memmove.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
- *  linux/arch/arm/lib/memmove.S
- *
- *  Author:	Nicolas Pitre
- *  Created:	Sep 28, 2005
- *  Copyright:	(C) MontaVista Software Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- */
-
-#include <xen/config.h>
-
-#include "assembler.h"
-
-		.text
-
-/*
- * Prototype: void *memmove(void *dest, const void *src, size_t n);
- *
- * Note:
- *
- * If the memory regions don't overlap, we simply branch to memcpy which is
- * normally a bit faster. Otherwise the copy is done going downwards.  This
- * is a transposition of the code from copy_template.S but with the copy
- * occurring in the opposite direction.
- */
-
-ENTRY(memmove)
-
-		subs	ip, r0, r1
-		cmphi	r2, ip
-		bls	memcpy
-
-		stmfd	sp!, {r0, r4, lr}
-		add	r1, r1, r2
-		add	r0, r0, r2
-		subs	r2, r2, #4
-		blt	8f
-		ands	ip, r0, #3
-	PLD(	pld	[r1, #-4]		)
-		bne	9f
-		ands	ip, r1, #3
-		bne	10f
-
-1:		subs	r2, r2, #(28)
-		stmfd	sp!, {r5 - r8}
-		blt	5f
-
-	CALGN(	ands	ip, r0, #31		)
-	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
-	CALGN(	bcs	2f			)
-	CALGN(	adr	r4, 6f			)
-	CALGN(	subs	r2, r2, ip		)  @ C is set here
-	CALGN(	rsb	ip, ip, #32		)
-	CALGN(	add	pc, r4, ip		)
-
-	PLD(	pld	[r1, #-4]		)
-2:	PLD(	subs	r2, r2, #96		)
-	PLD(	pld	[r1, #-32]		)
-	PLD(	blt	4f			)
-	PLD(	pld	[r1, #-64]		)
-	PLD(	pld	[r1, #-96]		)
-
-3:	PLD(	pld	[r1, #-128]		)
-4:		ldmdb	r1!, {r3, r4, r5, r6, r7, r8, ip, lr}
-		subs	r2, r2, #32
-		stmdb	r0!, {r3, r4, r5, r6, r7, r8, ip, lr}
-		bge	3b
-	PLD(	cmn	r2, #96			)
-	PLD(	bge	4b			)
-
-5:		ands	ip, r2, #28
-		rsb	ip, ip, #32
-		addne	pc, pc, ip		@ C is always clear here
-		b	7f
-6:		W(nop)
-		W(ldr)	r3, [r1, #-4]!
-		W(ldr)	r4, [r1, #-4]!
-		W(ldr)	r5, [r1, #-4]!
-		W(ldr)	r6, [r1, #-4]!
-		W(ldr)	r7, [r1, #-4]!
-		W(ldr)	r8, [r1, #-4]!
-		W(ldr)	lr, [r1, #-4]!
-
-		add	pc, pc, ip
-		nop
-		W(nop)
-		W(str)	r3, [r0, #-4]!
-		W(str)	r4, [r0, #-4]!
-		W(str)	r5, [r0, #-4]!
-		W(str)	r6, [r0, #-4]!
-		W(str)	r7, [r0, #-4]!
-		W(str)	r8, [r0, #-4]!
-		W(str)	lr, [r0, #-4]!
-
-	CALGN(	bcs	2b			)
-
-7:		ldmfd	sp!, {r5 - r8}
-
-8:		movs	r2, r2, lsl #31
-		ldrneb	r3, [r1, #-1]!
-		ldrcsb	r4, [r1, #-1]!
-		ldrcsb	ip, [r1, #-1]
-		strneb	r3, [r0, #-1]!
-		strcsb	r4, [r0, #-1]!
-		strcsb	ip, [r0, #-1]
-		ldmfd	sp!, {r0, r4, pc}
-
-9:		cmp	ip, #2
-		ldrgtb	r3, [r1, #-1]!
-		ldrgeb	r4, [r1, #-1]!
-		ldrb	lr, [r1, #-1]!
-		strgtb	r3, [r0, #-1]!
-		strgeb	r4, [r0, #-1]!
-		subs	r2, r2, ip
-		strb	lr, [r0, #-1]!
-		blt	8b
-		ands	ip, r1, #3
-		beq	1b
-
-10:		bic	r1, r1, #3
-		cmp	ip, #2
-		ldr	r3, [r1, #0]
-		beq	17f
-		blt	18f
-
-
-		.macro	backward_copy_shift push pull
-
-		subs	r2, r2, #28
-		blt	14f
-
-	CALGN(	ands	ip, r0, #31		)
-	CALGN(	sbcnes	r4, ip, r2		)  @ C is always set here
-	CALGN(	subcc	r2, r2, ip		)
-	CALGN(	bcc	15f			)
-
-11:		stmfd	sp!, {r5 - r9}
-
-	PLD(	pld	[r1, #-4]		)
-	PLD(	subs	r2, r2, #96		)
-	PLD(	pld	[r1, #-32]		)
-	PLD(	blt	13f			)
-	PLD(	pld	[r1, #-64]		)
-	PLD(	pld	[r1, #-96]		)
-
-12:	PLD(	pld	[r1, #-128]		)
-13:		ldmdb   r1!, {r7, r8, r9, ip}
-		mov     lr, r3, push #\push
-		subs    r2, r2, #32
-		ldmdb   r1!, {r3, r4, r5, r6}
-		orr     lr, lr, ip, pull #\pull
-		mov     ip, ip, push #\push
-		orr     ip, ip, r9, pull #\pull
-		mov     r9, r9, push #\push
-		orr     r9, r9, r8, pull #\pull
-		mov     r8, r8, push #\push
-		orr     r8, r8, r7, pull #\pull
-		mov     r7, r7, push #\push
-		orr     r7, r7, r6, pull #\pull
-		mov     r6, r6, push #\push
-		orr     r6, r6, r5, pull #\pull
-		mov     r5, r5, push #\push
-		orr     r5, r5, r4, pull #\pull
-		mov     r4, r4, push #\push
-		orr     r4, r4, r3, pull #\pull
-		stmdb   r0!, {r4 - r9, ip, lr}
-		bge	12b
-	PLD(	cmn	r2, #96			)
-	PLD(	bge	13b			)
-
-		ldmfd	sp!, {r5 - r9}
-
-14:		ands	ip, r2, #28
-		beq	16f
-
-15:		mov     lr, r3, push #\push
-		ldr	r3, [r1, #-4]!
-		subs	ip, ip, #4
-		orr	lr, lr, r3, pull #\pull
-		str	lr, [r0, #-4]!
-		bgt	15b
-	CALGN(	cmp	r2, #0			)
-	CALGN(	bge	11b			)
-
-16:		add	r1, r1, #(\pull / 8)
-		b	8b
-
-		.endm
-
-
-		backward_copy_shift	push=8	pull=24
-
-17:		backward_copy_shift	push=16	pull=16
-
-18:		backward_copy_shift	push=24	pull=8
-
-ENDPROC(memmove)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/memset.S
--- a/xen/arch/arm/lib/memset.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-/*
- *  linux/arch/arm/lib/memset.S
- *
- *  Copyright (C) 1995-2000 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- *  ASM optimised string functions
- */
-
-#include <xen/config.h>
-
-#include "assembler.h"
-
-	.text
-	.align	5
-	.word	0
-
-1:	subs	r2, r2, #4		@ 1 do we have enough
-	blt	5f			@ 1 bytes to align with?
-	cmp	r3, #2			@ 1
-	strltb	r1, [r0], #1		@ 1
-	strleb	r1, [r0], #1		@ 1
-	strb	r1, [r0], #1		@ 1
-	add	r2, r2, r3		@ 1 (r2 = r2 - (4 - r3))
-/*
- * The pointer is now aligned and the length is adjusted.  Try doing the
- * memset again.
- */
-
-ENTRY(memset)
-	ands	r3, r0, #3		@ 1 unaligned?
-	bne	1b			@ 1
-/*
- * we know that the pointer in r0 is aligned to a word boundary.
- */
-	orr	r1, r1, r1, lsl #8
-	orr	r1, r1, r1, lsl #16
-	mov	r3, r1
-	cmp	r2, #16
-	blt	4f
-
-#if ! CALGN(1)+0
-
-/*
- * We need an extra register for this loop - save the return address and
- * use the LR
- */
-	str	lr, [sp, #-4]!
-	mov	ip, r1
-	mov	lr, r1
-
-2:	subs	r2, r2, #64
-	stmgeia	r0!, {r1, r3, ip, lr}	@ 64 bytes at a time.
-	stmgeia	r0!, {r1, r3, ip, lr}
-	stmgeia	r0!, {r1, r3, ip, lr}
-	stmgeia	r0!, {r1, r3, ip, lr}
-	bgt	2b
-	ldmeqfd	sp!, {pc}		@ Now <64 bytes to go.
-/*
- * No need to correct the count; we're only testing bits from now on
- */
-	tst	r2, #32
-	stmneia	r0!, {r1, r3, ip, lr}
-	stmneia	r0!, {r1, r3, ip, lr}
-	tst	r2, #16
-	stmneia	r0!, {r1, r3, ip, lr}
-	ldr	lr, [sp], #4
-
-#else
-
-/*
- * This version aligns the destination pointer in order to write
- * whole cache lines at once.
- */
-
-	stmfd	sp!, {r4-r7, lr}
-	mov	r4, r1
-	mov	r5, r1
-	mov	r6, r1
-	mov	r7, r1
-	mov	ip, r1
-	mov	lr, r1
-
-	cmp	r2, #96
-	tstgt	r0, #31
-	ble	3f
-
-	and	ip, r0, #31
-	rsb	ip, ip, #32
-	sub	r2, r2, ip
-	movs	ip, ip, lsl #(32 - 4)
-	stmcsia	r0!, {r4, r5, r6, r7}
-	stmmiia	r0!, {r4, r5}
-	tst	ip, #(1 << 30)
-	mov	ip, r1
-	strne	r1, [r0], #4
-
-3:	subs	r2, r2, #64
-	stmgeia	r0!, {r1, r3-r7, ip, lr}
-	stmgeia	r0!, {r1, r3-r7, ip, lr}
-	bgt	3b
-	ldmeqfd	sp!, {r4-r7, pc}
-
-	tst	r2, #32
-	stmneia	r0!, {r1, r3-r7, ip, lr}
-	tst	r2, #16
-	stmneia	r0!, {r4-r7}
-	ldmfd	sp!, {r4-r7, lr}
-
-#endif
-
-4:	tst	r2, #8
-	stmneia	r0!, {r1, r3}
-	tst	r2, #4
-	strne	r1, [r0], #4
-/*
- * When we get here, we've got less than 4 bytes to zero.  We
- * may have an unaligned pointer as well.
- */
-5:	tst	r2, #2
-	strneb	r1, [r0], #1
-	strneb	r1, [r0], #1
-	tst	r2, #1
-	strneb	r1, [r0], #1
-	mov	pc, lr
-ENDPROC(memset)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/memzero.S
--- a/xen/arch/arm/lib/memzero.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
- *  linux/arch/arm/lib/memzero.S
- *
- *  Copyright (C) 1995-2000 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <xen/config.h>
-
-#include "assembler.h"
-
-	.text
-	.align	5
-	.word	0
-/*
- * Align the pointer in r0.  r3 contains the number of bytes that we are
- * mis-aligned by, and r1 is the number of bytes.  If r1 < 4, then we
- * don't bother; we use byte stores instead.
- */
-1:	subs	r1, r1, #4		@ 1 do we have enough
-	blt	5f			@ 1 bytes to align with?
-	cmp	r3, #2			@ 1
-	strltb	r2, [r0], #1		@ 1
-	strleb	r2, [r0], #1		@ 1
-	strb	r2, [r0], #1		@ 1
-	add	r1, r1, r3		@ 1 (r1 = r1 - (4 - r3))
-/*
- * The pointer is now aligned and the length is adjusted.  Try doing the
- * memzero again.
- */
-
-ENTRY(__memzero)
-	mov	r2, #0			@ 1
-	ands	r3, r0, #3		@ 1 unaligned?
-	bne	1b			@ 1
-/*
- * r3 = 0, and we know that the pointer in r0 is aligned to a word boundary.
- */
-	cmp	r1, #16			@ 1 we can skip this chunk if we
-	blt	4f			@ 1 have < 16 bytes
-
-#if ! CALGN(1)+0
-
-/*
- * We need an extra register for this loop - save the return address and
- * use the LR
- */
-	str	lr, [sp, #-4]!		@ 1
-	mov	ip, r2			@ 1
-	mov	lr, r2			@ 1
-
-3:	subs	r1, r1, #64		@ 1 write 32 bytes out per loop
-	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
-	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
-	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
-	stmgeia	r0!, {r2, r3, ip, lr}	@ 4
-	bgt	3b			@ 1
-	ldmeqfd	sp!, {pc}		@ 1/2 quick exit
-/*
- * No need to correct the count; we're only testing bits from now on
- */
-	tst	r1, #32			@ 1
-	stmneia	r0!, {r2, r3, ip, lr}	@ 4
-	stmneia	r0!, {r2, r3, ip, lr}	@ 4
-	tst	r1, #16			@ 1 16 bytes or more?
-	stmneia	r0!, {r2, r3, ip, lr}	@ 4
-	ldr	lr, [sp], #4		@ 1
-
-#else
-
-/*
- * This version aligns the destination pointer in order to write
- * whole cache lines at once.
- */
-
-	stmfd	sp!, {r4-r7, lr}
-	mov	r4, r2
-	mov	r5, r2
-	mov	r6, r2
-	mov	r7, r2
-	mov	ip, r2
-	mov	lr, r2
-
-	cmp	r1, #96
-	andgts	ip, r0, #31
-	ble	3f
-
-	rsb	ip, ip, #32
-	sub	r1, r1, ip
-	movs	ip, ip, lsl #(32 - 4)
-	stmcsia	r0!, {r4, r5, r6, r7}
-	stmmiia	r0!, {r4, r5}
-	movs	ip, ip, lsl #2
-	strcs	r2, [r0], #4
-
-3:	subs	r1, r1, #64
-	stmgeia	r0!, {r2-r7, ip, lr}
-	stmgeia	r0!, {r2-r7, ip, lr}
-	bgt	3b
-	ldmeqfd	sp!, {r4-r7, pc}
-
-	tst	r1, #32
-	stmneia	r0!, {r2-r7, ip, lr}
-	tst	r1, #16
-	stmneia	r0!, {r4-r7}
-	ldmfd	sp!, {r4-r7, lr}
-
-#endif
-
-4:	tst	r1, #8			@ 1 8 bytes or more?
-	stmneia	r0!, {r2, r3}		@ 2
-	tst	r1, #4			@ 1 4 bytes or more?
-	strne	r2, [r0], #4		@ 1
-/*
- * When we get here, we've got less than 4 bytes to zero.  We
- * may have an unaligned pointer as well.
- */
-5:	tst	r1, #2			@ 1 2 bytes or more?
-	strneb	r2, [r0], #1		@ 1
-	strneb	r2, [r0], #1		@ 1
-	tst	r1, #1			@ 1 a byte left over
-	strneb	r2, [r0], #1		@ 1
-	mov	pc, lr			@ 1
-ENDPROC(__memzero)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/setbit.S
--- a/xen/arch/arm/lib/setbit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- *  linux/arch/arm/lib/setbit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-	.text
-
-ENTRY(_set_bit)
-	bitop	orr
-ENDPROC(_set_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/testchangebit.S
--- a/xen/arch/arm/lib/testchangebit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- *  linux/arch/arm/lib/testchangebit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-                .text
-
-ENTRY(_test_and_change_bit)
-	testop	eor, str
-ENDPROC(_test_and_change_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/testclearbit.S
--- a/xen/arch/arm/lib/testclearbit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- *  linux/arch/arm/lib/testclearbit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-                .text
-
-ENTRY(_test_and_clear_bit)
-	testop	bicne, strne
-ENDPROC(_test_and_clear_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/lib/testsetbit.S
--- a/xen/arch/arm/lib/testsetbit.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
- *  linux/arch/arm/lib/testsetbit.S
- *
- *  Copyright (C) 1995-1996 Russell King
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <xen/config.h>
-
-#include "assembler.h"
-#include "bitops.h"
-                .text
-
-ENTRY(_test_and_set_bit)
-	testop	orreq, streq
-ENDPROC(_test_and_set_bit)
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/mode_switch.S
--- a/xen/arch/arm/mode_switch.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
- * xen/arch/arm/mode_switch.S
- *
- * Start-of day code to take a CPU from Secure mode to Hyp mode.
- *
- * Tim Deegan <tim@xen.org>
- * Copyright (c) 2011-2012 Citrix Systems.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <asm/config.h>
-#include <asm/page.h>
-#include <asm/platform_vexpress.h>
-#include <asm/asm_defns.h>
-#include "gic.h"
-
-
-/* XXX: Versatile Express specific code */
-/* wake up secondary cpus */
-.globl kick_cpus
-kick_cpus:
-        /* write start paddr to v2m sysreg FLAGSSET register */
-        ldr   r0, =(V2M_SYS_MMIO_BASE)        /* base V2M sysreg MMIO address */
-        dsb
-        mov   r2, #0xffffffff
-        str   r2, [r0, #(V2M_SYS_FLAGSCLR)]
-        dsb
-        ldr   r2, =start
-        add   r2, r2, r10
-        str   r2, [r0, #(V2M_SYS_FLAGSSET)]
-        dsb
-        /* send an interrupt */
-        ldr   r0, =(GIC_BASE_ADDRESS + GIC_DR_OFFSET) /* base GICD MMIO address */
-        mov   r2, #0x1
-        str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
-        mov   r2, #0xfe0000
-        str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
-        dsb
-        str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
-        mov   pc, lr
-
-
-/* Get up a CPU into Hyp mode.  Clobbers r0-r3.
- *
- * Expects r12 == CPU number
- *
- * This code is specific to the VE model, and not intended to be used
- * on production systems.  As such it's a bit hackier than the main
- * boot code in head.S.  In future it will be replaced by better
- * integration with the bootloader/firmware so that Xen always starts
- * in Hyp mode. */
-
-.globl enter_hyp_mode
-enter_hyp_mode:
-        mov   r3, lr                 /* Put return address in non-banked reg */
-        cpsid aif, #0x16             /* Enter Monitor mode */
-        mrc   CP32(r0, SCR)
-        orr   r0, r0, #0x100         /* Set HCE */
-        orr   r0, r0, #0xb1          /* Set SCD, AW, FW and NS */
-        bic   r0, r0, #0xe           /* Clear EA, FIQ and IRQ */
-        mcr   CP32(r0, SCR)
-        /* Ugly: the system timer's frequency register is only
-         * programmable in Secure state.  Since we don't know where its
-         * memory-mapped control registers live, we can't find out the
-         * right frequency.  Use the VE model's default frequency here. */
-        ldr   r0, =0x5f5e100         /* 100 MHz */
-        mcr   CP32(r0, CNTFRQ)
-        ldr   r0, =0x40c00           /* SMP, c11, c10 in non-secure mode */
-        mcr   CP32(r0, NSACR)
-        mov   r0, #GIC_BASE_ADDRESS
-        add   r0, r0, #GIC_DR_OFFSET
-        /* Disable the GIC distributor, on the boot CPU only */
-        mov   r1, #0
-        teq   r12, #0                /* Is this the boot CPU? */
-        streq r1, [r0]
-        /* Continuing ugliness: Set up the GIC so NS state owns interrupts,
-         * The first 32 interrupts (SGIs & PPIs) must be configured on all
-         * CPUs while the remainder are SPIs and only need to be done one, on
-         * the boot CPU. */
-        add   r0, r0, #0x80          /* GICD_IGROUP0 */
-        mov   r2, #0xffffffff        /* All interrupts to group 1 */
-        teq   r12, #0                /* Boot CPU? */
-        str   r2, [r0]               /* Interrupts  0-31 (SGI & PPI) */
-        streq r2, [r0, #4]           /* Interrupts 32-63 (SPI) */
-        streq r2, [r0, #8]           /* Interrupts 64-95 (SPI) */
-        /* Disable the GIC CPU interface on all processors */
-        mov   r0, #GIC_BASE_ADDRESS
-        add   r0, r0, #GIC_CR_OFFSET
-        mov   r1, #0
-        str   r1, [r0]
-        /* Must drop priority mask below 0x80 before entering NS state */
-        ldr   r1, =0xff
-        str   r1, [r0, #0x4]         /* -> GICC_PMR */
-        /* Reset a few config registers */
-        mov   r0, #0
-        mcr   CP32(r0, FCSEIDR)
-        mcr   CP32(r0, CONTEXTIDR)
-        /* Allow non-secure access to coprocessors, FIQs, VFP and NEON */
-        ldr   r1, =0x3fff            /* 14 CP bits set, all others clear */
-        mcr   CP32(r1, NSACR)
-
-        mrs   r0, cpsr               /* Copy the CPSR */
-        add   r0, r0, #0x4           /* 0x16 (Monitor) -> 0x1a (Hyp) */
-        msr   spsr_cxsf, r0          /* into the SPSR */
-        movs  pc, r3                 /* Exception-return into Hyp mode */
-
-/*
- * Local variables:
- * mode: ASM
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/p2m.c
--- a/xen/arch/arm/p2m.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/p2m.c	Wed Dec 19 14:16:30 2012 +0000
@@ -4,7 +4,7 @@
 #include <xen/errno.h>
 #include <xen/domain_page.h>
 #include <asm/flushtlb.h>
-#include "gic.h"
+#include <asm/gic.h>
 
 void dump_p2m_lookup(struct domain *d, paddr_t addr)
 {
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/proc-ca15.S
--- a/xen/arch/arm/proc-ca15.S	Wed Dec 19 14:16:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * xen/arch/arm/proc-ca15.S
- *
- * Cortex A15 specific initializations
- *
- * Copyright (c) 2011 Citrix Systems.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <asm/asm_defns.h>
-#include <asm/processor-ca15.h>
-
-.globl cortex_a15_init
-cortex_a15_init:
-        /* Set up the SMP bit in ACTLR */
-        mrc   CP32(r0, ACTLR)
-        orr   r0, r0, #(ACTLR_CA15_SMP) /* enable SMP bit */
-        mcr   CP32(r0, ACTLR)
-        mov   pc, lr
-
-/*
- * Local variables:
- * mode: ASM
- * indent-tabs-mode: nil
- * End:
- */
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/setup.c	Wed Dec 19 14:16:30 2012 +0000
@@ -39,7 +39,7 @@
 #include <asm/setup.h>
 #include <asm/vfp.h>
 #include <asm/early_printk.h>
-#include "gic.h"
+#include <asm/gic.h>
 
 static __used void init_done(void)
 {
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Wed Dec 19 14:16:30 2012 +0000
@@ -29,7 +29,7 @@
 #include <xen/timer.h>
 #include <xen/irq.h>
 #include <asm/vfp.h>
-#include "gic.h"
+#include <asm/gic.h>
 
 cpumask_t cpu_online_map;
 EXPORT_SYMBOL(cpu_online_map);
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/traps.c	Wed Dec 19 14:16:30 2012 +0000
@@ -35,7 +35,7 @@
 
 #include "io.h"
 #include "vtimer.h"
-#include "gic.h"
+#include <asm/gic.h>
 
 /* The base of the stack must always be double-word aligned, which means
  * that both the kernel half of struct cpu_user_regs (which is pushed in
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/vgic.c
--- a/xen/arch/arm/vgic.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/vgic.c	Wed Dec 19 14:16:30 2012 +0000
@@ -27,7 +27,7 @@
 #include <asm/current.h>
 
 #include "io.h"
-#include "gic.h"
+#include <asm/gic.h>
 
 #define VGIC_DISTR_BASE_ADDRESS 0x000000002c001000
 
diff -r 984086ca8ca0 -r b094ba4bf985 xen/arch/arm/vtimer.c
--- a/xen/arch/arm/vtimer.c	Wed Dec 19 14:16:29 2012 +0000
+++ b/xen/arch/arm/vtimer.c	Wed Dec 19 14:16:30 2012 +0000
@@ -21,7 +21,7 @@
 #include <xen/lib.h>
 #include <xen/timer.h>
 #include <xen/sched.h>
-#include "gic.h"
+#include <asm/gic.h>
 
 extern s_time_t ticks_to_ns(uint64_t ticks);
 extern uint64_t ns_to_ticks(s_time_t ns);
diff -r 984086ca8ca0 -r b094ba4bf985 xen/include/asm-arm/gic.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/asm-arm/gic.h	Wed Dec 19 14:16:30 2012 +0000
@@ -0,0 +1,170 @@
+/*
+ * ARM Generic Interrupt Controller support
+ *
+ * Tim Deegan <tim@xen.org>
+ * Copyright (c) 2011 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ASM_ARM_GIC_H__
+#define __ASM_ARM_GIC_H__
+
+#define GICD_CTLR       (0x000/4)
+#define GICD_TYPER      (0x004/4)
+#define GICD_IIDR       (0x008/4)
+#define GICD_IGROUPR    (0x080/4)
+#define GICD_IGROUPRN   (0x0FC/4)
+#define GICD_ISENABLER  (0x100/4)
+#define GICD_ISENABLERN (0x17C/4)
+#define GICD_ICENABLER  (0x180/4)
+#define GICD_ICENABLERN (0x1fC/4)
+#define GICD_ISPENDR    (0x200/4)
+#define GICD_ISPENDRN   (0x27C/4)
+#define GICD_ICPENDR    (0x280/4)
+#define GICD_ICPENDRN   (0x2FC/4)
+#define GICD_ISACTIVER  (0x300/4)
+#define GICD_ISACTIVERN (0x37C/4)
+#define GICD_ICACTIVER  (0x380/4)
+#define GICD_ICACTIVERN (0x3FC/4)
+#define GICD_IPRIORITYR (0x400/4)
+#define GICD_IPRIORITYRN (0x7F8/4)
+#define GICD_ITARGETSR  (0x800/4)
+#define GICD_ITARGETSRN (0xBF8/4)
+#define GICD_ICFGR      (0xC00/4)
+#define GICD_ICFGRN     (0xCFC/4)
+#define GICD_NSACR      (0xE00/4)
+#define GICD_NSACRN     (0xEFC/4)
+#define GICD_ICPIDR2    (0xFE8/4)
+#define GICD_SGIR       (0xF00/4)
+#define GICD_CPENDSGIR  (0xF10/4)
+#define GICD_CPENDSGIRN (0xF1C/4)
+#define GICD_SPENDSGIR  (0xF20/4)
+#define GICD_SPENDSGIRN (0xF2C/4)
+#define GICD_ICPIDR2    (0xFE8/4)
+
+#define GICC_CTLR       (0x0000/4)
+#define GICC_PMR        (0x0004/4)
+#define GICC_BPR        (0x0008/4)
+#define GICC_IAR        (0x000C/4)
+#define GICC_EOIR       (0x0010/4)
+#define GICC_RPR        (0x0014/4)
+#define GICC_HPPIR      (0x0018/4)
+#define GICC_APR        (0x00D0/4)
+#define GICC_NSAPR      (0x00E0/4)
+#define GICC_DIR        (0x1000/4)
+
+#define GICH_HCR        (0x00/4)
+#define GICH_VTR        (0x04/4)
+#define GICH_VMCR       (0x08/4)
+#define GICH_MISR       (0x10/4)
+#define GICH_EISR0      (0x20/4)
+#define GICH_EISR1      (0x24/4)
+#define GICH_ELSR0      (0x30/4)
+#define GICH_ELSR1      (0x34/4)
+#define GICH_APR        (0xF0/4)
+#define GICH_LR         (0x100/4)
+
+/* Register bits */
+#define GICD_CTL_ENABLE 0x1
+
+#define GICD_TYPE_LINES 0x01f
+#define GICD_TYPE_CPUS  0x0e0
+#define GICD_TYPE_SEC   0x400
+
+#define GICC_CTL_ENABLE 0x1
+#define GICC_CTL_EOI    (0x1 << 9)
+
+#define GICC_IA_IRQ     0x03ff
+#define GICC_IA_CPU     0x1c00
+
+#define GICH_HCR_EN       (1 << 0)
+#define GICH_HCR_UIE      (1 << 1)
+#define GICH_HCR_LRENPIE  (1 << 2)
+#define GICH_HCR_NPIE     (1 << 3)
+#define GICH_HCR_VGRP0EIE (1 << 4)
+#define GICH_HCR_VGRP0DIE (1 << 5)
+#define GICH_HCR_VGRP1EIE (1 << 6)
+#define GICH_HCR_VGRP1DIE (1 << 7)
+
+#define GICH_MISR_EOI     (1 << 0)
+#define GICH_MISR_U       (1 << 1)
+#define GICH_MISR_LRENP   (1 << 2)
+#define GICH_MISR_NP      (1 << 3)
+#define GICH_MISR_VGRP0E  (1 << 4)
+#define GICH_MISR_VGRP0D  (1 << 5)
+#define GICH_MISR_VGRP1E  (1 << 6)
+#define GICH_MISR_VGRP1D  (1 << 7)
+
+#define GICH_LR_VIRTUAL_MASK    0x3ff
+#define GICH_LR_VIRTUAL_SHIFT   0
+#define GICH_LR_PHYSICAL_MASK   0x3ff
+#define GICH_LR_PHYSICAL_SHIFT  10
+#define GICH_LR_STATE_MASK      0x3
+#define GICH_LR_STATE_SHIFT     28
+#define GICH_LR_PRIORITY_SHIFT  23
+#define GICH_LR_MAINTENANCE_IRQ (1<<19)
+#define GICH_LR_PENDING         (1<<28)
+#define GICH_LR_ACTIVE          (1<<29)
+#define GICH_LR_GRP1            (1<<30)
+#define GICH_LR_HW              (1<<31)
+#define GICH_LR_CPUID_SHIFT     9
+#define GICH_VTR_NRLRGS         0x3f
+
+/* XXX: write this into the DT */
+#define VGIC_IRQ_EVTCHN_CALLBACK 31
+
+#ifndef __ASSEMBLY__
+extern int domain_vgic_init(struct domain *d);
+extern void domain_vgic_free(struct domain *d);
+
+extern int vcpu_vgic_init(struct vcpu *v);
+
+extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual);
+extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
+
+extern void gic_route_ppis(void);
+extern void gic_route_spis(void);
+
+extern void gic_inject(void);
+
+extern void __cpuinit init_maintenance_interrupt(void);
+extern void gic_set_guest_irq(struct vcpu *v, unsigned int irq,
+        unsigned int state, unsigned int priority);
+extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
+                                  const char * devname);
+
+/* Accept an interrupt from the GIC and dispatch its handler */
+extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
+/* Bring up the interrupt controller, and report # cpus attached */
+extern void gic_init(void);
+/* Bring up a secondary CPU's per-CPU GIC interface */
+extern void gic_init_secondary_cpu(void);
+/* Take down a CPU's per-CPU GIC interface */
+extern void gic_disable_cpu(void);
+/* setup the gic virtual interface for a guest */
+extern int gicv_setup(struct domain *d);
+
+/* Context switch */
+extern void gic_save_state(struct vcpu *v);
+extern void gic_restore_state(struct vcpu *v);
+
+#endif /* __ASSEMBLY__ */
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:12:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:12:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tlijk-0007gP-VD; Thu, 20 Dec 2012 16:12:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tlijk-0007g1-0F
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:12:44 +0000
Received: from [85.158.139.83:45392] by server-14.bemta-5.messagelabs.com id
	E4/A8-09538-BF833D05; Thu, 20 Dec 2012 16:12:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1356019870!28027619!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14087 invoked from network); 20 Dec 2012 16:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiE-0005f7-Cy
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiD-000687-U7
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:09 +0000
Message-Id: <E1TliiD-000687-U7@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: do not map vGIC twice for
	dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1355926577 0
# Node ID d0a4968e857893d9b159061f4bc7755675728709
# Parent  5fb0b8b838dab0b331abfa675fd2b2214ac90760
xen/arm: do not map vGIC twice for dom0

We don't need to manually set the P2M for the vGIC in construct_dom0,
because we have already done it generally for every guest in gicv_setup.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 5fb0b8b838da -r d0a4968e8578 xen/arch/arm/domain_build.c
--- a/xen/arch/arm/domain_build.c	Wed Dec 19 11:42:09 2012 +0100
+++ b/xen/arch/arm/domain_build.c	Wed Dec 19 14:16:17 2012 +0000
@@ -282,8 +282,6 @@ int construct_dom0(struct domain *d)
     map_mmio_regions(d, 0x18000000, 0x1BFFFFFF, 0x18000000);
     printk("Map CS3 MMIO regions 1:1 in the P2M %#llx->%#llx\n", 0x1C000000ULL, 0x1FFFFFFFULL);
     map_mmio_regions(d, 0x1C000000, 0x1FFFFFFF, 0x1C000000);
-    printk("Map VGIC MMIO regions 1:1 in the P2M %#llx->%#llx\n", 0x2C008000ULL, 0x2DFFFFFFULL);
-    map_mmio_regions(d, 0x2C008000, 0x2DFFFFFF, 0x2C008000);
 
     printk("Routing peripheral interrupts to guest\n");
     /* TODO Get from device tree */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Dec 20 16:12:45 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 20 Dec 2012 16:12:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Tlijk-0007gP-VD; Thu, 20 Dec 2012 16:12:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1Tlijk-0007g1-0F
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:12:44 +0000
Received: from [85.158.139.83:45392] by server-14.bemta-5.messagelabs.com id
	E4/A8-09538-BF833D05; Thu, 20 Dec 2012 16:12:43 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1356019870!28027619!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14087 invoked from network); 20 Dec 2012 16:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Dec 2012 16:11:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiE-0005f7-Cy
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TliiD-000687-U7
	for xen-changelog@lists.xensource.com; Thu, 20 Dec 2012 16:11:09 +0000
Message-Id: <E1TliiD-000687-U7@xenbits.xen.org>
Date: Thu, 20 Dec 2012 16:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xen/arm: do not map vGIC twice for
	dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1355926577 0
# Node ID d0a4968e857893d9b159061f4bc7755675728709
# Parent  5fb0b8b838dab0b331abfa675fd2b2214ac90760
xen/arm: do not map vGIC twice for dom0

We don't need to manually set the P2M for the vGIC in construct_dom0,
because we have already done it generally for every guest in gicv_setup.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 5fb0b8b838da -r d0a4968e8578 xen/arch/arm/domain_build.c
--- a/xen/arch/arm/domain_build.c	Wed Dec 19 11:42:09 2012 +0100
+++ b/xen/arch/arm/domain_build.c	Wed Dec 19 14:16:17 2012 +0000
@@ -282,8 +282,6 @@ int construct_dom0(struct domain *d)
     map_mmio_regions(d, 0x18000000, 0x1BFFFFFF, 0x18000000);
     printk("Map CS3 MMIO regions 1:1 in the P2M %#llx->%#llx\n", 0x1C000000ULL, 0x1FFFFFFFULL);
     map_mmio_regions(d, 0x1C000000, 0x1FFFFFFF, 0x1C000000);
-    printk("Map VGIC MMIO regions 1:1 in the P2M %#llx->%#llx\n", 0x2C008000ULL, 0x2DFFFFFFULL);
-    map_mmio_regions(d, 0x2C008000, 0x2DFFFFFF, 0x2C008000);
 
     printk("Routing peripheral interrupts to guest\n");
     /* TODO Get from device tree */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 21 04:00:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Dec 2012 04:00:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TltmW-0006pr-Eu; Fri, 21 Dec 2012 04:00:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TltmV-0006pj-5g
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 04:00:19 +0000
Received: from [85.158.139.83:4406] by server-4.bemta-5.messagelabs.com id
	4D/44-14693-2DED3D05; Fri, 21 Dec 2012 04:00:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1356062416!29078101!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10530 invoked from network); 21 Dec 2012 04:00:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2012 04:00:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TltmR-0003fK-Or
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 04:00:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TltmR-0007Ac-7U
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 04:00:15 +0000
Message-Id: <E1TltmR-0007Ac-7U@xenbits.xen.org>
Date: Fri, 21 Dec 2012 04:00:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: also print CRn register values
	upon double fault
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355997632 -3600
# Node ID 6f5c96855a9e95d8b3919e289ed7dde38ef83a00
# Parent  090cc3e20d3e7eda0b496797e03be6b57c2b54fd
x86: also print CRn register values upon double fault

Do so by simply re-using _show_registers().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 090cc3e20d3e -r 6f5c96855a9e xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Wed Dec 19 16:04:50 2012 +0000
+++ b/xen/arch/x86/x86_64/traps.c	Thu Dec 20 11:00:32 2012 +0100
@@ -225,6 +225,7 @@ void double_fault(void);
 void do_double_fault(struct cpu_user_regs *regs)
 {
     unsigned int cpu;
+    unsigned long crs[8];
 
     watchdog_disable();
 
@@ -235,22 +236,18 @@ void do_double_fault(struct cpu_user_reg
     /* Find information saved during fault and dump it to the console. */
     printk("*** DOUBLE FAULT ***\n");
     print_xen_info();
-    printk("CPU:    %d\nRIP:    %04x:[<%016lx>]",
-           cpu, regs->cs, regs->rip);
-    print_symbol(" %s", regs->rip);
-    printk("\nRFLAGS: %016lx\n", regs->rflags);
-    printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
-           regs->rax, regs->rbx, regs->rcx);
-    printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
-           regs->rdx, regs->rsi, regs->rdi);
-    printk("rbp: %016lx   rsp: %016lx   r8:  %016lx\n",
-           regs->rbp, regs->rsp, regs->r8);
-    printk("r9:  %016lx   r10: %016lx   r11: %016lx\n",
-           regs->r9,  regs->r10, regs->r11);
-    printk("r12: %016lx   r13: %016lx   r14: %016lx\n",
-           regs->r12, regs->r13, regs->r14);
-    printk("r15: %016lx    cs: %016lx    ss: %016lx\n",
-           regs->r15, (long)regs->cs, (long)regs->ss);
+
+    crs[0] = read_cr0();
+    crs[2] = read_cr2();
+    crs[3] = read_cr3();
+    crs[4] = read_cr4();
+    regs->ds = read_segment_register(ds);
+    regs->es = read_segment_register(es);
+    regs->fs = read_segment_register(fs);
+    regs->gs = read_segment_register(gs);
+
+    printk("CPU:    %d\n", cpu);
+    _show_registers(regs, crs, CTXT_hypervisor, NULL);
     show_stack_overflow(cpu, regs->rsp);
 
     panic("DOUBLE FAULT -- system shutdown\n");

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 21 04:00:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Dec 2012 04:00:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TltmW-0006pr-Eu; Fri, 21 Dec 2012 04:00:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TltmV-0006pj-5g
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 04:00:19 +0000
Received: from [85.158.139.83:4406] by server-4.bemta-5.messagelabs.com id
	4D/44-14693-2DED3D05; Fri, 21 Dec 2012 04:00:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1356062416!29078101!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10530 invoked from network); 21 Dec 2012 04:00:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2012 04:00:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TltmR-0003fK-Or
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 04:00:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TltmR-0007Ac-7U
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 04:00:15 +0000
Message-Id: <E1TltmR-0007Ac-7U@xenbits.xen.org>
Date: Fri, 21 Dec 2012 04:00:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: also print CRn register values
	upon double fault
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1355997632 -3600
# Node ID 6f5c96855a9e95d8b3919e289ed7dde38ef83a00
# Parent  090cc3e20d3e7eda0b496797e03be6b57c2b54fd
x86: also print CRn register values upon double fault

Do so by simply re-using _show_registers().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 090cc3e20d3e -r 6f5c96855a9e xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c	Wed Dec 19 16:04:50 2012 +0000
+++ b/xen/arch/x86/x86_64/traps.c	Thu Dec 20 11:00:32 2012 +0100
@@ -225,6 +225,7 @@ void double_fault(void);
 void do_double_fault(struct cpu_user_regs *regs)
 {
     unsigned int cpu;
+    unsigned long crs[8];
 
     watchdog_disable();
 
@@ -235,22 +236,18 @@ void do_double_fault(struct cpu_user_reg
     /* Find information saved during fault and dump it to the console. */
     printk("*** DOUBLE FAULT ***\n");
     print_xen_info();
-    printk("CPU:    %d\nRIP:    %04x:[<%016lx>]",
-           cpu, regs->cs, regs->rip);
-    print_symbol(" %s", regs->rip);
-    printk("\nRFLAGS: %016lx\n", regs->rflags);
-    printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
-           regs->rax, regs->rbx, regs->rcx);
-    printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
-           regs->rdx, regs->rsi, regs->rdi);
-    printk("rbp: %016lx   rsp: %016lx   r8:  %016lx\n",
-           regs->rbp, regs->rsp, regs->r8);
-    printk("r9:  %016lx   r10: %016lx   r11: %016lx\n",
-           regs->r9,  regs->r10, regs->r11);
-    printk("r12: %016lx   r13: %016lx   r14: %016lx\n",
-           regs->r12, regs->r13, regs->r14);
-    printk("r15: %016lx    cs: %016lx    ss: %016lx\n",
-           regs->r15, (long)regs->cs, (long)regs->ss);
+
+    crs[0] = read_cr0();
+    crs[2] = read_cr2();
+    crs[3] = read_cr3();
+    crs[4] = read_cr4();
+    regs->ds = read_segment_register(ds);
+    regs->es = read_segment_register(es);
+    regs->fs = read_segment_register(fs);
+    regs->gs = read_segment_register(gs);
+
+    printk("CPU:    %d\n", cpu);
+    _show_registers(regs, crs, CTXT_hypervisor, NULL);
     show_stack_overflow(cpu, regs->rsp);
 
     panic("DOUBLE FAULT -- system shutdown\n");

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 21 09:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Dec 2012 09:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlydJ-0001Rq-KC; Fri, 21 Dec 2012 09:11:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlydI-0001Rh-Ak
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 09:11:08 +0000
Received: from [85.158.139.83:3480] by server-10.bemta-5.messagelabs.com id
	53/1B-13383-BA724D05; Fri, 21 Dec 2012 09:11:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1356081065!30874559!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23491 invoked from network); 21 Dec 2012 09:11:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2012 09:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlydE-0007Tk-Mk
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 09:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlydE-0006On-4A
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 09:11:04 +0000
Message-Id: <E1TlydE-0006On-4A@xenbits.xen.org>
Date: Fri, 21 Dec 2012 09:11:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] adjust module parameter types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1356080471 -3600
# Node ID c340a22a3a6339aadffc9a7d4d9eef10d52b7b94
# Parent  302f7c9423c9ab30f0cad07f334db90c05796f7d
adjust module parameter types

In particular use "unsigned" and "bool" where the parameter has
respective meaning, and make the respective variables static where
possible and not already done.

Also drop the use of the bogus USBIF_BACK_MAX_PENDING_REQS definition
and do some minimal cleanup.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/blkback/blkback.c
--- a/drivers/xen/blkback/blkback.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/blkback/blkback.c	Fri Dec 21 10:01:11 2012 +0100
@@ -55,15 +55,15 @@
  * This will increase the chances of being able to write whole tracks.
  * 64 should be enough to keep us competitive with Linux.
  */
-static int blkif_reqs = 64;
-module_param_named(reqs, blkif_reqs, int, 0);
+static unsigned int blkif_reqs = 64;
+module_param_named(reqs, blkif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of blkback requests to allocate");
 
 /* Run-time switchable: /sys/module/blkback/parameters/ */
-static unsigned int log_stats = 0;
-static unsigned int debug_lvl = 0;
-module_param(log_stats, int, 0644);
-module_param(debug_lvl, int, 0644);
+static int log_stats;
+static unsigned int debug_lvl;
+module_param(log_stats, bool, 0644);
+module_param(debug_lvl, uint, 0644);
 
 /*
  * Each outstanding request that we've passed to the lower device layers has a 
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/blktap/blktap.c	Fri Dec 21 10:01:11 2012 +0100
@@ -127,10 +127,10 @@ static struct tap_blkif *tapfds[MAX_TAP_
 static int blktap_next_minor;
 
 /* Run-time switchable: /sys/module/blktap/parameters/ */
-static unsigned int log_stats = 0;
-static unsigned int debug_lvl = 0;
-module_param(log_stats, int, 0644);
-module_param(debug_lvl, int, 0644);
+static int log_stats;
+static unsigned int debug_lvl;
+module_param(log_stats, bool, 0644);
+module_param(debug_lvl, uint, 0644);
 
 /*
  * Each outstanding request that we've passed to the lower device layers has a 
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/fbfront/xenfb.c
--- a/drivers/xen/fbfront/xenfb.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/fbfront/xenfb.c	Fri Dec 21 10:01:11 2012 +0100
@@ -138,8 +138,8 @@ struct xenfb_info
 #define XENFB_DEFAULT_FB_LEN (XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8)
 
 enum {KPARAM_MEM, KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT};
-static int video[KPARAM_CNT] = {2, XENFB_WIDTH, XENFB_HEIGHT};
-module_param_array(video, int, NULL, 0);
+static unsigned int video[KPARAM_CNT] = {2, XENFB_WIDTH, XENFB_HEIGHT};
+module_param_array(video, uint, NULL, 0);
 MODULE_PARM_DESC(video,
 		"Size of video memory in MB and width,height in pixels, default = (2,800,600)");
 
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/pciback/pciback_ops.c
--- a/drivers/xen/pciback/pciback_ops.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/pciback/pciback_ops.c	Fri Dec 21 10:01:11 2012 +0100
@@ -10,7 +10,7 @@
 #include "pciback.h"
 
 int verbose_request = 0;
-module_param(verbose_request, int, 0644);
+module_param(verbose_request, bool, 0644);
 
 /* Ensure a device is "turned off" and ready to be exported.
  * (Also see pciback_config_reset to ensure virtual configuration space is
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/pcifront/pci_op.c
--- a/drivers/xen/pcifront/pci_op.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/pcifront/pci_op.c	Fri Dec 21 10:01:11 2012 +0100
@@ -12,8 +12,8 @@
 #include <xen/evtchn.h>
 #include "pcifront.h"
 
-static int verbose_request = 0;
-module_param(verbose_request, int, 0644);
+static int verbose_request;
+module_param(verbose_request, bool, 0644);
 
 static void pcifront_init_sd(struct pcifront_sd *sd,
 			     unsigned int domain, unsigned int bus,
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/scsiback/scsiback.c
--- a/drivers/xen/scsiback/scsiback.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/scsiback/scsiback.c	Fri Dec 21 10:01:11 2012 +0100
@@ -56,8 +56,8 @@ static unsigned int vscsiif_reqs = 128;
 module_param_named(reqs, vscsiif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of scsiback requests to allocate");
 
-static unsigned int log_print_stat = 0;
-module_param(log_print_stat, int, 0644);
+static int log_print_stat;
+module_param(log_print_stat, bool, 0644);
 
 #define SCSIBACK_INVALID_HANDLE (~0)
 
@@ -219,10 +219,8 @@ static void scsiback_cmd_done(struct req
 	resid        = req->data_len;
 	errors       = req->errors;
 
-	if (errors != 0) {
-		if (log_print_stat)
-			scsiback_print_status(sense_buffer, errors, pending_req);
-	}
+	if (errors && log_print_stat)
+		scsiback_print_status(sense_buffer, errors, pending_req);
 
 	/* The Host mode is through as for Emulation. */
 	if (pending_req->info->feature != VSCSI_TYPE_HOST)
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/usbback/usbback.c
--- a/drivers/xen/usbback/usbback.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/usbback/usbback.c	Fri Dec 21 10:01:11 2012 +0100
@@ -53,8 +53,8 @@
 #include "../../usb/core/hub.h"
 #endif
 
-int usbif_reqs = USBIF_BACK_MAX_PENDING_REQS;
-module_param_named(reqs, usbif_reqs, int, 0);
+static unsigned int usbif_reqs = 128;
+module_param_named(reqs, usbif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of usbback requests to allocate");
 
 struct pending_req_segment {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Dec 21 09:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 21 Dec 2012 09:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TlydJ-0001Rq-KC; Fri, 21 Dec 2012 09:11:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlydI-0001Rh-Ak
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 09:11:08 +0000
Received: from [85.158.139.83:3480] by server-10.bemta-5.messagelabs.com id
	53/1B-13383-BA724D05; Fri, 21 Dec 2012 09:11:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1356081065!30874559!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23491 invoked from network); 21 Dec 2012 09:11:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Dec 2012 09:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlydE-0007Tk-Mk
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 09:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TlydE-0006On-4A
	for xen-changelog@lists.xensource.com; Fri, 21 Dec 2012 09:11:04 +0000
Message-Id: <E1TlydE-0006On-4A@xenbits.xen.org>
Date: Fri, 21 Dec 2012 09:11:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] adjust module parameter types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1356080471 -3600
# Node ID c340a22a3a6339aadffc9a7d4d9eef10d52b7b94
# Parent  302f7c9423c9ab30f0cad07f334db90c05796f7d
adjust module parameter types

In particular use "unsigned" and "bool" where the parameter has
respective meaning, and make the respective variables static where
possible and not already done.

Also drop the use of the bogus USBIF_BACK_MAX_PENDING_REQS definition
and do some minimal cleanup.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/blkback/blkback.c
--- a/drivers/xen/blkback/blkback.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/blkback/blkback.c	Fri Dec 21 10:01:11 2012 +0100
@@ -55,15 +55,15 @@
  * This will increase the chances of being able to write whole tracks.
  * 64 should be enough to keep us competitive with Linux.
  */
-static int blkif_reqs = 64;
-module_param_named(reqs, blkif_reqs, int, 0);
+static unsigned int blkif_reqs = 64;
+module_param_named(reqs, blkif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of blkback requests to allocate");
 
 /* Run-time switchable: /sys/module/blkback/parameters/ */
-static unsigned int log_stats = 0;
-static unsigned int debug_lvl = 0;
-module_param(log_stats, int, 0644);
-module_param(debug_lvl, int, 0644);
+static int log_stats;
+static unsigned int debug_lvl;
+module_param(log_stats, bool, 0644);
+module_param(debug_lvl, uint, 0644);
 
 /*
  * Each outstanding request that we've passed to the lower device layers has a 
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/blktap/blktap.c	Fri Dec 21 10:01:11 2012 +0100
@@ -127,10 +127,10 @@ static struct tap_blkif *tapfds[MAX_TAP_
 static int blktap_next_minor;
 
 /* Run-time switchable: /sys/module/blktap/parameters/ */
-static unsigned int log_stats = 0;
-static unsigned int debug_lvl = 0;
-module_param(log_stats, int, 0644);
-module_param(debug_lvl, int, 0644);
+static int log_stats;
+static unsigned int debug_lvl;
+module_param(log_stats, bool, 0644);
+module_param(debug_lvl, uint, 0644);
 
 /*
  * Each outstanding request that we've passed to the lower device layers has a 
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/fbfront/xenfb.c
--- a/drivers/xen/fbfront/xenfb.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/fbfront/xenfb.c	Fri Dec 21 10:01:11 2012 +0100
@@ -138,8 +138,8 @@ struct xenfb_info
 #define XENFB_DEFAULT_FB_LEN (XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8)
 
 enum {KPARAM_MEM, KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT};
-static int video[KPARAM_CNT] = {2, XENFB_WIDTH, XENFB_HEIGHT};
-module_param_array(video, int, NULL, 0);
+static unsigned int video[KPARAM_CNT] = {2, XENFB_WIDTH, XENFB_HEIGHT};
+module_param_array(video, uint, NULL, 0);
 MODULE_PARM_DESC(video,
 		"Size of video memory in MB and width,height in pixels, default = (2,800,600)");
 
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/pciback/pciback_ops.c
--- a/drivers/xen/pciback/pciback_ops.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/pciback/pciback_ops.c	Fri Dec 21 10:01:11 2012 +0100
@@ -10,7 +10,7 @@
 #include "pciback.h"
 
 int verbose_request = 0;
-module_param(verbose_request, int, 0644);
+module_param(verbose_request, bool, 0644);
 
 /* Ensure a device is "turned off" and ready to be exported.
  * (Also see pciback_config_reset to ensure virtual configuration space is
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/pcifront/pci_op.c
--- a/drivers/xen/pcifront/pci_op.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/pcifront/pci_op.c	Fri Dec 21 10:01:11 2012 +0100
@@ -12,8 +12,8 @@
 #include <xen/evtchn.h>
 #include "pcifront.h"
 
-static int verbose_request = 0;
-module_param(verbose_request, int, 0644);
+static int verbose_request;
+module_param(verbose_request, bool, 0644);
 
 static void pcifront_init_sd(struct pcifront_sd *sd,
 			     unsigned int domain, unsigned int bus,
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/scsiback/scsiback.c
--- a/drivers/xen/scsiback/scsiback.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/scsiback/scsiback.c	Fri Dec 21 10:01:11 2012 +0100
@@ -56,8 +56,8 @@ static unsigned int vscsiif_reqs = 128;
 module_param_named(reqs, vscsiif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of scsiback requests to allocate");
 
-static unsigned int log_print_stat = 0;
-module_param(log_print_stat, int, 0644);
+static int log_print_stat;
+module_param(log_print_stat, bool, 0644);
 
 #define SCSIBACK_INVALID_HANDLE (~0)
 
@@ -219,10 +219,8 @@ static void scsiback_cmd_done(struct req
 	resid        = req->data_len;
 	errors       = req->errors;
 
-	if (errors != 0) {
-		if (log_print_stat)
-			scsiback_print_status(sense_buffer, errors, pending_req);
-	}
+	if (errors && log_print_stat)
+		scsiback_print_status(sense_buffer, errors, pending_req);
 
 	/* The Host mode is through as for Emulation. */
 	if (pending_req->info->feature != VSCSI_TYPE_HOST)
diff -r 302f7c9423c9 -r c340a22a3a63 drivers/xen/usbback/usbback.c
--- a/drivers/xen/usbback/usbback.c	Tue Dec 18 10:42:20 2012 +0100
+++ b/drivers/xen/usbback/usbback.c	Fri Dec 21 10:01:11 2012 +0100
@@ -53,8 +53,8 @@
 #include "../../usb/core/hub.h"
 #endif
 
-int usbif_reqs = USBIF_BACK_MAX_PENDING_REQS;
-module_param_named(reqs, usbif_reqs, int, 0);
+static unsigned int usbif_reqs = 128;
+module_param_named(reqs, usbif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of usbback requests to allocate");
 
 struct pending_req_segment {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Dec 22 04:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Dec 2012 04:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TmGbG-0000Oo-He; Sat, 22 Dec 2012 04:22:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TmGbE-0000Oj-KO
	for xen-changelog@lists.xensource.com; Sat, 22 Dec 2012 04:22:12 +0000
Received: from [193.109.254.147:37799] by server-6.bemta-14.messagelabs.com id
	1A/11-25153-37535D05; Sat, 22 Dec 2012 04:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-27.messagelabs.com!1356150130!11253284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12828 invoked from network); 22 Dec 2012 04:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Dec 2012 04:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TmGbB-0001wf-O3
	for xen-changelog@lists.xensource.com; Sat, 22 Dec 2012 04:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TmGbA-0001Rs-K3
	for xen-changelog@lists.xensource.com; Sat, 22 Dec 2012 04:22:09 +0000
Message-Id: <E1TmGbA-0001Rs-K3@xenbits.xen.org>
Date: Sat, 22 Dec 2012 04:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/tests: Restrict some tests to
	x86 only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1356109538 0
# Node ID c4114a042410d3bdec3a77c30b2e85366d7fbe1d
# Parent  6f5c96855a9e95d8b3919e289ed7dde38ef83a00
tools/tests: Restrict some tests to x86 only

MCE injection and x86_emulator are clearly x86 specific.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 6f5c96855a9e -r c4114a042410 tools/tests/Makefile
--- a/tools/tests/Makefile	Thu Dec 20 11:00:32 2012 +0100
+++ b/tools/tests/Makefile	Fri Dec 21 17:05:38 2012 +0000
@@ -5,12 +5,12 @@ CFLAGS  += $(CFLAGS_libxenctrl)
 LDLIBS += $(LDLIBS_libxenctrl)
 
 SUBDIRS-y :=
-SUBDIRS-y += mce-test
+SUBDIRS-$(CONFIG_X86) += mce-test
 SUBDIRS-y += mem-sharing
 ifeq ($(XEN_TARGET_ARCH),__fixme__)
 SUBDIRS-y += regression
 endif
-SUBDIRS-y += x86_emulator
+SUBDIRS-$(CONFIG_X86) += x86_emulator
 SUBDIRS-y += xen-access
 
 .PHONY: all clean install distclean

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Dec 22 04:22:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 22 Dec 2012 04:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1TmGbG-0000Oo-He; Sat, 22 Dec 2012 04:22:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TmGbE-0000Oj-KO
	for xen-changelog@lists.xensource.com; Sat, 22 Dec 2012 04:22:12 +0000
Received: from [193.109.254.147:37799] by server-6.bemta-14.messagelabs.com id
	1A/11-25153-37535D05; Sat, 22 Dec 2012 04:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-27.messagelabs.com!1356150130!11253284!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.6.1.8; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12828 invoked from network); 22 Dec 2012 04:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Dec 2012 04:22:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TmGbB-0001wf-O3
	for xen-changelog@lists.xensource.com; Sat, 22 Dec 2012 04:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1TmGbA-0001Rs-K3
	for xen-changelog@lists.xensource.com; Sat, 22 Dec 2012 04:22:09 +0000
Message-Id: <E1TmGbA-0001Rs-K3@xenbits.xen.org>
Date: Sat, 22 Dec 2012 04:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/tests: Restrict some tests to
	x86 only
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1356109538 0
# Node ID c4114a042410d3bdec3a77c30b2e85366d7fbe1d
# Parent  6f5c96855a9e95d8b3919e289ed7dde38ef83a00
tools/tests: Restrict some tests to x86 only

MCE injection and x86_emulator are clearly x86 specific.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 6f5c96855a9e -r c4114a042410 tools/tests/Makefile
--- a/tools/tests/Makefile	Thu Dec 20 11:00:32 2012 +0100
+++ b/tools/tests/Makefile	Fri Dec 21 17:05:38 2012 +0000
@@ -5,12 +5,12 @@ CFLAGS  += $(CFLAGS_libxenctrl)
 LDLIBS += $(LDLIBS_libxenctrl)
 
 SUBDIRS-y :=
-SUBDIRS-y += mce-test
+SUBDIRS-$(CONFIG_X86) += mce-test
 SUBDIRS-y += mem-sharing
 ifeq ($(XEN_TARGET_ARCH),__fixme__)
 SUBDIRS-y += regression
 endif
-SUBDIRS-y += x86_emulator
+SUBDIRS-$(CONFIG_X86) += x86_emulator
 SUBDIRS-y += xen-access
 
 .PHONY: all clean install distclean

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

